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

global costmap position

asked 2014-07-14 23:28:52 -0500

Kasra gravatar image

Hi,

I'm new to ROS and I'm trying to get my robot simulation in gazebo work with the navigation stack. I've followed the navigation stack tutorials but when I set a goal position in the rviz, I get the error:

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

Here are my navigation stack configurations:

costmap_common_params:

obstacle_range: 2.5
raytrace_range: 3.0
footprint: [[-0.2,-0.2],[-0.2,0.2], [0.2, 0.2], [0.2,-0.2]]
#robot_radius: 0.20
inflation_radius: 0.55

observation_sources: laser_scan_sensor

laser_scan_sensor: {sensor_frame: lms100, data_type: LaserScan, topic: /p3dx/laser/scan, marking: true, clearing: true}

global_costmap_params:

global_frame: /map
robot_base_frame: base_link
update_frequency: 5.0
static_map: true

local_costmap_params:

global_frame: odom
robot_base_frame: base_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: 0.8 # seconds

base_local_planner_params:

TrajectoryPlannerROS:
  max_vel_x: 0.45
  min_vel_x: 0.1
  max_rotational_vel: 1.0
  min_in_place_rotational_vel: 0.4

  acc_lim_th: 3.2
  acc_lim_x: 2.5
  acc_lim_y: 2.5

  holonomic_robot: false

move_base.launch:

<launch>
  <master auto="start"/>

  <!-- Run the map server -->
<!-- <node name="map_server" pkg="map_server" type="map_server" args="$(find p3dx_description)/launch/map.yaml my_map" output="screen"/>   -->

  <!--- Run AMCL -->

  <include file="$(find amcl)/examples/amcl_omni.launch" />
 <!-- <include file="$(find erratic_navigation)/navigation_slam/slam_gmapping.launch" /> -->

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

gazebo.launch which contains gmapping:

<launch>

    <!-- these are the arguments you can pass this launch file, for example 
        paused:=true -->
    <arg name="paused" default="false" />
    <arg name="use_sim_time" default="true" />
    <arg name="gui" default="true" />
    <arg name="headless" default="false" />
    <arg name="debug" default="false" />

    <!-- We resume the logic in empty_world.launch, changing only the name of 
        the world to be launched -->
    <include file="$(find gazebo_ros)/launch/empty_world.launch">
        <arg name="world_name" value="$(find p3dx_gazebo)/worlds/p3dx.world" />
        <arg name="debug" value="$(arg debug)" />
        <arg name="gui" value="$(arg gui)" />
        <arg name="paused" value="$(arg paused)" />
        <arg name="use_sim_time" value="$(arg use_sim_time)" />
        <arg name="headless" value="$(arg headless)" />

    </include>

    <!-- Load the URDF into the ROS Parameter Server -->
    <param name="robot_description"
        command="$(find xacro)/xacro.py '$(find p3dx_description)/urdf/pioneer3dx.xacro'" />

    <!-- Run a python script to the send a service call to gazebo_ros to spawn 
        a URDF robot -->
    <node name="urdf_spawner" pkg="gazebo_ros" type="spawn_model"
        respawn="false" output="screen" args="-urdf -model p3dx -param robot_description" />

    <!-- ros_control p3rd launch file -->
    <!-- <include file="$(find p3dx_control)/launch/control.launch" /> -->


<!-- kasra -->

    <node pkg="p3dx_gazebo" name="mimic_cmd_vel" type="mimic_cmd_vel"  />

      <!-- convert joint states to TF transforms for rviz, etc -->
  <node name="robot_state_publisher" pkg="robot_state_publisher" type="robot_state_publisher"
    respawn="false" output="screen">
    <remap from="/joint_states" to="/p3dx/joint_states" />
  </node>
  <node ...
(more)
edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
3

answered 2014-07-16 13:23:32 -0500

Kasra gravatar image

I found what's causing the problem. For whatever reason I couldn't put the namespace in the beginning of the param files like putting the "global_costmap" at the start point of the "global_costmap_params.yaml". It's the way it is in the tutorials but it just didn't work for me. So I added these namespaces to the move_base.launch and now I see my robot in center of the global_costmap. Thank you David, looking at the output of "rosparam get /move_base" helped me to figure it out.

edit flag offensive delete link more
1

answered 2014-07-15 04:54:40 -0500

donmrsir gravatar image

If you are using gmapping, you have to set static map to false in the global costmap param, since you are not using any previous created map, you are using the map created with slam gmapping. An example of how to set this could be:

static_map: false width: 40.0 height: 40.0 origin_x: -20.0 origin_y: -20.0

Note that the origin of the map is the center of it. Also you can use any size you want for it.

edit flag offensive delete link more

Comments

Thanks you. I made the changes but still when I add the global_costmap to the rviz, it shows it in the the same place. It seems writing "width: 40.0 height: 40.0 origin_x: -20.0 origin_y: -20.0" hasn't changed anything, because its origin is still (0, 0, 0) and weight=heigh=200

Kasra gravatar image Kasra  ( 2014-07-15 15:01:48 -0500 )edit

Which namespace did you set those parameters in?

David Lu gravatar image David Lu  ( 2014-07-15 16:21:41 -0500 )edit

global_costmap, local_cost_map, and TrajectoryPlannerROS (They are set in move_base.launch)

Kasra gravatar image Kasra  ( 2014-07-15 18:50:53 -0500 )edit
2

Can you post the output of `rosparam get /move_base` (once the code is running)

David Lu gravatar image David Lu  ( 2014-07-16 09:07:04 -0500 )edit

David, I only can put a few characters here so I uploaded the output: https://www.dropbox.com/s/93wv296sfkb90b2/move_base_param.txt Thanks

Kasra gravatar image Kasra  ( 2014-07-16 12:36:43 -0500 )edit

@donmrsir , there are some mix-up in here. I'm confused. [etian's answer ( http://answers.ros.org/question/9432/... ) indicates that we can use gmapping and navigation at the same time, no need to change static map to false

bsk gravatar image bsk  ( 2016-06-29 01:23:31 -0500 )edit

@bsk yes sure, he is right. The thing is that for navigation with gmapping you can use static map false, which mean that your system is in charge of constructing the map while navigation, or static map true, which means that you already have the map of the environment and the navigation use that map

donmrsir gravatar image donmrsir  ( 2016-06-29 03:35:35 -0500 )edit

The problem here, if i remember correctly, is that op didnt have a static map, so his only option was to use static map false

donmrsir gravatar image donmrsir  ( 2016-06-29 03:37:12 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2014-07-14 23:28:52 -0500

Seen: 3,296 times

Last updated: Jul 16 '14