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

Nav2 [local_costmap.local_costmap]: Sensor origin: out of map bounds. The costmap can't raytrace for it.

asked 2023-06-16 11:30:22 -0500

guidout gravatar image

updated 2023-06-16 14:47:24 -0500

Hello, I recently started getting this warning when I launch the Nav2

[local_costmap.local_costmap]: Sensor origin: (1.60, 0.00, 0.96), out of map bounds. The costmap can't raytrace for it

I have never saw this warning and of course I can't remember what changes I made. But regardless, I really have no clue how to address this. I don't even know where to start from.
Of course I googled a little and found something but I'm not sure it's related to my issue: https://answers.ros.org/question/3809...

My Nav2 params are:

amcl:
  ros__parameters:
    use_sim_time: True
    alpha1: 0.2
    alpha2: 0.2
    alpha3: 0.2
    alpha4: 0.2
    alpha5: 0.2
    base_frame_id: "base_link"
    beam_skip_distance: 0.5
    beam_skip_error_threshold: 0.9
    beam_skip_threshold: 0.3
    do_beamskip: false
    global_frame_id: "map"
    lambda_short: 0.1
    laser_likelihood_max_dist: 2.0
    laser_max_range: 20.0
    laser_min_range: 0.1
    laser_model_type: "likelihood_field"
    max_beams: 60
    max_particles: 2000
    min_particles: 500
    odom_frame_id: "odom"
    pf_err: 0.05
    pf_z: 0.99
    recovery_alpha_fast: 0.0
    recovery_alpha_slow: 0.0
    resample_interval: 1
    robot_model_type: "differential"
    save_pose_rate: 0.5
    sigma_hit: 0.2
    tf_broadcast: true
    transform_tolerance: 1.0
    update_min_a: 0.2
    update_min_d: 0.25
    z_hit: 0.5
    z_max: 0.05
    z_rand: 0.5
    z_short: 0.05
    scan_topic: scan

amcl_map_client:
  ros__parameters:
    use_sim_time: True

amcl_rclcpp_node:
  ros__parameters:
    use_sim_time: True

bt_navigator:
  ros__parameters:
    use_sim_time: True
    global_frame: map
    robot_base_frame: base_link
    odom_topic: /odometry/filtered
    enable_groot_monitoring: True
    groot_zmq_publisher_port: 1666
    groot_zmq_server_port: 1667
    default_bt_xml_filename: "navigate_w_replanning_and_round_robin_recovery"
    plugin_lib_names:
    - nav2_compute_path_to_pose_action_bt_node
    - nav2_follow_path_action_bt_node
    - nav2_back_up_action_bt_node
    - nav2_spin_action_bt_node
    - nav2_wait_action_bt_node
    - nav2_clear_costmap_service_bt_node
    - nav2_is_stuck_condition_bt_node
    - nav2_goal_reached_condition_bt_node
    - nav2_goal_updated_condition_bt_node
    - nav2_initial_pose_received_condition_bt_node
    - nav2_reinitialize_global_localization_service_bt_node
    - nav2_rate_controller_bt_node
    - nav2_distance_controller_bt_node
    - nav2_speed_controller_bt_node
    - nav2_truncate_path_action_bt_node
    - nav2_goal_updater_node_bt_node
    - nav2_recovery_node_bt_node
    - nav2_pipeline_sequence_bt_node
    - nav2_round_robin_node_bt_node
    - nav2_transform_available_condition_bt_node
    - nav2_time_expired_condition_bt_node
    - nav2_distance_traveled_condition_bt_node

bt_navigator_rclcpp_node:
  ros__parameters:
    use_sim_time: True

