micro-ROS / micro-ROS/rmw_microxrcedds

High CPU usage with int32_publisher

Open
#297 2 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C
Stars
47
Forks
36
Avg merge
2d 19h
Merged PRs (30d)
6

Description

Describe the bug
Having only timers on an executor makes rmw_wait() to spin without blocking. This causes high cpu usage and it's a problem on a RTOS with threading support.

To Reproduce
Just build int32_publisher from micro-ROS-demos.

Expected behaviour
rclc_executor_spin() should always be a blocking call without any service, client, subscription, or timer.

System information (please complete the following information):

  • OS: Zephyr (but it shouldn't matter)
  • ROS 2: Humble (but it shouldn't matter)
  • Version: humble.

Additional context
https://micro-ros.slack.com/archives/CNC141G0N/p1684752941054099

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

Build int32_publisher from micro-ROS-demos and trace the executor path through rclc_executor_spin() to rmw_wait(). Reproduce the CPU spin with only timers, then inspect the wait behavior and confirm done when the executor blocks instead of spinning in this configuration.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
operating-systems
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.