Joystick doesn't update, motors don't drive until button press

We have a button that activates a command to set the mode of our CANTalons (eg. Percent vs speed vs something else I cant remember) to Percent (which should be the default mode). When we deploy our code and try to run the robot in teleop, the robot doesn’t move, the Joystick values don’t update on the SmartDashboard (especially weird! What does the CANTalon modes have to do with the joystick readings?), until we press the button, then both of those things start working normally and expected (though sometimes the driving is noticeably slower than other times, strange.) It’s using ArcadeDrive I believe.

We tried in our init methods to basically emulate the button, by creating a new modeChangeCommand object and running execute() on them (so basically the driver doesn’t have to press the button to start driving) but this doesn’t work, apparently it’s not the same as pressing the button. Did this in multiple places.

How to fix this? This didn’t happen last year. Our CANTalons are on 2.2 firmware, and downgrading them all to 2.0 didn’t help. Another team member suspects something has changed on the CANTalon end about the different modes the controllers can be in.

Another team member says:

“We have been looking into changing the settings for the Talon SRX motor controllers (using the CAN bus) and using the various control modes. Now, we changed some setting and when we initially apply the joystick input, there is no output to the wheels. However, when we push the button we programmed to change the different control modes, and switch into the PercentVBus mode, the wheels turn as expected. We have tried changing the control mode for each Talon responsible for the wheelbase in our DriveSubsystem constructor, but had no effect. When outputting the control modes, using the getControlMode() method of the CANTalon object, we get that the mode is “PercentVBus,” even when we set it to Speed or Position using the previously mentioned button. We are at a loss at what to do, and have already tried updating the firmware on the Talons, but we still have this issue. While in the end we are able to drive, we’d like to make sure the correct drive mode is engaged from the very beginning.”

The CANTalon mode you choose has to do with the joystick reading because the set() method does different things based on the mode. Judging from your posts I think you want all your drive talons in Percent Vbus mode.

Read more in the Talon Reference Manual

Using some system.out.printlns shows that the drive method in the Robot class isn’t actually called until the button press. I tried simulating the button press in init() etc. to no avail. In addition, the console registers a bunch of Robot Drive… Output not updated often enough. errors until the button press. Any clues?

I think this problem is going to require seeing some code…or all the code. Can you post at least the Robot class, or a link to the project?

I would, but another team member just figured out the problem. We had a command code that woudl manage our SmartDashboard, and it had a ‘require drive subsystem’ type line that would interfere with the Robot drive method. And pressing the button interrupted the smartDashboard and allowed the drive to continue, starting the drive. This is consistent with the fact that before the button press, the drive method was called exactly once (instead of continuously).