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

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

Đang mở Phù hợp với người mới
#97 1 bình luận 0 reaction 0 người được giao Xem trên GitHub

Chưa có ai nhận issue này.

Ngôn ngữ chính
C
Star
101
Fork
35
Merge trung bình
4 ngày 16 giờ
Pull request đã merge (30 ngày)
3

Mô tả

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

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Hướng nghiên cứu

Bắt đầu với tệp thực thi ping_pong trong package micro_ros_demos_rclc và theo dõi cách device ID của nó cùng trạng thái rand() được khởi tạo. Tái hiện vấn đề bằng các lệnh build colcon và lệnh container được cung cấp, sau đó xác minh rằng hai container trao đổi cả thông báo Ping và Pong với các ID khác nhau.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
c
Lĩnh vực
distributed-systems, embedded-iot
Loại issue
Lỗi
Độ khó
2/5
Thời gian dự kiến
1-3 giờ
Mức độ hoạt động
Sôi nổi
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
68/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.