controller_server:
  ros__parameters:
    use_sim_time: True
    controller_frequency: 10.0
    min_x_velocity_threshold: 0.005
    min_y_velocity_threshold: 0.005
    min_theta_velocity_threshold: 0.01
    failure_tolerance: 0.3
    odom_topic: /odometry/filtered
    progress_checker_plugin: "progress_checker"
    goal_checker_plugins: ["goal_checker"]
    controller_plugins: ["FollowPath"]

    progress_checker:
      plugin: "nav2_controller::SimpleProgressChecker"
      required_movement_radius: 0.05
      movement_time_allowance: 10.0
    goal_checker:
      plugin: "nav2_controller::SimpleGoalChecker"
      xy_goal_tolerance: 0.2 # 0.25
      yaw_goal_tolerance: 0.1 #0.25
      stateful: True
    # TEB parameters
    # http://wiki.ros.org/teb_local_planner
    FollowPath:
      plugin: "teb_local_planner::TebLocalPlannerROS"
      odom_topic: odom
      map_frame: map

      # footprint_model.type: circular
      # footprint_model.radius: 2.0
      footprint_model.type: polygon
      footprint_model.vertices: "[ [1.54, 0.405], [1.54, -0.405], [-0.2, -0.405], [-0.2, 0.405] ]"

      min_turning_radius: 2.0
      wheelbase: 1.35
      cmd_angle_instead_rotvel: true
      min_obstacle_dist: 5.0
      inflation_dist: 1.0
      costmap_converter_plugin: "costmap_converter::CostmapToPolygonsDBSMCCH"
      costmap_converter_spin_thread: True
      costmap_converter_rate: 15
      enable_homotopy_class_planning: True
      enable_multithreading: True
      optimization_verbose: False
      teb_autoresize: True
      min_samples: 3
      max_samples: 20
      max_global_plan_lookahead_dist: 10.0
      visualize_hc_graph: True
      max_vel_x: 0.75
      max_vel_x_backwards: 0.2
      max_vel_y: 0.0 # should be zero for non-holonomic robots
      acc_lim_y: 0.05
      max_vel_theta: 0.5
      acc_lim_x: 0.5
      acc_lim_theta: 0.1
      yaw_goal_tolerance: 0.2
      xy_goal_tolerance: 0.1
      include_costmap_obstacles: True
      publish_feedback: True

costmap_converter:
  ros__parameters:
    use_sim_time: True

controller_server_rclcpp_node:
  ros__parameters:
    use_sim_time: True

local_costmap:
  local_costmap:
    ros__parameters:
      update_frequency: 1.0
      publish_frequency: 1.0
      global_frame: odom
      robot_base_frame: base_link
      use_sim_time: True
      rolling_window: true
      width: 10
      height: 10
      origin_x: -2.0 # Relative to width
      # origin_y: 0.0 # Relative to height
      resolution: 0.05
      # Length 1.74 m
      # Width 0.81 m
      footprint: "[ [1.54, 0.405], [1.54, -0.405], [-0.2, -0.405], [-0.2, 0.405] ]"
      # robot_radius: 0 ...
(more)
edit retag flag offensive close merge delete

Comments

Please post your params otherwise there is nothing that can be said with certainty. What is the size of your local costmap and what is its origin? Modifying either of these will ensure your sensor origin is definitely within the bounds of the costmap.

adityatandon gravatar image adityatandon  ( 2023-06-16 11:57:12 -0500 )edit
1

Sometimes, depending on localization method, you need to set the initial robot pose via RViz. Have you verified the robot to odom to map pose ? Can you see the robot model and costmap in RViz?

dcconner gravatar image dcconner  ( 2023-06-16 13:49:21 -0500 )edit

I posted my nav2 params. My local cost map is 10x10. How do I check its origin?

guidout gravatar image guidout  ( 2023-06-16 14:49:04 -0500 )edit

@dcconner, yes odom to map looks correct and I both model and costmap in rviz

guidout gravatar image guidout  ( 2023-06-16 14:49:55 -0500 )edit

2 Answers

Sort by ยป oldest newest most voted
0

answered 2023-06-19 14:07:23 -0500

I'm just going to be really honest that that issue can come up with really subtle issues with your robot's URDF configuration or costmap configuration. I can't guess all the ways it might be wrong but that should help narrow it down. Also:

  width: 10
  height: 10
  origin_x: -2.0 # Relative to width
  # origin_y: 0.0 # Relative to height

The origin should always be half the width / height - unless you know precisely what you're doing. That's probably a good amount of your problem

edit flag offensive delete link more

Comments

@stevemacenski thanks for the input. I removed that origin_x offset, but that didn't fix the issue (as you probably expected). Can you expand on the URDF born issues you mentioned? I'm really unsure about what you mean by that. About the costmap configuration...well...yes, the problem might be there by everything kinda makes sense to me so I can't really pinpoint the potential issue.

guidout gravatar image guidout  ( 2023-06-20 06:51:46 -0500 )edit
0

answered 2023-08-03 13:55:44 -0500

dcconner gravatar image
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2023-06-16 11:30:22 -0500

Seen: 291 times

Last updated: Aug 03 '23