For these two scripts, I moved most of the code out of the main function into a object class with a send_position_cmd function which is called at shutdown. Setting the publishing rate to zero will the send the interaction command once and exit without sending a position command.
Tested on a robot by stopping the two scripts by pressing both cntr-c and the e-stop button. Tested that commanded line arguments are still properly passed into the interaction command messages.
For these two scripts, I moved most of the code out of the main function into a object class with a send_position_cmd function which is called at shutdown. Setting the publishing rate to zero will the send the interaction command once and exit without sending a position command.
Tested on a robot by stopping the two scripts by pressing both cntr-c and the e-stop button. Tested that commanded line arguments are still properly passed into the interaction command messages.