Robotics StackExchange | Archived questions

Local Costmap is empty

I have looked at all the other posts that have answers but none of them apply to me or they don't fix the problem. This is my launch for move_base

<launch>

   <remap from="map" to="/rtabmap/grid_map" />

   <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">

    <rosparam file="$(find my_mower)/params/costmap_common_params.yaml" command="load" ns="global_costmap" /> 
    <rosparam file="$(find my_mower)/params/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find my_mower)/params/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find my_mower)/params/global_costmap_params.yaml" command="load" /> 
    <rosparam file="$(find my_mower)/params/base_local_planner_params.yaml" command="load" />

    <param name="base_local_planner" value="teb_local_planner/TebLocalPlannerROS" />
    <param name="controller_frequency" value="10.0" />


    <rosparam file="$(find my_mower)/params/costmap_converter_params.yaml" command="load" />

 </node>



 <node pkg="tf" type="static_transform_publisher" name="base_link_broadcaster" args="-1.22 -.10 0 0 0 0 1 t265_link base_link 100" />


</launch> 

This is the common params

footprint: [[-0.35, 0.6], [1.32 , 0.6], [1.32, -0.6], [-0.35, -0.6]]
#robot_radius: 1
transform_tolerance: 2

static_layer:
  enabled: true

inflation_layer:
  inflation_radius: .5

obstacle_layer:
  enabled: true
  obstacle_range: 3.5
  raytrrace_range: 4
  max_obstacle_height: 99999.0
  min_obstacle_height: -99999.0
  track_unknown_space: true

  observation_sources: point_cloud_sensor
  point_cloud_sensor: {sensor_frame: odom, 
    data_type: PointCloud2, 
    topic: rtabmap/local_grid_obstacle, #testing different topics
    marking: true, clearing: true, 
    min_obstacle_height: -99999.0, 
    max_obstacle_height: 99999.0}

This is the local costmap params

local_costmap:
  global_frame: t265_link
  robot_base_frame: t265_link
  update_frequency: 5.0
  publish_frequency: 2.0
  static_map: false
  rolling_window: true
  width: 6.0
  height: 6.0
  resolution: 0.05
  transform_tolerance: 5

  plugins:
    - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
    - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

rosparam shows local_costmap observation source is correct. this is an echo of the observation source topic: image description

this is an echo of the empty local costmap being created image description

this is the output of launching move_base: (notice how at the end it says Recovery behavior will clear layer 'obstacles')

    ... logging to /home/ryley/.ros/log/7f786a8e-6f67-11eb-981b-0923652b57c3/roslaunch-ryley-GL65-9SD-151466.log
Checking log directory for disk usage. This may take a while.
Press Ctrl-C to interrupt
Done checking log file disk usage. Usage is <1GB.

started roslaunch server http://ryley-GL65-9SD:37259/

SUMMARY
========

