ros2 / ros2/ros2cli

ros2 topic hz perform worse than c++ code, also worse than result in another docker container

Open
#843 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

backlog
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::PointCloud2 type message with frequency 10hz in container1
  • run subscriber and process data c++ code in container2, record the frequency subscription callback called
  • use ros2 topic hz tool follow the frequency of topic in both containers
Expected behavior
  • In both containers, ros2 topic hz shows 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 hz shows frequency slightly under 10hz
    ros2 topic hz result in container1
  • In container2 terminal, ros2 topic hz shows frequency highly under 10hz, verity from 7hz to 9hz
    ros2 topic hz result in container2
  • In log of container2, c++ code receive message each 100ms stably
    c++ code log of container2
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.