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 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

主要言語
C
スター
101
フォーク
35
平均マージ
4日 16時間
マージ済み PR(30日)
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. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

micro_ros_demos_rclc パッケージの ping_pong 実行ファイルから始め、デバイス ID と rand() の状態がどのように初期化されるかを追跡します。提供されている colcon のビルドコマンドとコンテナコマンドを使って問題を再現し、その後、2 つのコンテナが異なる ID の Ping メッセージと Pong メッセージの両方を交換することを確認します。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
c
領域
distributed-systems, embedded-iot
issue の種類
バグ
難易度
2/5
見積もり時間
1〜3時間
活発さ
活発
明瞭さ
おおむね明確
初心者へのやさしさ
68/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。