PARAMETERS
 * /move_base/TebLocalPlannerROS/acc_lim_theta: 0.5
 * /move_base/TebLocalPlannerROS/acc_lim_x: 0.5
 * /move_base/TebLocalPlannerROS/alternative_time_cost: False
 * /move_base/TebLocalPlannerROS/costmap_converter/CostmapToPolygonsDBSMCCH/cluster_max_distance: 0.4
 * /move_base/TebLocalPlannerROS/costmap_converter/CostmapToPolygonsDBSMCCH/cluster_min_pts: 2
 * /move_base/TebLocalPlannerROS/costmap_converter/CostmapToPolygonsDBSMCCH/convex_hull_min_pt_separation: 0.1
 * /move_base/TebLocalPlannerROS/costmap_converter/CostmapToPolygonsDBSMCCH/ransac_convert_outlier_pts: True
 * /move_base/TebLocalPlannerROS/costmap_converter/CostmapToPolygonsDBSMCCH/ransac_filter_remaining_outlier_pts: False
 * /move_base/TebLocalPlannerROS/costmap_converter/CostmapToPolygonsDBSMCCH/ransac_inlier_distance: 0.15
 * /move_base/TebLocalPlannerROS/costmap_converter/CostmapToPolygonsDBSMCCH/ransac_min_inliers: 10
 * /move_base/TebLocalPlannerROS/costmap_converter/CostmapToPolygonsDBSMCCH/ransac_no_iterations: 2000
 * /move_base/TebLocalPlannerROS/costmap_converter/CostmapToPolygonsDBSMCCH/ransac_remainig_outliers: 3
 * /move_base/TebLocalPlannerROS/costmap_converter_plugin: costmap_converter...
 * /move_base/TebLocalPlannerROS/costmap_converter_rate: 5
 * /move_base/TebLocalPlannerROS/costmap_converter_spin_thread: True
 * /move_base/TebLocalPlannerROS/costmap_obstacles_behind_robot_dist: 1.0
 * /move_base/TebLocalPlannerROS/dt_hysteresis: 0.1
 * /move_base/TebLocalPlannerROS/dt_ref: 0.3
 * /move_base/TebLocalPlannerROS/enable_homotopy_class_planning: True
 * /move_base/TebLocalPlannerROS/enable_multithreading: True
 * /move_base/TebLocalPlannerROS/feasibility_check_no_poses: 5
 * /move_base/TebLocalPlannerROS/footprint_model/type: polygon
 * /move_base/TebLocalPlannerROS/footprint_model/vertices: [[-0.35, 0.6], [1...
 * /move_base/TebLocalPlannerROS/free_goal_vel: False
 * /move_base/TebLocalPlannerROS/global_plan_overwrite_orientation: True
 * /move_base/TebLocalPlannerROS/h_signature_prescaler: 0.5
 * /move_base/TebLocalPlannerROS/h_signature_threshold: 0.1
 * /move_base/TebLocalPlannerROS/include_costmap_obstacles: True
 * /move_base/TebLocalPlannerROS/map_frame: map
 * /move_base/TebLocalPlannerROS/max_global_plan_lookahead_dist: 3.0
 * /move_base/TebLocalPlannerROS/max_number_classes: 4
 * /move_base/TebLocalPlannerROS/max_vel_theta: 0.3
 * /move_base/TebLocalPlannerROS/max_vel_x: 0.4
 * /move_base/TebLocalPlannerROS/max_vel_x_backwards: 0.2
 * /move_base/TebLocalPlannerROS/min_obstacle_dist: 0.4
 * /move_base/TebLocalPlannerROS/min_turning_radius: 0.0
 * /move_base/TebLocalPlannerROS/no_inner_iterations: 5
 * /move_base/TebLocalPlannerROS/no_outer_iterations: 4
 * /move_base/TebLocalPlannerROS/obstacle_heading_threshold: 0.45
 * /move_base/TebLocalPlannerROS/obstacle_keypoint_offset: 0.1
 * /move_base/TebLocalPlannerROS/obstacle_poses_affected: 30
 * /move_base/TebLocalPlannerROS/odom_topic: t265_link
 * /move_base/TebLocalPlannerROS/optimization_activate: True
 * /move_base/TebLocalPlannerROS/optimization_verbose: False
 * /move_base/TebLocalPlannerROS/penalty_epsilon: 0.1
 * /move_base/TebLocalPlannerROS/roadmap_graph_area_width: 5
 * /move_base/TebLocalPlannerROS/roadmap_graph_no_samples: 15
 * /move_base/TebLocalPlannerROS/simple_exploration: False
 * /move_base/TebLocalPlannerROS/teb_autosize: True
 * /move_base/TebLocalPlannerROS/visualize_hc_graph: False
 * /move_base/TebLocalPlannerROS/weight_acc_lim_theta: 1
 * /move_base/TebLocalPlannerROS/weight_acc_lim_x: 1
 * /move_base/TebLocalPlannerROS/weight_dynamic_obstacle: 10
 * /move_base/TebLocalPlannerROS/weight_kinematics_forward_drive: 1
 * /move_base/TebLocalPlannerROS/weight_kinematics_nh: 1000
 * /move_base/TebLocalPlannerROS/weight_kinematics_turning_radius: 1
 * /move_base/TebLocalPlannerROS/weight_max_vel_theta: 1
 * /move_base/TebLocalPlannerROS/weight_max_vel_x: 2
 * /move_base/TebLocalPlannerROS/weight_obstacle: 50
 * /move_base/TebLocalPlannerROS/weight_optimaltime: 1
 * /move_base/TebLocalPlannerROS/xy_goal_tolerance: 0.2
 * /move_base/TebLocalPlannerROS/yaw_goal_tolerance: 0.1
 * /move_base/base_local_planner: teb_local_planner...
 * /move_base/controller_frequency: 10.0
 * /move_base/global_costmap/footprint: [[-0.35, 0.6], [1...
 * /move_base/global_costmap/global_frame: map
 * /move_base/global_costmap/inflation_layer/inflation_radius: 0.5
 * /move_base/global_costmap/obstacle_layer/enabled: True
 * /move_base/global_costmap/obstacle_layer/max_obstacle_height: 99999.0
 * /move_base/global_costmap/obstacle_layer/min_obstacle_height: -99999.0
 * /move_base/global_costmap/obstacle_layer/observation_sources: point_cloud_sensor
 * /move_base/global_costmap/obstacle_layer/obstacle_range: 3.5
 * /move_base/global_costmap/obstacle_layer/point_cloud_sensor/clearing: True
 * /move_base/global_costmap/obstacle_layer/point_cloud_sensor/data_type: PointCloud2
 * /move_base/global_costmap/obstacle_layer/point_cloud_sensor/marking: True
 * /move_base/global_costmap/obstacle_layer/point_cloud_sensor/max_obstacle_height: 99999.0
 * /move_base/global_costmap/obstacle_layer/point_cloud_sensor/min_obstacle_height: -99999.0
 * /move_base/global_costmap/obstacle_layer/point_cloud_sensor/sensor_frame: odom
 * /move_base/global_costmap/obstacle_layer/point_cloud_sensor/topic: rtabmap/local_gri...
 * /move_base/global_costmap/obstacle_layer/raytrrace_range: 4
 * /move_base/global_costmap/obstacle_layer/track_unknown_space: True
 * /move_base/global_costmap/plugins: [{'name': 'static...
 * /move_base/global_costmap/robot_base_frame: base_link
 * /move_base/global_costmap/static_layer/enabled: True
 * /move_base/global_costmap/static_map: True
 * /move_base/global_costmap/transform_tolerance: 2
 * /move_base/global_costmap/update_frequency: 1.0
 * /move_base/local_costmap/footprint: [[-0.35, 0.6], [1...
 * /move_base/local_costmap/global_frame: t265_link
 * /move_base/local_costmap/height: 6.0
 * /move_base/local_costmap/inflation_layer/inflation_radius: 0.5
 * /move_base/local_costmap/obstacle_layer/enabled: True
 * /move_base/local_costmap/obstacle_layer/max_obstacle_height: 99999.0
 * /move_base/local_costmap/obstacle_layer/min_obstacle_height: -99999.0
 * /move_base/local_costmap/obstacle_layer/observation_sources: point_cloud_sensor
 * /move_base/local_costmap/obstacle_layer/obstacle_range: 3.5
 * /move_base/local_costmap/obstacle_layer/point_cloud_sensor/clearing: True
 * /move_base/local_costmap/obstacle_layer/point_cloud_sensor/data_type: PointCloud2
 * /move_base/local_costmap/obstacle_layer/point_cloud_sensor/marking: True
 * /move_base/local_costmap/obstacle_layer/point_cloud_sensor/max_obstacle_height: 99999.0
 * /move_base/local_costmap/obstacle_layer/point_cloud_sensor/min_obstacle_height: -99999.0
 * /move_base/local_costmap/obstacle_layer/point_cloud_sensor/sensor_frame: odom
 * /move_base/local_costmap/obstacle_layer/point_cloud_sensor/topic: rtabmap/local_gri...
 * /move_base/local_costmap/obstacle_layer/raytrrace_range: 4
 * /move_base/local_costmap/obstacle_layer/track_unknown_space: True
 * /move_base/local_costmap/plugins: [{'name': 'obstac...
 * /move_base/local_costmap/publish_frequency: 2.0
 * /move_base/local_costmap/resolution: 0.05
 * /move_base/local_costmap/robot_base_frame: t265_link
 * /move_base/local_costmap/rolling_window: True
 * /move_base/local_costmap/static_layer/enabled: True
 * /move_base/local_costmap/static_map: False
 * /move_base/local_costmap/transform_tolerance: 5
 * /move_base/local_costmap/update_frequency: 5.0
 * /move_base/local_costmap/width: 6.0
 * /rosdistro: noetic
 * /rosversion: 1.15.9

NODES
  /
    base_link_broadcaster (tf/static_transform_publisher)
    move_base (move_base/move_base)

ROS_MASTER_URI=http://localhost:11311

process[move_base-1]: started with pid [151495]
process[base_link_broadcaster-2]: started with pid [151496]
[ WARN] [1613377598.121688884]: global_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided
[ INFO] [1613377598.122890328]: global_costmap: Using plugin "static_layer"
[ INFO] [1613377598.127177020]: Requesting the map...
[ INFO] [1613377598.629271334]: Resizing costmap to 670 X 267 at 0.050000 m/pix
[ INFO] [1613377598.728939350]: Received a 670 X 267 map at 0.050000 m/pix
[ INFO] [1613377598.732266203]: global_costmap: Using plugin "inflation_layer"
[ WARN] [1613377598.758525054]: local_costmap: Pre-Hydro parameter "static_map" unused since "plugins" is provided
[ INFO] [1613377598.759285906]: local_costmap: Using plugin "obstacle_layer"
[ INFO] [1613377598.761488728]:     Subscribed to Topics: point_cloud_sensor
[ INFO] [1613377598.772370462]: local_costmap: Using plugin "inflation_layer"
[ INFO] [1613377598.793691311]: Created local_planner teb_local_planner/TebLocalPlannerROS
[ WARN] [1613377598.822079414]: TebLocalPlannerROS() Param Warning: 'alternative_time_cost' is deprecated. It has been replaced by 'selection_alternative_time_cost'.
[ INFO] [1613377598.824075958]: Footprint model 'polygon' loaded for trajectory optimization.
[ INFO] [1613377598.824117329]: Parallel planning in distinctive topologies enabled.
[ INFO] [1613377598.900381123]: Costmap conversion plugin costmap_converter::CostmapToPolygonsDBSMCCH loaded.
[ INFO] [1613377598.993541913]: Recovery behavior will clear layer 'obstacles'
[ INFO] [1613377598.997033178]: Recovery behavior will clear layer 'obstacles'

Asked by ryleymcc on 2021-02-15 03:33:19 UTC

Comments

  • What is being published in /scan ? Also, would you be able to attach a Rviz screenshot?

  • Also, in the local_costmap_params.yaml, global_frame and robot_base_frame are set to t265_link. What is that?

  • Also, are you using a static_map for navigation?

Asked by skpro19 on 2021-02-16 16:14:41 UTC

The solution was to correct the source frame for the observation source. point_cloud_sensor: {sensor_frame: odom, to point_cloud_sensor: {sensor_frame: t265_odom, and fix the local map frames to make sense.

Asked by ryleymcc on 2021-03-05 06:40:36 UTC

Answers