Dan, <br>I think your problem can be solved by settting the parameter /use_sim_time to true.  This will make ros::Time::now() return simulation time as broadcast by the bag file or stageros or gazebo on the /clock topic, instead of the system time.  For more info see <a href="http://www.ros.org/wiki/Clock">http://www.ros.org/wiki/Clock</a><br>

<br>Tully<br><br><div class="gmail_quote">On Mon, Apr 19, 2010 at 10:12 AM, Daniel Maier <span dir="ltr"><<a href="mailto:maierd@informatik.uni-freiburg.de">maierd@informatik.uni-freiburg.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">

Hi Eitan,<br>
<br>
Thanks for the hint. I tried it with the -b option and now I receive the<br>
following warning:<br>
<br>
[ WARN] 1270644364.295866960: Costmap2DROS transform timeout. Current<br>
time: 1270644364.2959, global_pose stamp: 1260460808.9770, tolerance:<br>
0.3000<br>
<br>
which is caused by Costmap2DROS calling ros::Time::now() to check the<br>
validity of the tfs.<br>
I guess stageros republishes my laser messages as base_scan with a shifted<br>
timestamp so the problem does not occur in this case.<br>
<br>
Is there any way around this?<br>
Dan<br>
<div><div></div><div class="h5"><br>
On Mon, 19 Apr 2010 18:45:14 +0200, Eitan Marder-Eppstein<br>
<<a href="mailto:eitan@willowgarage.com">eitan@willowgarage.com</a>> wrote:<br>
<br>
> Dan,<br>
><br>
> Are you publishing time when you playback the bag? If not, this could be<br>
> the<br>
> problem. Try using the "-b" option of rosplay to publish simulation time.<br>
> Stageros does this by default so that could be why things work from the<br>
> bag<br>
> when the simulator is up, but not otherwise.<br>
><br>
> Hope this helps,<br>
><br>
> Eitan<br>
><br>
><br>
> On Mon, Apr 19, 2010 at 8:35 AM, Daniel Maier <<br>
> <a href="mailto:maierd@informatik.uni-freiburg.de">maierd@informatik.uni-freiburg.de</a>> wrote:<br>
><br>
>><br>
>> On Mon, 19 Apr 2010 16:52:42 +0200, Brian Gerkey<br>
>> <<a href="mailto:gerkey@willowgarage.com">gerkey@willowgarage.com</a>><br>
>> wrote:<br>
>><br>
>> > hi Daniel,<br>
>> ><br>
>> > costmap_2d can definitely be used without stageros.  But it needs a<br>
>> > source of laser data and transforms.  When you comment out stageros<br>
>> > from your launch file, you're no longer feeding any data into the<br>
>> > costmap.  That's why callbacks aren't being invoked.  Laser and<br>
>> > transform data could come from a simulation (e.g., stageros), a<br>
>> > physical robot, or playback of logged data from a bag file<br>
>> > (<a href="http://www.ros.org/wiki/Bags" target="_blank">http://www.ros.org/wiki/Bags</a>).<br>
>> ><br>
>> >       brian.<br>
>><br>
>> Hi Brian,<br>
>><br>
>> Thanks for your answer. I think I missed to provide some information.<br>
>> My laser data is stored in a bag file and published by rosbag in the<br>
>> topic<br>
>> /laser.<br>
>> The frame_id of /laser is /Laser_frame.<br>
>> /odom is the odometry frame and /Base_link the first (and only) child of<br>
>> /odom representing the robot base.<br>
>><br>
>> So my tf tree looks (simplified) like this:<br>
>> /odom-> /Base_link -> /Pantilt_link -> /Laser_frame<br>
>><br>
>> With stageros running the costmap created by the costmap_2d_tutorial<br>
>> node<br>
>> seems to be using my laser data from the aforementioned bag file.<br>
>> If I outcomment stageros in the launch file, nothing happens.<br>
>> In both cases I am using the same costmap_params.yaml file.<br>
>><br>
>> Any ideas?<br>
>> Best,<br>
>> Dan<br>
>><br>
>><br>
>> ><br>
>> > On Mon, Apr 19, 2010 at 6:28 AM, Daniel Maier<br>
>> > <<a href="mailto:maierd@informatik.uni-freiburg.de">maierd@informatik.uni-freiburg.de</a>> wrote:<br>
>> >> Hi!<br>
>> >><br>
>> >> I think about using costmap_2d in one of my projects so I played<br>
>> around<br>
>> >> with the costmap_2d_tutorials.<br>
>> >> Is it possible to run the costmap without stageros?<br>
>> >> Here is a launch file I use for bringing up a costmap:<br>
>> >><br>
>> >> <launch><br>
>> >>   <param name="/use_sim_time" value="true"/><br>
>> >>   <node pkg="costmap_2d_tutorials" type="costmap_test"<br>
>> respawn="false"<br>
>> >> name="costmap_test" output="screen"><br>
>> >>     <rosparam file="$(find nav)/costmap_params.yaml" command="load"<br>
>> >> ns="costmap" /><br>
>> >>   </node><br>
>> >>   <!--<br>
>> >>   <node pkg="stage" type="stageros" name="stageros" args="$(find<br>
>> >> 2dnav_stage)/worlds/willow-pr2-2.5cm.world" respawn="false" ><br>
>> >>     <param name="base_watchdog_timeout" value="0.2"/><br>
>> >>   </node><br>
>> >>   --><br>
>> >> </launch><br>
>> >><br>
>> >> If I include the stageros node everything works as expected (I<br>
>> guess).<br>
>> >> If I don't, the laserScanCallback in costmap_2d_ros.cpp is not being<br>
>> >> called.<br>
>> >><br>
>> >> Here is my costmap_params.yaml file:<br>
>> >><br>
>> >> global_frame: /odom<br>
>> >> robot_base_frame: Base_link<br>
>> >> update_frequency: 5.0<br>
>> >> publish_frequency: 2.0<br>
>> >> transform_tolerance: 0.3<br>
>> >> obstacle_range: 12.5<br>
>> >> max_obstacle_height: 1.0<br>
>> >> raytrace_range: 13.5<br>
>> >> inscribed_radius: 0.15<br>
>> >> circumscribed_radius: 0.29<br>
>> >> inflation_radius: 0.4<br>
>> >> observation_sources: laser<br>
>> >> laser:<br>
>> >>  data_type: LaserScan<br>
>> >>  expected_update_rate: 0.2<br>
>> >>  observation_persistence: 5.0<br>
>> >>  marking: true<br>
>> >>  clearing: true<br>
>> >>  max_obstacle_height: 0.9<br>
>> >>  min_obstacle_height: 0.08<br>
>> >><br>
>> >> static_map: false<br>
>> >> rolling_window: true<br>
>> >> width: 10.0<br>
>> >> height: 10.0<br>
>> >> resolution: 0.025<br>
>> >> map_type: voxel<br>
>> >> origin_x: 0.0<br>
>> >> origin_y: 0.0<br>
>> >> origin_z: 0.0<br>
>> >> z_resolution: 0.2<br>
>> >> z_voxels: 10<br>
>> >> unknown_threshold: 6<br>
>> >> mark_threshold: 0<br>
>> >> cost_scaling_factor: 10.0<br>
>> >> lethal_cost_threshold: 100<br>
>> >><br>
>> >><br>
>> >> Thanks for your help,<br>
>> >> Dan<br>
>> _______________________________________________<br>
>> ros-users mailing list<br>
>> <a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
>> <a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
>><br>
<br>
_______________________________________________<br>
ros-users mailing list<br>
<a href="mailto:ros-users@code.ros.org">ros-users@code.ros.org</a><br>
<a href="https://code.ros.org/mailman/listinfo/ros-users" target="_blank">https://code.ros.org/mailman/listinfo/ros-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Tully Foote<br>Systems Engineer<br>Willow Garage, Inc.<br><a href="mailto:tfoote@willowgarage.com">tfoote@willowgarage.com</a><br>(650) 475-2827<br>