View Full Version : Using GRIP on Raspberry Pi
My team recently discovered vision so I'm just playing around. So if I use a Pi as a co-processor, I have several questions
1) what is a network table (yes, I don't know lol) and how do I read the network table openCV processes?
2) how I feed this data back to the roboRIO to center our drive train?
If you have github repos for Pi processing, I'd love to read them. Thanks :)
euhlmann
17-11-2016, 19:54
NetworkTables is a library for synchronizing variables over multiple machines in a network. It allows you to read what you publish from the RIO on your driver station, but it also allows the RIO to read values from another network device, and so can your driver station.
The RIO is the server. So, both the Pi and the driver station connect to the RIO. However, using NetworkTables is mostly the same regardless of whether you are on the client or the server. You can read values on the rio that the Pi publishes using something like this
NetworkTable gripTable = NetworkTable.getTable("path/to/grip/table");
double someValue = gripTable.getNumber("numberVariableName", defaultValue)
//Or getString, getBoolean, etc
You can read the documentation on Screensteps for more info on NetworkTables.
To center
- With a gyroscope: calculate the angle to the target and turn by that amount. If your camera is nice, use a simple pinhole camera model. If not, you're kind of screwed because the distortion correction functions of OpenCV aren't in GRIP last time I checked :(
- Without a gyroscope: turn until the target is centered. This will be much slower than if you had a gyro because the feedback is slower
Hi! I'm working to try and implement this:
https://github.com/WPIRoboticsProjects/GRIP/wiki/Running-GRIP-on-a-Raspberry-Pi-2
I'm using a Pi 3, and the Pi camera. So far I'm successfully able to stream the camera to GRIP on the PC, but when I start GRIP on the Pi, I get an error.
Working in another thread about the error
https://www.chiefdelphi.com/forums/showthread.php?t=151892
vBulletin® v3.6.4, Copyright ©2000-2017, Jelsoft Enterprises Ltd.