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

[Noetic, Rtabmap, move_base]I cannot resolve the error "The robot's start position is off the global costmap."

asked 2022-11-16 02:01:16 -0500

donguri gravatar image

updated 2023-06-18 09:44:57 -0500

lucasw gravatar image

I have set the robot's target point and orientation in "2D Nav Goal" in RViz and am trying to run the robot to the target point, but I get the following error message.

The robot's start position is off the global costmap. Planning will always fail, are you sure the robot has been properly localized?

I am asking this question because I have researched the error I am getting and have tried everything and it does not solve the problem.

The current situation looks like this.

  • Activate sensors (fisheye camera, depth camera, etc.).
  • Activate RTABMap.
  • Activate move_base.
  • Launch navigation.
  • Specify the target in "2D Nav Goal" of RViz.
  • Output the above error.

The robot makes a left turn and stops while the error is being output.

I see from the questions of others who have the same error as mine that it seems to be solved by changing the contents of "global_costmap_param.yaml". However, in my case, I am using RTABMap, so I wonder if the solution is a little different?

move_base.launch

<!-- 
    ROS navigation stack with velocity smoother and safety (reactive) controller
-->
<launch>

  <arg name="odom_frame_id"   default="t265_odom_frame"/>
  <arg name="base_frame_id"   default="robot_center"/>
  <arg name="global_frame_id" default="map"/>
  <arg name="odom_topic" default="t265/odom/sample" />

  <arg name="laser_topic" default="scan" />


  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find realsense_controls)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find realsense_controls)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />   
    <rosparam file="$(find realsense_controls)/config/local_costmap_params_3d.yaml" command="load" />   
    <rosparam file="$(find realsense_controls)/config/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find realsense_controls)/config/base_local_planner_params.yaml" command="load" />

    <!-- reset frame_id parameters using user input data -->
    <param name="global_costmap/global_frame" value="$(arg global_frame_id)"/>
    <param name="global_costmap/robot_base_frame" value="$(arg base_frame_id)"/>
    <param name="local_costmap/global_frame" value="$(arg odom_frame_id)"/>
    <param name="local_costmap/robot_base_frame" value="$(arg base_frame_id)"/>
    <param name="DWAPlannerROS/global_frame_id" value="$(arg odom_frame_id)"/>


    <remap from="odom" to="$(arg odom_topic)"/>
    <remap from="scan" to="$(arg laser_topic)"/>
  </node>
</launch>

global_costmap_param.yaml

#global_costmap
global_frame: /map
robot_base_frame: /robot_center
update_frequency: 1
publish_frequency: 1
always_send_full_costmap: false
#static_map: false
#rolling_window: true
plugins:
   - {name: static_layer, type: "rtabmap_ros::StaticLayer"}
   - {name: obstacle_layer, type: "costmap_2d::ObstacleLayer"}
   - {name: inflation_layer, type: "costmap_2d::InflationLayer"}

----------------------Editing ①.--------------------------------

After the change "move_base.launch" <launch>

  <arg name="odom_frame_id"   default="t265_odom_frame"/>
  <arg name="base_frame_id"   default="robot_center"/>
  <arg name="global_frame_id" default="map"/>
  <arg name="odom_topic" default="t265/odom/sample" />

  <arg name="laser_topic" default="scan" />

<!--Added statement-->
  <remap from="map" to="/rtabmap/grid_map"/>


      <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
        <rosparam file="$(find realsense_controls)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
        <rosparam file="$(find realsense_controls)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />   
        <rosparam file="$(find realsense_controls)/config/local_costmap_params_3d.yaml" command="load" />   
        <rosparam file="$(find realsense_controls)/config/global_costmap_params.yaml" command="load" />
        <rosparam file="$(find realsense_controls)/config/base_local_planner_params.yaml" command ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
1

answered 2022-11-16 12:13:29 -0500

matlabbe gravatar image

It seems you are missing a:

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

before move_base node. Verify in RVIZ that you can see the global costmap.

edit flag offensive delete link more

Comments

Dear matlabbe.

Thank you for the reply!

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

I tried adding <remap from="map" to="/rtabmap/grid_map"/> before the above code in move_base.launch and running it, but it still did not work.

The changes I have made may have differed from your intentions, so I will add the changes I have made in editing to the body of the question. Please check it.

I would like to publish any other files that might be relevant to solving this problem. Thank you in advance.

Thank you.

donguri gravatar image donguri  ( 2022-11-17 03:19:31 -0500 )edit

In the Rviz I added to the question, I see that "robot/center" and "map" are misaligned.

Is this misalignment the cause of this problem?

By the way, the center of the robot is "robot/center" and various sensors are installed in front of the robot.

donguri gravatar image donguri  ( 2022-11-17 03:30:36 -0500 )edit

Use rosnode info on move_baseand rtabmapnodes to know exactly what is the map topic name you should remap. rqt_graphcan be handy to debug topic remapping issues. I don't see how rtabmap is started, but if it is started in global namespace, the topic would be /grid_map, unless you did remap the output topic name somewhere.

matlabbe gravatar image matlabbe  ( 2022-11-19 13:14:17 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2022-11-16 02:01:16 -0500

Seen: 104 times

Last updated: Nov 17 '22