|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
||||
|
||||
|
NetworkTables between Pi and Rio
Has anybody successfully created a commincation link between a RPi and a RoboRio with a radio in between? If so, could someone explain it or send old code?
Thanks, -Max DeVos KING TeC 2169 |
|
#2
|
||||
|
||||
|
Re: NetworkTables between Pi and Rio
We are using Python on our Pi and Java on our RoboRIO.
After installing Python on the Pi, you can install pynetworktables using pip Code:
pip install pynetworktables Code:
NetworkTables.setClientMode()
NetworkTables.setIPAddress('roboRIO-2169-FRC.local')
NetworkTables.initialize()
Code:
table = NetworkTables.getTable('/testnetworktable')
table.putNumber('test_key', number_you_want_to_send)
Code:
foo = table.getBoolean('foo', True)
You can also swap out roboRIO-2169-FRC.local for a static IP of your robot 10.21.69.2 (I actually think that is the preferred way to do it). You can read up on pynetworktables here. |
|
#3
|
||||
|
||||
|
Re: NetworkTables between Pi and Rio
Alright, that is extremely useful. Could you tell me what the Java side would look like?
|
|
#4
|
||||
|
||||
|
That is pretty well documented here http://wpilib.screenstepslive.com/s/...-networktables.
After that it is up to you. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|