micro-ROS / micro-ROS/micro_ros_arduino
Questions about the parameters that determine the number of topics and topic size for publishers and subscribers
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 576
- Forks
- 146
- PR merge metrics
- No merged PRs in 30d
Description
## Issue template
- Hardware description: Teensy4.1 or i.MX-RT1060 MCU
- RTOS: No
- Installation type: Arduino IDE or MCUXpressoIDE
- Version or commit hash: humble
#### Steps to reproduce the issue
(1) Code Behavior Description
The difference between the first and second operation codes is that among the types of ROS messages transmitted from the SBC (Linux) to the MCU, one joint_state message (joint_state_2) has been changed from 1000ms to 30msec.
The second operation code had a data loss of up to 10 pieces, but the second operation code had an issue in which several ROS messages were lost out of the total received data.
The operating time of the code ranged from a minimum of 3 hours to a maximum of 10 hours.
[1] Action code first
- Code that operates 16 publishers, 6 subscriptions, and 10 ROS Timers
- Types of Publish ROS Topic and ROS Timer operation cycle
odom(odometry)(30mesc), battery(battery)(500mec), UInt8MultiArray_1(UInt8MultiArray)(100mec), UInt8MultiArray_2(UInt8MultiArray)(50mec), UInt16MultiArray_2(UInt16MultiArray)(100msec), UInt16MultiArray_1(UInt16MultiArray)(500msec), joint_state_1(joint_state)(100msec), imu(sensor_imu)(30msec), version(string)(1000msec), test_message(int32)(1000msec)
- Types of Subscription ROS Topics
twist, bool_1(Bool), bool_2(Bool), ColorRGBA_1(ColorRGBA), ColorRGBA_2(ColorRGBA), joint_state_2(jointstate)
[2] Action code second
- Code that operates 16 publishers, 6 subscriptions, and 10 ROS Timers
- Types of Publish ROS Topic and ROS Timer operation cycle
odom(odometry)(30mesc), battery(battery)(500mec), UInt8MultiArray_1(UInt8MultiArray)(100mec), UInt8MultiArray_2(UInt8MultiArray)(50mec), UInt16MultiArray_2(UInt16MultiArray)(100msec), UInt16MultiArray_1(UInt16MultiArray)(500msec), joint_state_1(joint_state)(100msec), imu(sensor_imu)(30msec), version(string)(1000msec), test_message(int32)(1000msec)
- Types of Subscription ROS Topics
twist, bool_1(Bool), bool_2(Bool), ColorRGBA_1(ColorRGBA), ColorRGBA_2(ColorRGBA), joint_state_2(jointstate)
For reference, the RQT graph is as follows.

The micro_ros_node in the center is Teensy4.1 or i.MX-RT1060 MCU.
**Question**
Q1. When the amount of ROS message data received or transmitted increases, as in the second operation code, are there any parameters that can be adjusted?
Q2. When I modified the following parameters in the colcon.meta parameter, I modified two of the parameters of the RMW Micro XRCE-DDS implementation.
Is my understanding of the following parameters correct? If not, what parameters can be modified to enable the code to respond when the amount of data sent or received increases?
https://github.com/micro-ROS/rmw_microxrcedds
RMW_UXRCE_STREAM_HISTORY_INPUT
// Data storage buffer when ROS message is received (maximum number of data received)
// Data transmission direction: SBC (linux) -> MCU (Teensy or i.MXRT1060)
RMW_UXRCE_STREAM_HISTORY_OUTPUT
// Data storage buffer when sending a ROS message (maximum number of data transmitted)
// Data transmission direction: SBC (linux) <- MCU (Teensy or i.MXRT1060)
(For reference, I changed RMW_UXRCE_STREAM_HISTORY_INPUT and RMW_UXRCE_STREAM_HISTORY_OUTPUT from the default value of 4 to 8.)
Q3. Additionally, I have a question about managing memory. Are the input buffer and output buffer at the following address the buffers that store the data when the ROS message is transmitted?
And is it correct that the buffer is captured in the stack section of RAM memory?
https://micro.ros.org/docs/concepts/middleware/memo_prof/
#### Expected behavior
- Operates with less data loss
#### Actual behavior
[1] Action code first
- I tried running this code on Teensy4.1 or i.MX-RT1060 MCU.
- Result: almost no data loss.
[2] Action code second
- I ran this code on the i.MX-RT1060 MCU.
- Result: Data loss occurs in some ROS messages.
#### Additional information
- The operating system of the Arduino IDE is Windows 10.
- The operating system of the MCUXpresso IDE is Windows 10.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the RMW Micro XRCE-DDS documentation and the RMW_UXRCE_STREAM_HISTORY_INPUT and RMW_UXRCE_STREAM_HISTORY_OUTPUT definitions referenced in the issue. Compare those parameters with the two operation patterns and consult the linked micro-ROS memory profiling page. Done means documenting which parameters affect message loss and where the relevant buffers are allocated.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- c
- Domain
- embedded-iot, networking
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 20/100