I’m experiencing a very strange issue with my PROS program after a disconnection and reconnection of the radio link.
I have a global variable containing a class that has a member pros::Task which controls the flywheel velocity via motor.move_voltage. The class can take signals from the user tasks (autonomous, opcontrol) via a member atomic variable to set the desired velocity.
This all works as expected throughout normal modes (disabled, opcontrol, autonomous, initialize) but if the robot loses and regains radio connection, the flywheel will stop moving even though I have verified that the task is still executing non-zero move_voltage commands for the motor (which return 1, no error).
The strange thing is that my drive train motors do respond to commands. Changing the flywheel velocity via the class increases the value sent to move_voltage yet has no effect.
I could not find any information on what happens when the radio link is lost (such as what internal pros function may be called). Clearly, the robot won’t move, but I found that disabled mode was not entered. What is up with that? Does anybody experience similar behavior? While it’s more likely to be user error, could there be a bug within PROS or Vex firmware?
I will post a minimal non-working example when I have access to a robot in a few hours.
That’s pretty much expected behavior, same thing would happen with a non-voltage command as well.
If the controller connection is lost, vexos will shutdown all motors, however, the user side code does not know about that and is also throttling messages to the motor. That is, if it thinks it just sent a similar message it does not send the same message again to reduce traffic on the serial bus. There’s no good workaround except to send a voltage command that’s sufficiently different (> 120mV I think) to get the motor moving again.
It’s been this way since vexos 1.0.0 in 2018, and this is the first time anyone has commented about it, so I’m not sure we consider it a defect. I may revisit all the logic surrounding this at some point, but the earliest anything like that would happen would be this summer.
I would probably monitor the controller connection status rather than competition status, but whatever works for you.