The microcontroller device does not reconnect when the agent is terminated and then relaunched. This is because the code fails in the create_entities() function, enters the error loop and gets stuck in the while(1). On the other hand, this is not observed when the agent is kept running and the microcontroller device is disconnected and reconnected - because the while(1) loop is exited.
Removing the while(1) fixed this. I added the flashLED(2) directly instead of the call to the rclErrorLoop() in RCCHECK instead of having a separate function.
The microcontroller device does not reconnect when the agent is terminated and then relaunched. This is because the code fails in the create_entities() function, enters the error loop and gets stuck in the while(1). On the other hand, this is not observed when the agent is kept running and the microcontroller device is disconnected and reconnected - because the while(1) loop is exited.
Removing the while(1) fixed this. I added the flashLED(2) directly instead of the call to the rclErrorLoop() in RCCHECK instead of having a separate function.
Tested using: ROS2 galactic, Teensy 4.1.