Go to Post You know you're addicted to FIRST when...you realize that Dean IS changing society with FIRST and you love the fact that you are helping. - EStokely [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 10-03-2014, 22:34
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
NetworkTables C++

This has been something I have always stumbled upon. This year, I am aiming to seamlessly integrate two systems together, one being the main robot code written in Java, and the other being the vision code running in C++. I am going to have my vision code run in Embedded Linux (ARM). I have not been able to find any good source for a library that will allow me to easily use NetworkTables.

Please point me to some resources. I wish to create a thread with a good answer so anyone else shot in the dark like me will have an easy time

Good Luck and Thanks!
Good Luck with your season and competitions!
  #2   Spotlight this post!  
Unread 11-03-2014, 00:09
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,058
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: NetworkTables C++

You can run pynetworktables on a pc, but that requires python.

Alternatively, you can use the source code that pynetworktables is compiled from to build a C++ version of the library (as it is C++ underneath).

Cross-platform files required: https://github.com/robotpy/pynetwork...ree/master/src
Patched wpilib source that will compile on Windows and Linux: https://github.com/robotpy/wpilib
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #3   Spotlight this post!  
Unread 11-03-2014, 12:47
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: NetworkTables C++

Quote:
Originally Posted by virtuald View Post
You can run pynetworktables on a pc, but that requires python.

Alternatively, you can use the source code that pynetworktables is compiled from to build a C++ version of the library (as it is C++ underneath).

Cross-platform files required: https://github.com/robotpy/pynetwork...ree/master/src
Patched wpilib source that will compile on Windows and Linux: https://github.com/robotpy/wpilib
I did look at the pyNewtorkTables GitHub but I couldn't understand what was really happening. Can I compile it and run include it in my OpenCV program?
  #4   Spotlight this post!  
Unread 11-03-2014, 12:51
virtuald's Avatar
virtuald virtuald is offline
RobotPy Guy
AKA: Dustin Spicuzza
FRC #1418 (), FRC #1973, FRC #4796, FRC #6367 ()
Team Role: Mentor
 
Join Date: Dec 2008
Rookie Year: 2003
Location: Boston, MA
Posts: 1,058
virtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant futurevirtuald has a brilliant future
Re: NetworkTables C++

Quote:
Originally Posted by yash101 View Post
I did look at the pyNewtorkTables GitHub but I couldn't understand what was really happening. Can I compile it and run include it in my OpenCV program?
Yes, you can extract the pieces that you need and compile them all together.

pynetworktables is a python program, and setup.py dictates what files are compiled and how they go together. However, if you use the source code that I linked to above, and compile it all together, you should end up with something that will be usable from C++. It may not be pretty, but currently nobody provides an easy way to build NetworkTables from C++.
__________________
Maintainer of RobotPy - Python for FRC
Creator of pyfrc (Robot Simulator + utilities for Python) and pynetworktables/pynetworktables2js (NetworkTables for Python & Javascript)

2017 Season: Teams #1973, #4796, #6369
Team #1418 (remote mentor): Newton Quarterfinalists, 2016 Chesapeake District Champion, 2x Innovation in Control award, 2x district event winner
Team #1418: 2015 DC Regional Innovation In Control Award, #2 seed; 2014 VA Industrial Design Award; 2014 Finalists in DC & VA
Team #2423: 2012 & 2013 Boston Regional Innovation in Control Award


Resources: FIRSTWiki (relaunched!) | My Software Stuff
  #5   Spotlight this post!  
Unread 13-03-2014, 15:26
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: NetworkTables C++

I will try that during the offseason and probably make that available for everyone's life easy
  #6   Spotlight this post!  
Unread 14-03-2014, 16:09
NotInControl NotInControl is offline
Controls Engineer
AKA: Kevin
FRC #2168 (Aluminum Falcons)
Team Role: Engineer
 
Join Date: Oct 2011
Rookie Year: 2004
Location: Groton, CT
Posts: 261
NotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond reputeNotInControl has a reputation beyond repute
Re: NetworkTables C++

Quote:
Originally Posted by yash101 View Post
This has been something I have always stumbled upon. This year, I am aiming to seamlessly integrate two systems together, one being the main robot code written in Java, and the other being the vision code running in C++. I am going to have my vision code run in Embedded Linux (ARM). I have not been able to find any good source for a library that will allow me to easily use NetworkTables.

Please point me to some resources. I wish to create a thread with a good answer so anyone else shot in the dark like me will have an easy time

Good Luck and Thanks!
Good Luck with your season and competitions!
Why go through the hassel of using network tables. My experience with it is the bugs are not worth the trouble.

Create a simple TCP socket between the C++ code and the Java code.

Make the robot the server, and the c++ code the client and send ascii data between the two.

Make sure you run the read/write in their own threads so there is no i/o blocking.

You can control the communications, the ports, and the data being sent - no need for network tables really.

Use pthreads on the C++ side, and ServerSocketConnectionclass on the java (crio) side. Those classes are already apart of the codebases you are targeting and no need to have additional interpreters installed or rely on WPI library implementation.

Hope this helps,
Kevin
__________________
Controls Engineer, Team 2168 - The Aluminum Falcons
[2016 Season] - World Championship Controls Award, District Controls Award, 3rd BlueBanner
-World Championship- #45 seed in Quals, World Championship Innovation in Controls Award - Curie
-NE Championship- #26 seed in Quals, winner(195,125,2168)
[2015 Season] - NE Championship Controls Award, 2nd Blue Banner
-NE Championship- #26 seed in Quals, NE Championship Innovation in Controls Award
-MA District Event- #17 seed in Quals, Winner(2168,3718,3146)
[2014 Season] - NE Championship Controls Award & Semi-finalists, District Controls Award, Creativity Award, & Finalists
-NE Championship- #36 seed in Quals, SemiFinalist(228,2168,3525), NE Championship Innovation in Controls Award
-RI District Event- #7 seed in Quals, Finalist(1519,2168,5163), Innovation in Controls Award
-Groton District Event- #9 seed in Quals, QuarterFinalist(2168, 125, 5112), Creativity Award
[2013 Season] - WPI Regional Winner - 1st Blue Banner
  #7   Spotlight this post!  
Unread 15-03-2014, 15:42
yash101 yash101 is offline
Curiosity | I have too much of it!
AKA: null
no team
 
Join Date: Oct 2012
Rookie Year: 2012
Location: devnull
Posts: 1,191
yash101 is an unknown quantity at this point
Re: NetworkTables C++

Yeah. I need to give that a try. First, however, I need to get our pretty ODROID up and running
I realised that the ODROID that we recieved is twice as powerful as my new laptop and much more powerful than any of our team's laptops!
Closed Thread


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 02:30.

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