ros2 topic hz perform worse than c++ code, also worse than result in another docker container
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 262
- Forks
- 228
- Avg merge
- 23h 15m
- Merged PRs (30d)
- 12
Description
Bug report
Required Info:
- Operating System:
- Ubuntu18.04
- Installation type:
- source
- Version or commit hash:
- humble
- DDS implementation:
- FastDDS
Steps to reproduce issue
- run two docker container using the following docker-compose.yml
container1:
image: image_name
network_mode: "host"
cpuset: 2-9
cpu_shares: 2048
shm_size: 4G
container_name: container1
runtime: nvidia
privileged: true
environment:
- NVIDIA_VISIBLE_DEVICES=all
logging:
options:
max-size: "${DOCKER_LOGS_MAX_SIZE:-100M}"
container2:
image: image_name
network_mode: "host"
privileged: true
cpuset: 12-17
cpu_shares: 2048
shm_size: 2G
container_name: container2
environment:
- NVIDIA_VISIBLE_DEVICES=all
runtime: nvidia
logging:
options:
max-size: "${DOCKER_LOGS_MAX_SIZE:-100M}"
- publish
sensor_msgs::msg::PointCloud2type message with frequency 10hz in container1 - run subscriber and process data c++ code in container2, record the frequency subscription callback called
- use
ros2 topic hztool follow the frequency of topic in both containers
Expected behavior
- In both containers,
ros2 topic hzshows the same frequency which is around 10hz - Log of c++ code in container2 shows that pointcloud2 messages arrive each 100ms
Actual behavior
- In container1 terminal,
ros2 topic hzshows frequency slightly under 10hz
- In container2 terminal,
ros2 topic hzshows frequency highly under 10hz, verity from 7hz to 9hz
- In log of container2, c++ code receive message each 100ms stably
Additional information
Since code in both container are quite complicate, I can't paste the code here.
As discussed in the blow question, ros2 topic hz result is lower than c++ code because the qos used is different. But why the hz results in different containers turn out to be different?
https://answers.ros.org/question/350753/ros2-topic-hz-provides-wrong-rate-for-larger-msgs/
Also, since ros2 topic hz result is not reliable, is therea a better way to track the transportaion stability between many nodes?
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 by reproducing ros2 topic hz with the provided two-container Docker Compose setup and compare its readings with the C++ subscription callback. Read the ros2 topic hz entry point and investigate the differing results for the PointCloud2 topic, then document a reliable explanation or measurement approach.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- docker, python
- Domain
- cli, distributed-systems, performance
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100