Go to Post I always thought a trained bio mechanical monkey wrapped in aluminum foil would be the best robot, but every year my team says "No Pete, go sit down." - BuddyB309 [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

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 04-02-2017, 18:38
Anon10W1z Anon10W1z is offline
Registered User
FRC #3256 (WarriorBorgs)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2017
Location: San Jose, CA
Posts: 3
Anon10W1z is an unknown quantity at this point
TX1 pynetworktables not connecting to SmartDashboard

Our team is trying to get our Jetson TX1 to connect to the SmartDashboard network table using pynetworktables. It is unable to connect with the following code:

Code:
from networktables import NetworkTables
import logging

logging.basicConfig(level=logging.DEBUG)
NetworkTables.setIPAddress('10.32.56.2')
NetworkTables.setClientMode()
NetworkTables.initialize()
table = NetworkTables.getTable('SmartDashboard')
while True:
    print table.getNumber('gyro', 0)
as we get a constant output of 0. The SmartDashboard is updating, as we can see through the OutlineViewer and SmartDashboard. We are using static IP's. We are able to ping the roboRIO from the Jetson, so we are unsure what we are doing wrong.
Reply With Quote
  #2   Spotlight this post!  
Unread 05-02-2017, 12:28
virtuald's Avatar
virtuald virtuald is online now
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,105
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: TX1 pynetworktables not connecting to SmartDashboard

Quote:
Originally Posted by Anon10W1z View Post
Our team is trying to get our Jetson TX1 to connect to the SmartDashboard network table using pynetworktables. It is unable to connect with the following code:

Code:
from networktables import NetworkTables
import logging

logging.basicConfig(level=logging.DEBUG)
NetworkTables.setIPAddress('10.32.56.2')
NetworkTables.setClientMode()
NetworkTables.initialize()
table = NetworkTables.getTable('SmartDashboard')
while True:
    print table.getNumber('gyro', 0)
as we get a constant output of 0. The SmartDashboard is updating, as we can see through the OutlineViewer and SmartDashboard. We are using static IP's. We are able to ping the roboRIO from the Jetson, so we are unsure what we are doing wrong.
I would add a sleep between each iteration of your while loop. Are there any log messages that you see on the console? The messages you should see are listed at http://robotpy.readthedocs.io/en/sta...ynetworktables
__________________
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
Reply With Quote
  #3   Spotlight this post!  
Unread 06-02-2017, 02:13
Anon10W1z Anon10W1z is offline
Registered User
FRC #3256 (WarriorBorgs)
Team Role: Programmer
 
Join Date: Jan 2017
Rookie Year: 2017
Location: San Jose, CA
Posts: 3
Anon10W1z is an unknown quantity at this point
Re: TX1 pynetworktables not connecting to SmartDashboard

Quote:
Originally Posted by virtuald View Post
I would add a sleep between each iteration of your while loop. Are there any log messages that you see on the console? The messages you should see are listed at http://robotpy.readthedocs.io/en/sta...ynetworktables
We will test this tomorrow, thanks!
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 22:37.

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