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

Running PR2 in Gazebo; 2dnav gives TF errors

asked 2012-01-24 10:50:37 -0500

Ibrahim gravatar image

Hi, I'm trying to test some software I wrote in simulation before running it on the real PR2. I created a little Gazebo world that is a somewhat accurate representation of my workspace, and I launch it and it works fine for the most part. I can launch pr2_2dnav_slam.launch and teleop the simulated PR2 around to generate a map of the area. Then I save the map, and I want to load it as a static map using a map_server and then launch the nav stack. However, at this point the nav stack starts throwing a bunch of TF errors that all basically look like

[ERROR] [1327451804.285384190, 15.638000000]: Transform unavailable Lookup would require extrapolation into the past. Requested time 15.288000000 but the earliest data is at time 15.508000000, when looking up transform from frame [/base_footprint] to frame [/base_link]

and becomes basically unusable. I have set ROBOT=sim and I'm using https://code.ros.org/svn/wg-ros-pkg/stacks/wg_robots_gazebo/trunk/pr2_2dnav_gazebo/2dnav-stack-amcl.launch to launch the nav stack which should ensure that it's using the simulated PR2.

Any ideas on what could be wrong? Thanks!

edit retag flag offensive close merge delete

Comments

I do see the same error a couple times on startup, but the error stops and things work correctly. Do you see a continuous stream of the error message?
hsu gravatar image hsu  ( 2012-01-24 13:18:15 -0500 )edit
I didn't try that one, I'll try it out now. For me I get the errors only at the beginning but then I can't actually do anything with the nav stack at that point (eg. I tried publishing an initial pose to localize, didn't work, etc).
Ibrahim gravatar image Ibrahim  ( 2012-01-25 08:08:25 -0500 )edit
Oh thanks! Starting everything together makes it work. I'm guessing I didn't set use_sim_time properly for the other nodes?
Ibrahim gravatar image Ibrahim  ( 2012-01-25 08:41:57 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted
0

answered 2012-01-24 13:15:37 -0500

hsu gravatar image
edit flag offensive delete link more
0

answered 2012-01-25 10:12:54 -0500

this post is marked as community wiki

This post is a wiki. Anyone with karma >75 is welcome to improve it.

John's suggestion "did you try the launch file: https://code.ros.org/svn/wg-ros-pkg/stacks/wg_robots_gazebo/trunk/pr2_2dnav_gazebo/pr2-empty-amcl.launch for starting everything together? - hsu (20 hours ago)" worked.

edit flag offensive delete link more
0

answered 2012-01-25 12:38:07 -0500

hsu gravatar image

updated 2012-01-25 12:38:56 -0500

Looking at pr2-empty-amcl.launch:

<launch>

  <!-- start up empty world -->
  <include file="$(find gazebo_worlds)/launch/empty_world.launch"/>

  <!-- start up robot -->
  <include file="$(find pr2_gazebo)/pr2.launch"/>

  <!-- Tug Arms For Navigation -->
  <node name="tuckarms" pkg="pr2_tuckarm" type="tuckarm.py" args="b" output="screen" />

  <!-- load map -->
  <node name="map_server" pkg="map_server" type="map_server" args="$(find gazebo_worlds)/Media/materials/textures/map_blank.png 0.1" respawn="true" />

  <!-- nav-stack -->
  <include file="$(find pr2_2dnav_gazebo)/2dnav-stack-amcl.launch"/>

  <!-- for visualization -->
  <include file="$(find pr2_navigation_global)/rviz/rviz_move_base.launch"/>

</launch>

Is it possible that you didn't launch one of the nodes? If you launch each of these nodes by hand, does the navigation stack work for you?

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-01-24 10:50:37 -0500

Seen: 598 times

Last updated: Jan 25 '12