We are having an intermittent problem with our Robot Code. Currently we only have a drive subsystem active with an associated DriveCommand. It all works (meaning wheels spin and change direction with the joystick) when we initially deploy the code from Eclipse and often when we come up from a reboot of the robot. However, sometimes when we switch between disable and enable mode the Talon SRXs no longer receive a signal. We have debugged our code and are certain that when this occurs the joystick values are being read and being fed into the robotDrive->MecanumDrive_Cartsian method. If we bring up the RoboRio3950 Web based System Configuration and examine the talons with a self-test, when they are working they are in mode 0 and we can see a non-zero throttle value being applied. However when we get into the state where we are enabled and the wheels aren’t moving the self-test reveals that the Mode is 15 and the throttle value is 0.
Does anyone have a suggestion as to why this might be happening?
Yes, we are seeing the output not being updated often enough message. I am going to try implementing some of the code that is in the Talon Software guide. Specifically doing a Set(0) on each motor when we are initializing teleop and auto mode. I am also going to experiment with disabling motor safety mode.
I looked at the material that was suggested and implemented changes in our robot drive subsystem. In our drive subsystem we are using 4 Talon SRXs controllers and we place them into a RobotDrive object and the use the mecanum methods on the RobotDrive to actually make the wheels spin. Our Robot is a command based robot. We wrote a method in drive subsystem to enable the motors in the drive subsystem. This method is called from TeleOpInit and AutonomousInit to ensure that the motors are enabled and the safety mode is either enabled or disabled depending upon how we configure it in our configuration file. We set the configuration options so that the safety mode is disabled by default.
After doing this we still had issues with the motors sometimes not working when coming out of disabled mode on the Driver Station. When this would occur I could switch back to disable and then enable again and it would usually work. We also discovered that even while enabled and the motors were running for a long stretch some or all of them would eventually stop working. Mysteriously we were still getting the message about the drive output not being updated often enough. This wasn’t expected because we verified that the safety mode on each motor was being disabled. We also looked at the RobotDrive code in github and it was there that we noticed that RobotDrive by default turns safety mode on. Once I added the disable on RobotDrive everything seems to work and no longer cuts out. Here’s our EnableDriveSubsystem for reference.
It is not the code, it is not the talons, its the User error.
When you previously ran the robot, you probably hit the DISABLE button while the motors were still running. That made the MotorSafety shut down the motors until the enabled function is activated.
You can still make a fail prevent in your code. For example, if the autonomous is working, and the ref shuts it off while it is driving, the error will occur in TeleOP.
What you can do is enable all of your Talons with a button
example would be:
(I dont remember the exact syntax)
You would add that to your TeleOP code.
But overall, dont disable the robot while the drive motors are running.