linorobot / linorobot2_hardware

Apache License 2.0
94 stars 84 forks source link

Fixed reconnection with agent by removing while(1) loop #16

Closed adityakamath closed 1 year ago

adityakamath commented 1 year ago

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.

adityakamath commented 1 year ago

My bad, had issues with my setup of micro_ros_arduino, was getting incorrect results.