View Single Post
  #12   Spotlight this post!  
Unread 22-01-2015, 11:38
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,086
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: Python: button no attribute to wpilib ?

Quote:
Originally Posted by TimTheGreat View Post
So that's not the driver station rejecting the code, its the code on the robot breaking. Adding the safety code line should prevent this, and to test just run it in the simulator
No, do NOT disable the motor safety error. In previous years, the motor safety stuff didn't always work as well as we would have liked previously, but this year it should work without any problems. If one is getting the motor safety error, that means that you aren't feeding the motors often enough.

Looking at the code which was pasted the robot drive motor call is commented out, so it's not feeding it at all -- which means the error message is correct. Once you uncomment it out, the error message goes away.

Additionally, since the OP is using IterativeRobot, no Timer.delay call is required.

I modified your code slightly, and http://pastebin.com/CLDhyuc5 works for me without any problems in the simulator. You'll note that I changed 'aracadeDrive' to 'arcadeDrive', which could be what caused your robot to crash. I don't have access to a robot to run it on.

Also, you don't need the from __future__ import division at the top, that is only needed for python 2.
__________________
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