-
Notifications
You must be signed in to change notification settings - Fork 17.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AP_DDS: Automatic reconnect to MicroROS Agent not working #23372
Comments
Currently facing an issue with running the microros agent with SITL (UDP), wherein the microros agent just terminates due to "bad_array_new_length". No topics thus published on ROS2. Cannot even restart the microros to fix this, as the then the reconnection is not possible.
|
@vibgyor-s I can't tell what might be causing this from the log you posted. Could you post all steps required to replicate (terminal commands and full log) and some details about the system you're running. |
NotesThe PX4
To implement similar behaviour in ArduPilot
Tracking in: #25228 Issues1. micro-ROS agent is restarted
TestingFigure: reconnection after micro-ROS agent is repeatedly restarted. |
Hi @srmainwaring, I've merged your "pr_dds_reconnect" branch. I'm getting a weird issue where once I disconnect the DDS client, it will register the "disconnecting", but after a couple of seconds it will then "exit". After this exit I can't reconnect to the client without doing a power reset. Any help would be awesome, cheers. |
Hi @KyleJewiss, thanks for testing the PR. The timeout after a 10s seconds is intentional. If a connection cannot be reestablished after 10s the loop exits. // check ping
const uint64_t ping_timeout_ms{1000};
const uint8_t ping_max_attempts{10};
if (!uxr_ping_agent_attempts(comm, ping_timeout_ms, ping_max_attempts)) {
GCS_SEND_TEXT(MAV_SEVERITY_ERROR, "DDS Client: No ping response, exiting");
return;
} We need to implement fall-back behaviour in a future PR. |
Good to know. Thanks for the for the code and the reply @srmainwaring. Have a good one |
Btw - were you testing in SITL or hardware? At the moment we can manage a reconnect of the client if the micro-ROS agent dies and is respawned (within 10s). Unplugging and reconnecting a serial to USB adapter connecting a flight controller to a PC is not working. I have not tested a connection between a FCU and GPIO pins on a companion computer such as an RPi4. |
We were testing on hardware, that makes sense. We can close the agent and reconnect in those 10 seconds but if we take longer, we need to unplug and plug back in. |
This related to unresolved: micro-ROS/micro-ROS-Agent#205 |
If connection between the autopilot and companion computer is flaky, severed, or the micro ROS agent restarts at runtime, the connection is not recovered.
The scope of this issue is to perform the following
The text was updated successfully, but these errors were encountered: