Go to Post So yeah I love the minibot because it was a great vehicle to promote our team, make new friends, and possibly make sure a team makes it past their 1st or 2nd year. - Mr V [more]
Home
Go Back   Chief Delphi > Technical > Programming > C/C++
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 16-02-2014, 16:27
Nunez4296's Avatar
Nunez4296 Nunez4296 is offline
Programmer
AKA: Joseph Nuņez
FRC #4296 (Trident Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Gurnee IL
Posts: 39
Nunez4296 is an unknown quantity at this point
RoboRealm NetworkTables

Hey All, quick question (maybe) here, we are having a significant amount of trouble using RoboRealm to send variables back and forth over a network to the smart dashboard. We have read many documents and tutorials and everything just seems to sparse in information to help. Can you only use the network tables if you are programming in Java? and secondly, how can I pull variables from the network tables. the code that i have written so far resembles:

distance = table->NetworkTable::GetNumber("/SmartDashboard/Distance");
SmartDashboard:: PutNumber("RoboRealm Value", distance);

we believe everything is declared correctly and we are using the
"#include "NetWorkTables/NetworkTable.h"
the problem that I believe, is that the "distance = table->..." line breaks the loop. If anyone has an idea on how to fix this, it would be greatly appreciated.
Reply With Quote
  #2   Spotlight this post!  
Unread 16-02-2014, 17:17
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: RoboRealm NetworkTables

If RoboRealm is sending values to the Network Tables, and if those values are already displaying on the SmartDashboard, then the only code you need is:

Code:
double distance = SmartDashboard::GetNumber("Distance");
This is assuming RoboRealm's variable is named "Distance".
Reply With Quote
  #3   Spotlight this post!  
Unread 16-02-2014, 17:35
Nunez4296's Avatar
Nunez4296 Nunez4296 is offline
Programmer
AKA: Joseph Nuņez
FRC #4296 (Trident Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Gurnee IL
Posts: 39
Nunez4296 is an unknown quantity at this point
Re: RoboRealm NetworkTables

Thanks for the info, in the time that I posted this, we actually got a variable from RoboRealm to the SmartDashboard, the problem is, the variable is static and does not update if the camera is moved closer or further away. Basically what we are looking for is a command to force the SmartDashboard to update if there is such a thing.
Reply With Quote
  #4   Spotlight this post!  
Unread 16-02-2014, 17:40
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: RoboRealm NetworkTables

Then RoboRealm isn't doing its job and sending data to the Network Tables. Can you post a screenshot of your RoboRealm setup?
Reply With Quote
  #5   Spotlight this post!  
Unread 16-02-2014, 18:02
Nunez4296's Avatar
Nunez4296 Nunez4296 is offline
Programmer
AKA: Joseph Nuņez
FRC #4296 (Trident Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Gurnee IL
Posts: 39
Nunez4296 is an unknown quantity at this point
Re: RoboRealm NetworkTables

Here are pictures from RoboRealm, our WindRiver code, and an image from the SmartDashboard.
Attached Thumbnails
Click image for larger version

Name:	roborealm 1.png
Views:	35
Size:	731.0 KB
ID:	16262  Click image for larger version

Name:	roborealm 2.png
Views:	36
Size:	296.9 KB
ID:	16263  Click image for larger version

Name:	smartdashboard 1.png
Views:	31
Size:	27.8 KB
ID:	16264  Click image for larger version

Name:	windriver 1.png
Views:	32
Size:	10.6 KB
ID:	16265  Click image for larger version

Name:	windriver 2.png
Views:	31
Size:	3.4 KB
ID:	16266  

Reply With Quote
  #6   Spotlight this post!  
Unread 16-02-2014, 18:08
Nunez4296's Avatar
Nunez4296 Nunez4296 is offline
Programmer
AKA: Joseph Nuņez
FRC #4296 (Trident Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Gurnee IL
Posts: 39
Nunez4296 is an unknown quantity at this point
Re: RoboRealm NetworkTables

I feel compelled to clarify something, "FeretLevel" is just an inside joke in our team. We only called the variable that to make clear the difference between the distance value passed from RoboRealm and the value we were using within the code.
Reply With Quote
  #7   Spotlight this post!  
