View Single Post
  #11   Spotlight this post!  
Unread 27-01-2015, 14:48
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,086
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: How send ultrasonic sensor data to driver station?

WPILib has an ultrasonic sensor implementation that you may find useful: http://robotpy.readthedocs.org/en/la...ltrasonic.html

Once you get the distance data, you can send it to SmartDashboard as mentioned earlier -- wpilib.SmartDashboard.putNumber().

Running SmartDashboard/SFX is pretty simple, and is great for viewing the raw values that the robot sends back. However, if you want to do something with the values, you shouldn't use SmartDashboard/SFX (unless you want to write a SmartDashboard/SFX extension in java).

If you want to write your own networktables client (for example, your wxpython program) to talk to the robot, and receive values from the robot, check out pynetworktables. What you would do is import networktables, get the SmartDashboard table, and ask for the values. You can also get notifications when new data values are sent by the robot, for easier usage.

There's an example here and here.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff

Last edited by virtuald : 27-01-2015 at 14:50.