Skip to content

Obstacle_layer plugin cause high CPU usage in controller_Server and planner_server(sometime over 120% )  #2333

@wilsionhuang

Description

@wilsionhuang

Bug report

Obstacle_layer plugin cause high CPU usage in controller_Server and planner_server

Required Info:

  • Operating System
    • Ubuntu 20.04
  • ROS2 Version
    • Foxy Binaries
  • Version or commit hash
    • foxy version and build From source
  • DDS implementation
    • Fast-RTPS

Steps to reproduce issue

1. launch the laser node  and navigation2 software stack
2. keep the robot standstill or do task of moving point A to piont B
3. open htop in new terminal and you can find the cpu of controller_server and planner_server is unstable and high(sometimes the crest value may over 120%)

Expected behavior

The cpu usage of controller_server and planner_server is stable and not high

Actual behavior

The cpu usage of controller_server and planner_server is unstable and increase abruptly over 120%
Screenshot from 2021-05-11 15-39-34

Additional information

Temporary solution

  1. Transform the scan data(laser_node) to pointcloud and then transform the pointcloud data from the laser_link to map before publish
  2. Transform scan data from laser_link to map directly

The result of temporary solution

the cpu usage of controller_server and planner_server is decreased and keeping stable obviously(not increase abruptly)
Screenshot from 2021-05-11 16-32-07

Three points may cause this problem and Debug

  1. projector_.transformLaserScanToPointCloud(message->header.frame_id, *message, cloud, *tf_) cause the most cpu in callback function -- through transform the scan to pointcloud data and not transform data from laser_link to map before publish, the bug is still alive
  2. buffer->bufferCloud(cloud) -- ongoing debug
  3. QOS buffer size is lager -- decrease the buffer size, the problem is still remaining

Co-woker

@tal-grossman @andersdu @duanyunxin

Although the temporary solution can fix this problem, we still could not find the point which cause this problem in obstacle_layer plugins. If anyone have ideas with this issue, we are hopefully Looking forward to your reply.
Thanks.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions