Robotics StackExchange | Archived questions

Nav2 costmap_2d not publishing OccupancyGrid with realsense D455

I have 2 realsense D455 cameras which are publishing PointCloud2 msgs in the cameras optical frame, on the topics /cam1/depth/color/points and /cam2/depth/color/points respectively.

I am launching nav2 costmap2d node (since its integrated with nav2controller) using this code snippet:

controller_server_node = Node(condition=IfCondition(PythonExpression(['not ', sim_gazebo])),
                              package='nav2_controller',
                              executable='controller_server',
                              output='screen',
                              respawn=use_respawn,
                              respawn_delay=2.0,
                              parameters=[costmap_params_test],
                              arguments=['--ros-args', '--log-level', log_level])

My costmapparamstest.yaml looks like this:

local_costmap:
  local_costmap:
    ros__parameters:
      update_frequency: 5.0
      publish_frequency: 2.0
      global_frame: base_link
      use_sim_time: True
      rolling_window: true
      width: 12
      height: 12
      resolution: 0.05
      plugins: ["voxel_layer", "inflation_layer"]
      voxel_layer:
        plugin: "nav2_costmap_2d::VoxelLayer"
        enabled: True
        publish_voxel_map: True
        origin_z: 0.0
        z_resolution: 0.05
        z_voxels: 16
        max_obstacle_height: 2.0
        mark_threshold: 0
        observation_sources: pointcloud1 pointcloud2
        pointcloud1:
          topic: /cam_1/depth/color/points
          max_obstacle_height: 2.0
          clearing: true
          marking: true
          data_type: "PointCloud2"
          raytrace_max_range: 6.5
          raytrace_min_range: 0.0
          obstacle_max_range: 6.0
          obstacle_min_range: 0.0
        pointcloud2:
          topic: /cam_2/depth/color/points
          max_obstacle_height: 2.0
          clearing: true
          marking: true
          data_type: "PointCloud2"
          raytrace_max_range: 6.5
          raytrace_min_range: 0.0
          obstacle_max_range: 6.0
          obstacle_min_range: 0.0
      inflation_layer:
        plugin: "nav2_costmap_2d::InflationLayer"
        enabled: true
        inflation_radius: 0.05
        cost_scaling_factor: 1.0
        inflate_unknown: false
        inflate_around_unknown: false
      always_send_full_costmap: True

And my tf tree outputs this:

https://imgur.com/a/5EsfiPF

Why isn't /localcostmap/localcostmap node publishing OccupancyGrid on /localcostmap/costmap topic? At the same time, /localcostmap/clearing_endpoints topic is publishing data..

Asked by nino_dragicevic on 2023-07-06 02:27:02 UTC

Comments

Answers

solved by setting use_sim_time to false

Asked by nino_dragicevic on 2023-07-06 07:13:57 UTC

Comments