Skip to content

Commit

Permalink
Map server wait for a valid time, fix ros-planning#573 (ros-planning#700
Browse files Browse the repository at this point in the history
)

When launching the map_server with Gazebo, the current time is picked
before the simulation is started and then has a value of 0.
Later when querying the stamp of the map, a value of has a special
signification on tf transform for example.
  • Loading branch information
romainreignier authored and DLu committed Mar 29, 2018
1 parent 43e9297 commit 9edda2b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions map_server/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,8 @@ class MapServer
ROS_ERROR("%s", e.what());
exit(-1);
}
// To make sure get a consistent time in simulation
ros::Time::waitForValid();
map_resp_.map.info.map_load_time = ros::Time::now();
map_resp_.map.header.frame_id = frame_id;
map_resp_.map.header.stamp = ros::Time::now();
Expand Down

0 comments on commit 9edda2b

Please sign in to comment.