osrf / rosbook

Example code to accompany the book Programming Robots with ROS
Apache License 2.0
476 stars 237 forks source link

Robot model fails to reach goal in navigation stack. #10

Open kishorekumar29 opened 8 years ago

kishorekumar29 commented 8 years ago

I followed the instructions of the book and built a map using slam_gmapping node. I have configured navigation stack to my gazebo robot and created a launch file as below. Everything went fine with out error, of-course there are some warnings. When i launched the stack and gave initial pose & goal, the robot fails to trace the goal. It wanders with confusion and executes the rotary recovery mode. The localization of the robot was poor and the navigation getting aborted often. In some cases the robot moves till 50% of goal path and fails there. I understand there is some problem with my configuration and needs some fine tuning. Where should i apply patches to fix this. Below is my launch and config codes.

PS: I am using non-gpu laser sensor because i got some problem with my gpu_ray laser.

<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.0

I get these warnings occasionally but these are not consistent

[ WARN] [1454605148.779801697, 21.830000000]: Failed to transform initial pose in time (Lookup would require extrapolation into the future. Requested time 21.825000000 but the latest data is at time 21.821000000, when looking up transform from frame [base_link] to frame [map])

[ WARN] [1454605512.623590430, 69.784000000]: Map update loop missed its desired rate of 2.0000Hz... the loop actually took 0.6400 seconds

kishorekumar29 commented 8 years ago

I tried to move the model in the world using tele-operation without giving initial pose and goal. Then i came know that the problem is purely with my localization. The model couldn't localize inside the map.

MohammadSaad19 commented 1 year ago

Hi kishore. I am been facing a similar issue where the robot automatically goes to recovery mode and spins around its axis. It is a localisation problem. Did you find anything that resolved your error?