View Single Post
  #11   Spotlight this post!  
Unread 21-03-2016, 11:58
jreneew2's Avatar
jreneew2 jreneew2 is offline
Alumni of Team 2053 Tigertronics
AKA: Drew Williams
FRC #2053 (TigerTronics)
Team Role: Programmer
 
Join Date: Jan 2014
Rookie Year: 2013
Location: Vestal, NY
Posts: 203
jreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura aboutjreneew2 has a spectacular aura about
Re: Send data from raspberry pi to roboRIO using c++

Alright, I got the code to compile and I am trying to send the actual data now. However, I am not getting any values in the outline viewer. Here is my setup:

- Raspberry pi hooked up through ethernet to router which is also connected to roborio.

- Here is my code on the robot side:

Robot.cpp
Code:
static std::shared_ptr<NetworkTable> table;
NetworkTable::SetIPAddress("10.20.53.21");
NetworkTable::SetClientMode();
NetworkTable::Initialize();
table = NetworkTable::GetTable("vision");
GoalAlign.cpp
Code:
distanceToCenter = Robot::table->GetNumber("center", 0.0);
- On the raspberry pi side
Code:
std::shared_ptr<NetworkTable> visionTable;
visionTable = NetworkTable::GetTable("vision");
visionTable->PutNumber("center", distanceCenter);
I'm not sure if I am doing this correctly. I'm not getting any errors but I'm not getting any values either.

- Drew