View Single Post
  #4   Spotlight this post!  
Unread 17-12-2012, 18:16
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,043
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: Communicating with the robot via Python?

If I were doing what you were doing, I would just take the NetworkTables.py file only and copy it to where your script was, and import that. To do what you're doing, you don't need any of the rest of the site-packages contents -- some of that requires a functioning wpilib, which is a binary module compiled for the cRio. I do have a 'fake' wpilib that will run on a PC (which is still in flux, but works) that contains the NetworkTables in it (https://github.com/robotpy/fake-wpilib)... of course, it's the same file, so nothing different there.

However, looking more closely, I don't know if the RobotPy implementation supports being the client. It does provide the server implementation (which is on the robot itself), but it may not provide the client implementation. You could probably use it as a starting point for a client implementation however, if it isn't already implemented. I'd accept patches for that if you get it working.

Looking at the ConnectionManager, it appears to have a mechanism to not be the server. And you can create a connection manually.. so perhaps that would be what you need to do.

I've used the NetworkTables successfully on a PC to be the server side, but I haven't tried using it as the client. Seems like it might be possible though.
__________________
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

Last edited by virtuald : 17-12-2012 at 18:18.
Reply With Quote