View Single Post
  #2   Spotlight this post!  
Unread 17-11-2016, 19:54
euhlmann's Avatar
euhlmann euhlmann is offline
CTO, Programmer
AKA: Erik Uhlmann
FRC #2877 (LigerBots)
Team Role: Leadership
 
Join Date: Dec 2015
Rookie Year: 2015
Location: United States
Posts: 296
euhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud ofeuhlmann has much to be proud of
Re: Using GRIP on Raspberry Pi

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
Code:
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
__________________
Creator of SmartDashboard.js, an extensible nodejs/webkit replacement for SmartDashboard


https://ligerbots.org

Last edited by euhlmann : 17-11-2016 at 19:57.
Reply With Quote