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

Nav2 robot setup, local costmap not showing on Rviz

asked 2022-11-02 04:35:37 -0500

filippo.guarda gravatar image

Currently working on ROS2 Humble, Ubuntu 22.04, with default DDS vendor.

We are trying to setup a custom robot, so far we followed the Nav2 "first time robot setup guide" to the letter, with exceptions made for the lidar. In our case the lidar is generated by merging three different lidars on the robot perimeter together using the ros2_laserscan_merger node package. The laserscan merger sends a pointcloud to the pointcloud_to_laserscan node (humble branch).

The resulting lidar seem to work correctly with other nodes, the output shows on Rviz, and the Global costmap is working correctly, aside from not showing any gradient to the inflation layer. Here is the parameters file called at launch:

local_costmap:
      local_costmap:
        ros__parameters:
          update_frequency: 5.0
          publish_frequency: 2.0
          global_frame: map
          robot_base_frame: base_link
          use_sim_time: True
          rolling_window: True
          width: 10
          height: 10
          resolution: 0.05
          footprint: "[ [0.5, 0.5], [0.5, -0.5], [-0.5, -0.5], [-0.5, 0.5] ]"
          plugins: ["voxel_layer", "inflation_layer"]
          voxel_layer:
            plugin: "nav2_costmap_2d::VoxelLayer"
            enabled: False
            publish_voxel_map: False
            origin_z: 0.0
            z_resolution: 0.1
            z_voxels: 16
            max_obstacle_height: 2.0
            mark_threshold: 0
            observation_sources: scan pointcloud
            scan:
              topic: /scan
              max_obstacle_height: 2.0
              clearing: True
              marking: True
              data_type: "LaserScan"
              raytrace_max_range: 5.0
              raytrace_min_range: 0.0
              obstacle_max_range: 4.5
              obstacle_min_range: 0.0
            pointcloud:
              topic: /cloud
              clearing: True
              marking: True
              data_type: "PointCloud2"
          static_layer:
            plugin: "nav2_costmap_2d::StaticLayer"
            map_subscribe_transient_local: True
          inflation_layer:
            plugin: "nav2_costmap_2d::InflationLayer"
            cost_scaling_factor: 3.0
            inflation_radius: 0.55
          always_send_full_costmap: True
      local_costmap_client:
        ros__parameters:
          use_sim_time: True
      local_costmap_rclcpp_node:
        ros__parameters:
          use_sim_time: True

global_costmap:
  global_costmap:
    ros__parameters:
      update_frequency: 1.0
      publish_frequency: 1.0
      global_frame: map
      robot_base_frame: base_link
      use_sim_time: True
      robot_radius: 0.75
      resolution: 0.05
      track_unknown_space: true
      plugins: ["static_layer", "obstacle_layer", "inflation_layer"]
      obstacle_layer:
        plugin: "nav2_costmap_2d::ObstacleLayer"
        enabled: True
        observation_sources: pointcloud scan
        scan:
          topic: /scan
          clearing: True
          marking: True
          data_type: "LaserScan"
          raytrace_max_range: 20.0
          raytrace_min_range: 0.0
          obstacle_max_range: 9.5
          obstacle_min_range: 0.0
        pointcloud:
          topic: /cloud
          clearing: True
          marking: True
          data_type: "PointCloud2"
      static_layer:
        plugin: "nav2_costmap_2d::StaticLayer"
        map_subscribe_transient_local: True
      inflation_layer:
        plugin: "nav2_costmap_2d::InflationLayer"
        cost_scaling_factor: 3.0
        inflation_radius: 0.55
      always_send_full_costmap: True
  global_costmap_client:
    ros__parameters:
      use_sim_time: True
  global_costmap_rclcpp_node:
    ros__parameters:
      use_sim_time: True

# map_server:
#   ros__parameters:
#     use_sim_time: True
#     yaml_filename: "turtlebot3_world.yaml

The map server is intentionally commented as at the moment we are trying to do SLAM in a custom Gazebo simulation. While there is no output for the local costmap, the topic is being posted and read from by the pointcloud_to_laserscan and Rviz nodes, without any error being printed either on the Rviz application or on the terminal. We tried adding the "static layer" in the local costmap plugins, which actually shows some output in Rviz. The problem with this is that later on, when trying to navigate the space, we get all sorts of errors from the navigation stack, including but not limited to:

[controller_server-8] [INFO] [1667379065.921631535] [controller_server]: Passing new path to controller.
[controller_server-8] [ERROR] [1667379065.930822263] [controller_server]: Failed to make progress
[controller_server-8] [WARN] [1667379065.930923103] [controller_server]: [follow_path] [ActionServer] Aborting handle.
[controller_server-8] [INFO] [1667379065.957863588] [local_costmap.local_costmap]: Received request to clear entirely the local_costmap
[controller_server-8] [INFO] [1667379065.977604143] [controller_server]: Received a goal, begin computing control effort.
[controller_server-8] [WARN ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2022-11-02 20:23:33 -0500

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-11-02 04:35:37 -0500

Seen: 594 times

Last updated: Nov 02 '22