[Noetic, Rtabmap, move_base]I cannot resolve the error "The robot's start position is off the global costmap."
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 ...