micro-ROS / micro-ROS/micro-ROS-demos

ping_pong rand() is not seeded so device ids are likely the same across nodes

未關閉 適合新手
#97 1 則留言 0 個 reaction 已指派 0 人 在 GitHub 檢視

還沒有人認領這個 Issue。

主要語言
C
星號
101
分支
35
平均合併
4 天 16 小時
30 天內合併 PR
3

描述

## 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

貢獻指南

開啟貢獻指南

從這裡開始

  1. 先讀完整個 Issue,再讀專案的貢獻指南。
  2. 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
  3. Fork 儲存庫,在一個分支上完成修改。
  4. 送出 Pull Request,並在描述裡引用這個 Issue 編號。

研究方向

從 micro_ros_demos_rclc 套件中的 ping_pong 可執行檔開始,追蹤其裝置 ID 與 rand() 狀態的初始化方式。使用提供的 colcon 建置命令和容器命令重現該問題,然後驗證兩個容器是否使用不同的 ID 交換 Ping 和 Pong 訊息。

由索引模型根據 Issue 內容生成。

評估

技術堆疊
c
領域
distributed-systems, embedded-iot
Issue 類型
缺陷
難度
2/5
預估耗時
1-3 小時
活躍度
活躍
描述清晰度
基本清楚
新手友好度
68/100

把新 issue 寄到你的電子郵件信箱

精選適合新手參與的 GitHub issue 摘要。