Unread 16-02-2014, 18:14
bvisness's Avatar
bvisness bvisness is offline
Programming Mentor, Former Driver
FRC #2175 (The Fighting Calculators)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Woodbury, MN
Posts: 181
bvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of lightbvisness is a glorious beacon of light
Re: RoboRealm NetworkTables

Everything seems correct. What's the problem? Do you know if the robot is successfully getting the number?

I would try putting "feretLevel" on the dashboard, something like this:

Code:
SmartDashboard::PutNumber("WeaselLevel",feretLevel);
That way, you'll see if the robot is getting the original Distance value and passing it back.
Reply With Quote
  #8   Spotlight this post!  
Unread 16-02-2014, 18:30
Nunez4296's Avatar
Nunez4296 Nunez4296 is offline
Programmer
AKA: Joseph Nuņez
FRC #4296 (Trident Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Gurnee IL
Posts: 39
Nunez4296 is an unknown quantity at this point
Re: RoboRealm NetworkTables

That was actually the reason we created the feretlevel variable. We pulled "Distance" from RoboRealm and were able to get a value for it on the dashboard. We wanted to see if we could use that value within the code, so we stored SmartDashboard::GetNumber("Distance) to feretlevel and then displayed feretlevel on the SmartDashboard. We got both of them to display the same value when we tried it, but they were still static.
Reply With Quote
  #9   Spotlight this post!  
Unread 17-02-2014, 00:23
kylelanman's Avatar
kylelanman kylelanman is offline
Programming Mentor
AKA: Kyle
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Tremont Il
Posts: 186
kylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to all
Re: RoboRealm NetworkTables

We are having the same problem. We have hot target detection working great in RoboRealm but the value we are sending through network tables is not changing. We can manually alter the value of the variable through the TableViewer and the robot will react accordingly. RoboRealm will not update the value though.

Our setup is similar.
We have a python script that populate a RR var. And then a NetworkTables block that sends the var the python script populated to the robot. We are printing "Hot..." and "Not Hot...." in the python script that is updating appropriately but the value doesn't appear to change in network tables.

Kyle
__________________
"May the coms be with you"

Is this a "programming error" or a "programmer error"?

Reply With Quote
  #10   Spotlight this post!  
Unread 22-02-2014, 09:38
kylelanman's Avatar
kylelanman kylelanman is offline
Programming Mentor
AKA: Kyle
FRC #2481 (Roboteers)
Team Role: Mentor
 
Join Date: Feb 2008
Rookie Year: 2007
Location: Tremont Il
Posts: 186
kylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to allkylelanman is a name known to all
Re: RoboRealm NetworkTables

I wanted to post our solution to this problem in hopes that it can help someone else.

For reasons unknown to us using the SmartDashboard table exhibited the 'stale' or 'static' value affect referenced above.

The Solution:

We are sending one number (double) called HOTTARGET.
0 is Not Hot
1 is Hot

In RoboReam we changed the NetworkTable from SmartDashboard to RoboRealm.

Here is the C++ side of things.

Code:
class Camera2481 : public Subsystem {
private:
NetworkTable* mTable; Camera2481() {
mTable = NetworkTables::GetTable("RoboRealm");
} bool IsHotTarget() {
int ht = mTable->GetNumber("HOTTARGET", 2); SmartDashboard::PutNumber("HOTTARGET", ht); return ht == 1;
}
};
__________________
"May the coms be with you"

Is this a "programming error" or a "programmer error"?

Reply With Quote
  #11   Spotlight this post!  
Unread 22-02-2014, 10:45
Nunez4296's Avatar
Nunez4296 Nunez4296 is offline
Programmer
AKA: Joseph Nuņez
FRC #4296 (Trident Robotics)
Team Role: Programmer
 
Join Date: Feb 2014
Rookie Year: 2013
Location: Gurnee IL
Posts: 39
Nunez4296 is an unknown quantity at this point
Re: RoboRealm NetworkTables

In the rush of the final week of building, we sort of put off vision tracking to finish the robot. I was not ignoring your comments but my team and I greatly appreciate your response. We will try out a modification of your sample code built for our application and i will get back to you as soon as possible. Thanks again.
Reply With Quote
Reply


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -5. The time now is 12:12.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi