ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

ROS2 nav2 local costmap clears when rotating robot

asked 2023-06-14 04:48:58 -0500

nino_dragicevic gravatar image

I have implemented local_costmap_2d package from nav2 stack to my robot, but the package behaves weird when the robot is rotating in place...

Im using 3 depth cameras, 2 in the front and 1 in the back of the robot.

Costmap also seems to clear when robot stops, which is not the intended behaviour.

I don't want to clear the local costmap when robot rotates (or when obstacles go out of depth sensor sight) because I want to use the readings for obstacle avoidance, and I also want to remove the weird lines that sometimes appear..

Behaviour is described in the video links here:

https://streamable.com/iqqihf https://streamable.com/cstn0x

And pictures here:

https://ibb.co/sVGm1jZ https://ibb.co/y08jvWy

Here is my costmap_params.yaml file:

local_costmap:   
  local_costmap:
    ros__parameters:
      update_frequency: 5.0
      publish_frequency: 2.0
      global_frame: odom
      robot_base_frame: base_link
      use_sim_time: True
      rolling_window: True
      width: 12
      height: 12
      resolution: 0.05
      plugins: ["obstacle_layer", "inflation_layer"]
      obstacle_layer:
        plugin: "nav2_costmap_2d::ObstacleLayer"
        enabled: True
        observation_sources: pointcloud1 pointcloud2 pointcloud3
        footprint_clearing_enabled: True
        max_obstacle_height: 2.0
        combination_method: 1
        pointcloud1:
          topic: /camera1/points
          obstacle_max_range: 6.0
          obstacle_min_range: 0.6
          raytrace_max_range: 6.5
          raytrace_min_range: 0.0
          max_obstacle_height: 2.0
          min_obstacle_height: 0.1
          clearing: True
          marking: True
          data_type: "PointCloud2"
          inf_is_valid: false
        pointcloud2:
          topic: /camera2/points
          obstacle_max_range: 6.0
          obstacle_min_range: 0.6
          raytrace_max_range: 3.0
          raytrace_min_range: 0.0
          max_obstacle_height: 2.0
          min_obstacle_height: 0.1
          clearing: True
          marking: True
          data_type: "PointCloud2"
          inf_is_valid: false
        pointcloud3:
          topic: /camera3/points
          obstacle_max_range: 6.0
          obstacle_min_range: 0.6
          raytrace_max_range: 3.0
          raytrace_min_range: 0.0
          max_obstacle_height: 2.0
          min_obstacle_height: 0.0
          clearing: True
          marking: True
          data_type: "PointCloud2"
          inf_is_valid: false
      inflation_layer:
        plugin: "nav2_costmap_2d::InflationLayer"
        enabled: true
        inflation_radius: 0.3
        cost_scaling_factor: 1.0
        inflate_unknown: false
        inflate_around_unknown: true

Im using this node in launchfile to launch it:

controller_server_node = Node(package='nav2_controller',
                              executable='controller_server',
                              output='screen',
                              respawn=use_respawn,
                              respawn_delay=2.0,
                              parameters=[costmap_params],
                              arguments=['--ros-args', '--log-level', log_level])
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2023-07-06 02:12:36 -0500

nino_dragicevic gravatar image

issue solved by setting always_send_full_costmap parameter to True

edit flag offensive delete link more

Question Tools

Stats

Asked: 2023-06-14 04:48:58 -0500

Seen: 48 times

Last updated: Jul 06 '23