micro-ROS / micro-ROS/micro_ros_setup
When ros2 creates a new topic, the CPU usage is high
Nobody has claimed this yet.
- Dominant language
- Shell
- Stars
- 509
- Forks
- 183
- Avg merge
- 22h 26m
- Merged PRs (30d)
- 7
Description
- Hardware description: N/A
- RTOS: Freertos
- Installation type: micro_ros_setup
- Version or commit hash: humble
Steps to reproduce the issue
1. Start micro_ros_agent through ros2 launch;
2. htop -p `pidof micro_ros_agent` to check the change of CPU usage
3. Publish a message through ros2 topic pub /avoidance_status std_msgs/msg/UInt8 "{data: 0}", and you will find that the CPU usage soars from 7% to 30%, and then falls back to a stable state of 7%;
4. Create a publishing topic through rclcpp, only create it once, send at 20hz frequency for 30s, stop for 3min, and then send again..., the CPU usage only changes when starting the node, and there is no fluctuation during the middle operation.
Is there any way to solve this problem? If the CPU is insufficient, the main controller will not be able to run.
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
Reproduce the report by starting micro_ros_agent through ros2 launch, monitoring its process with htop, and creating the topic with the shown ros2 topic pub command. Compare the CPU spike with the rclcpp publishing case and trace the topic-creation path in micro_ros_agent. Done means the cause is identified and topic creation no longer causes the reported excessive CPU usage.
Written by the indexing model from the issue text.
Assessment
- Domain
- embedded-iot, performance, robotics
- Issue type
- Bug
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100