You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Question about how to debug communication data between micro-ROS-agent and micro-ROS-client #265
However, as I've been running micro-ROS, I've noticed a lot of data being sent and received, and the data cycles are fast, so I've been experiencing frequent communication issues.
So, I'd like to know how to identify where communication issues and bottlenecks are occurring in micro-ROS.
As far as I know, changing the log level with the -v option when running micro-ROS-agent itself changes the diversity of the logs.
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyACM0
However, when I use the -v option to view the data, it's too fast for the human eye. I'd like to either print out the transmitted and received data so it can be viewed by the human eye, or record it.
Is there an easy way to view or record this data, or a way to implement my own code, or a free debugging tool?
Hi @ChoiYouJung
What exactly is it you want to debug? You have a few options. You could literally debug the agent code. For that you need to clone the agent repo and build it from source, then add appropriate debugging configuration (for C++ and VSCode, checkout this page). Then you can debug the agent just as any other ros2 C++ node.
But I assume what you mean with debugging is checking the message throughput, loss and latency? That is something I did recently for a custom BLE transport. A common approach is that you setup publishers and subscribers for the topics you want to investigate within the MCU. Then, in the subscription callback within the firmware, you immediately publish back the same message. This way, you can make a normal benchmark node on your host (where the micro-ROS agent is running) that
Publishes the benchmark message
Saves the timestamp that the message has been published
Waits until the same message is received again
Saves the reception timestamp
This way you can measure the round trip time (RTT). RTT/2 then is a good approximation for your one way message latency.
To measure message loss, you could add a sequence integer as message content which you simply increase for every sent message. This way you can easily check if you received all sent sequence integers.
Here are a few repos I created for this. Note that they are not super pretty, but I changed the visibility to public, maybe they help:
Activity
Geibinger commentedon Jan 11, 2026
Hi @ChoiYouJung
What exactly is it you want to debug? You have a few options. You could literally debug the agent code. For that you need to clone the agent repo and build it from source, then add appropriate debugging configuration (for C++ and VSCode, checkout this page). Then you can debug the agent just as any other ros2 C++ node.
But I assume what you mean with debugging is checking the message throughput, loss and latency? That is something I did recently for a custom BLE transport. A common approach is that you setup publishers and subscribers for the topics you want to investigate within the MCU. Then, in the subscription callback within the firmware, you immediately publish back the same message. This way, you can make a normal benchmark node on your host (where the micro-ROS agent is running) that
This way you can measure the round trip time (RTT). RTT/2 then is a good approximation for your one way message latency.
To measure message loss, you could add a sequence integer as message content which you simply increase for every sent message. This way you can easily check if you received all sent sequence integers.
Here are a few repos I created for this. Note that they are not super pretty, but I changed the visibility to public, maybe they help:
If you have any questions, happy to help! :)