Robot model not localizing in the map.

asked 2016-02-05 14:00:48 -0600

Kishore Kumar gravatar image

updated 2016-02-06 12:57:14 -0600

I have built a map of a world and launched my navigation launch file for self-navigation. My robot model cannot localize in the map and it keep on jumping inside the map with confusion. I carried out test for laser and odometry, given in this tutorial and both are seems to be perfect. I can build a perfect map using slam_gmapping node but can't simulate the initial pose and goal in rviz, the model fails to localize. How to tune the localization node for perfect results.


Launch file

  <!-- Load the TortoiseBot URDF model into the parameter server -->
  <param name="robot_description" textfile="$(find jmbot2_description)/urdf/jmbot1.2.urdf" />
  <!-- Start Gazebo with a world containing a large building-->
  <include file="$(find gazebo_ros)/launch/willowgarage_world.launch"/>
  <!-- include file="$(find gazebo_ros)/launch/empty_world.launch"/ -->
  <!-- Spawn a TortoiseBot in Gazebo, taking the description from the
       parameter server -->
  <node name="spawn_urdf" pkg="gazebo_ros" type="spawn_model" 
    args="-param robot_description -urdf -model jmbot1.2 -x 8 -y -8" />

<!-- Convert /joint_states messages published by Gazebo to /tf messages,
       e.g., for rviz-->
  <node name="robot_state_publisher" pkg="robot_state_publisher"
  <node name="map_server" pkg="map_server" type="map_server"
        args="$(find mapping2)/src/maps/mapnew.yaml"  />

<include file="$(find amcl)/examples/amcl_diff.launch"/>

  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <rosparam file="$(find jmbot2_description)/src/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find jmbot2_description)/src/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find jmbot2_description)/src/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find jmbot2_description)/src/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find jmbot2_description)/src/base_local_planner_params.yaml" command="load" />
    <param name="controller_frequency" value="5.0"/>



  holonomic_robot: false
  meter_scoring: true


obstacle_range: 2.5
raytrace_range: 3.0
robot_radius: 0.5
inflation_radius: 0.55
observation_sources: laser_scan_sensor
laser_scan_sensor: {sensor_frame: hokuyo_link, data_type: LaserScan, topic: scan, marking: true, clearing: true}


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


  global_frame: /odom
  robot_base_frame: base_link
  update_frequency: 2.0
  publish_frequency: 1.0
  static_map: false
  rolling_window: true
  width: 10.0
  height: 10.0
  resolution: 0.050000
edit retag flag offensive close merge delete


This will be very tough to answer...there's not a lot of data here to understand your present setup. "How to tune for perfect results" is extremely broad. Did you build your map via slam? ie, driving around and building up the pgm and the resulting map looks good? Are you testing in the same env?

codenotes gravatar image codenotes  ( 2016-02-06 08:40:39 -0600 )edit

Yes i built the map in SLAM, the map looks extremely clear and good. I am testing in same environment. Please find my configuration files in my edit above

Kishore Kumar gravatar image Kishore Kumar  ( 2016-02-06 12:52:10 -0600 )edit

I am guessing something is wrong with your robot model. Make sure the physics of your robot model is correct.

Naman gravatar image Naman  ( 2016-02-08 08:43:49 -0600 )edit

I have built my map in SLAM. I have tested my model following the tutorial and my model is doing well till the test 2.2 odometry. Do you still think my model physics have problem. If so can you direct me to the test procedures

Kishore Kumar gravatar image Kishore Kumar  ( 2016-02-08 11:37:31 -0600 )edit

As you could see here the robot is not on layer of the grid. The wheel contact is under the grid. Is this an abnormal case or the physics problem you mentioned?

Kishore Kumar gravatar image Kishore Kumar  ( 2016-02-08 12:14:21 -0600 )edit looks like something is wrong with the model. The robot should be on the layer of the grid. Make sure to have a correct robot model.

Naman gravatar image Naman  ( 2016-02-09 21:49:11 -0600 )edit

I disagree. this map makes a lot of sense. you are building a 2D map and your map Z value is 0 at the location of your laser scans. you are not building a map of the floor, you are building a map at the level of your laser scanner.

tb12 gravatar image tb12  ( 2017-03-21 17:54:29 -0600 )edit