FtcRobotController icon indicating copy to clipboard operation
FtcRobotController copied to clipboard

RUN_TO_POSITION error locks robot in re-boot cycle until hard booted

Open shishghate opened this issue 1 year ago • 4 comments

A couple of issues we have come across with RUN_TO_POSITION mode.

First off, if you don't set the target position for the first time it will throw the Exception Dialog. After that, picking any opmode and hitting play will lock it in an emergency stop reboot loop. The only way to escape is to hard boot the bot which is not possible during a match. Even a redeploy of code won't remove it from the loop.

Second, if you do set the target position in one opmode and then run another opmode that doesn't set the target position before setting the RUN_TO_POSITION mode, the second opmode will work fine and not throw the exception dialog. It appears something is is being cached and not properly cleared.

Here are the steps we have used to reproduce the problem using the attached file:

Update the motors in line 20 and or 21 Comment out lines 24 and 29. Turn on hub Deploy Start OpMode Exception thrown. Hit Ok Pick OpMode and try start. Emergency stop thrown and in endless loop.

Here is the second case of once the target is set, it is remembered even after a code deploy

Update the motors in line 20 and or 21 Leave the setTargetPositions as is and make sure they are called Turn on hub Deploy Start OpMode Exit OpMode Comment out lines 24 and 29 Redeploy Start OpMode It will not crash or throw the error.

TestLiftMotors.zip 20240116_152430

shishghate avatar Jan 16 '24 22:01 shishghate