Robot model not localizing in the map.
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.
EDIT 1:
Launch file
<launch>
<!-- 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"
type="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"/>
</node>
</launch>
base_local_planner_params.yaml
TrajectoryPlannerROS:
holonomic_robot: false
meter_scoring: true
costmap_common_params.yaml
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_costmap_params.yaml
global_costmap:
global_frame: /map
robot_base_frame: base_link
update_frequency: 2.0
static_map: true
local_costmap_params.yaml
local_costmap:
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
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?
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
I am guessing something is wrong with your robot model. Make sure the physics of your robot model is correct.
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
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?
Yeah..it 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.
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.