ping_pong rand() is not seeded so device ids are likely the same across nodes
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 68/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c
- Domain
- distributed-systems, embedded-iot
Research direction
Start with the ping_pong executable in the micro_ros_demos_rclc package and follow how its device IDs and rand() state are initialized. Reproduce the issue using the provided colcon build and container commands, then verify that the two containers exchange both Ping and Pong messages with distinct IDs.
Written by the indexing model from the issue text.
Description
Issue template
- Hardware description: docker only
- RTOS: N/A
- Installation type: a containerized version of https://micro.ros.org/docs/tutorials/core/first_application_linux/
- Version or commit hash: b86db303dd7aed7ed34de2e1c2f94300c2ba7e4e
- this patch to fix the stack corruption https://github.com/micro-ROS/micro-ROS-demos/pull/96
Steps to reproduce the issue
Build this repo on your target
cd /ros2_ws
. /opt/ros/humble/setup.bash
. install/local_setup.bash
colcon build --packages-select micro_ros_demos_rclc
/ros2_ws/install/micro_ros_demos_rclc/lib/micro_ros_demos_rclc/ping_pong
Expected behavior
I expect to see ping/pong messages
Actual behavior
You will see only Ping or only Pong messages
Additional information
Running on Ubuntu 24.04 host, docker compose driving a pair of containers to pubsub.
In my testing, seeding random with a nanosecond clock is sufficient to generate different device ids. I'd file a PR but I'd like to see if this was intended or maybe just an artifact of launching two container simultaneously
- Dominant language
- C
- Stars
- 101
- Forks
- 35
- Avg merge
- 4d 16h
- Merged PRs (30d)
- 3
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.
More from micro-ROS/micro-ROS-demos
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
micro-ROS/micro-ROS-demos#83 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 35/100
micro-ROS/micro-ROS-demos#81 · 11 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 30/100
micro-ROS/micro-ROS-demos#79 · 5 comments ·
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
micro-ROS/micro-ROS-demos#74 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 35/100
micro-ROS/micro-ROS-demos#64 ·
All issues in micro-ROS/micro-ROS-demos
Similar issues
-
level/task module/gcp type/bug
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
-
docs
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
P3 sonic-vpp
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
sonic-net/sonic-buildimage#29662 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 94/100
spack/spack-packages#6586 ·
-
category:port-update
Difficulty 2/5 1-3 hours Newbie friendliness 72/100