|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
||||
|
||||
|
Re: How send ultrasonic sensor data to driver station?
Yup. Put both of these lines in roboInit and you should be good. And do you know how to start the smart dashboard?
|
|
#2
|
||||
|
||||
|
Re: How send ultrasonic sensor data to driver station?
No I don't know how to start it up. Thanks again!
|
|
#3
|
||||
|
||||
|
Re: How send ultrasonic sensor data to driver station?
Ok, so first you want to make sure you have this folder on the driver station http://tinyurl.com/smrtdshbd. On the DS, go to wpilib -> tools -> smartdashboard.jar when you are connected to the robot. To test your code on your own computer, make sure you have the robotpy eclipse plugins https://github.com/robotpy/robotpy-e...ster/README.md. Then, in the eclipse menu bar, click WPILib, then Run Simulation Smartdashboard. This will let you see the ultrasonic sensor change based on the value you change in the simulator.
|
|
#4
|
||||
|
||||
|
Re: How send ultrasonic sensor data to driver station?
Quote:
|
|
#5
|
||||
|
||||
|
Re: How send ultrasonic sensor data to driver station?
Quote:
Ok, if you just want to use the info from the sensors, then you just need to use self.ultrasonic.getVoltage(). You don't have to go through SmartDashboard, but for getting the data of the ultrasonic (what the value is when the robot is 5 inches from the bin, for example), it would be wise to just put that value in SDB and write it down. |
|
#6
|
||||
|
||||
|
Re: How send ultrasonic sensor data to driver station?
Instead of writing down the values read by the SmartDashboard, you can just use the csv.txt file. In the preferences menu, just click the checkbox labeled "Log to CSV" before you enable a run you want to record. The file records a timestamp and a key value pair every time the putNumber function is called.
|
|
#7
|
||||
|
||||
|
Re: How send ultrasonic sensor data to driver station?
Quote:
|
|
#8
|
||||
|
||||
|
Re: How send ultrasonic sensor data to driver station?
Ok thanks, I will try to set up the SmartDashboard tomorrow. Though it does sound quite complicated to set up. Thanks so much for your help!!!
Last edited by team-4480 : 25-01-2015 at 21:50. |
|
#9
|
|||
|
|||
|
Re: How send ultrasonic sensor data to driver station?
The NetworkTables shared storage is implemented across all languages and all dashboards. So you can pretty easily add the display to either dashboard and publish on your robot.
Greg McKaskle |
|
#10
|
||||
|
||||
|
Re: How send ultrasonic sensor data to driver station?
team-4480, since you have a lot of questions, it may benefit you to go to https://webchat.freenode.net/ and join the #robotpy channel. VirtualD and I are normally on there (he more than I) and it would be faster communication
|
|
#11
|
||||
|
||||
|
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. Last edited by virtuald : 27-01-2015 at 14:50. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|