Skip to content

Commit b189950

Browse files
committed
If no new commands are received, halt
Currently, we only exit the main loop when no new command is received anymore (already taking any configured receive timeout into account). However, if we don't receive a new command anymore, that should always be considerd an unintentional interruption of the control flow. In that case, we should stop program execution, as interrupting the communication was an unexpected error event. If interrupting the communication in order to continue with the rest of the program was intentional, users will send a stop command. This will end the main control loop at another code branch leading to a clean shutdown of the external_control part in order to be able to continue with the rest of the program.
1 parent 53e3577 commit b189950

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

resources/external_control.urscript

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1003,7 +1003,8 @@ while control_mode > MODE_STOPPED:
10031003
end
10041004
else:
10051005
textmsg("Socket timed out waiting for command on reverse_socket. The script will exit now.")
1006-
control_mode = MODE_STOPPED
1006+
stopj(STOPJ_ACCELERATION)
1007+
halt
10071008
end
10081009
exit_critical
10091010
end

0 commit comments

Comments
 (0)