0
$\begingroup$

http://docs.ros.org/api/nav_msgs/html/msg/MapMetaData.html

The description says it is 'The time at which the map was loaded'- should this be the time the map was initialized? The time it was last updated (making it redundant with the header timestamp)?

PS: I am asking the same question at https://answers.ros.org/question/114726/what-is-map_load_time-in-nav_msgsmapmetadata/ that nobody has answered so far.

$\endgroup$
1
  • $\begingroup$ I think the other question will get imported here in a month and one of these will get marked duplicate, not sure if they'll backdate mine $\endgroup$ Nov 18, 2022 at 12:43

1 Answer 1

1
$\begingroup$

I have a lot of ros packages checked out into a big catkin workspace, looks like it is redundant with the header stamp:

$ git grep --no-index -n -C 2 --heading map_load_time 
other/jsk_common/jsk_ros_patch/multi_map_server/src/main.cpp
155-      ROS_INFO("Loading map from image \"%s\"", mapfname.c_str());
156-      map_server::loadMapFromFile(&map_resp_,mapfname.c_str(),res,negate,occ_th,free_th, origin);
157:      map_resp_.map.info.map_load_time = ros::Time::now();
158-      map_resp_.map.header.frame_id = frame_id;
159-      map_resp_.map.header.stamp = ros::Time::now();
--
ros/grid_map/grid_map_ros/src/GridMapRosConverter.cpp
275-  occupancyGrid.header.frame_id = gridMap.getFrameId();
276-  occupancyGrid.header.stamp.fromNSec(gridMap.getTimestamp());
277:  occupancyGrid.info.map_load_time = occupancyGrid.header.stamp;  // Same as header stamp as we do not load the map.
278-  occupancyGrid.info.resolution = gridMap.getResolution();
279-  occupancyGrid.info.width = gridMap.getSize()(0);
--
ros/navigation/map_server/src/main.cpp
154-      // To make sure get a consistent time in simulation
155-      ros::Time::waitForValid();
156:      map_resp_.map.info.map_load_time = ros::Time::now();
157-      map_resp_.map.header.frame_id = frame_id_;
158-      map_resp_.map.header.stamp = ros::Time::now();
--
ros/rviz/src/test/map_test.py
17-    grid.header.frame_id = "map"
18-    grid.header.stamp = rospy.Time.now()
19:    grid.info.map_load_time = rospy.Time.now()
20-    grid.info.resolution = 1.0
21-    grid.info.width = 3

GridMapRosConverter.cpp deserves credit over the others for for re-using the header stamp and putting in a comment instead of having sequential ros::Time::now() calls for time stamps in the same message which will result in very slightly different timestamps which will confuse the issue of whether there is a meaningful difference between the header stamp and map_load_time.

But still I don't fully understand 'Same as header stamp as we do not load the map', probably looking elsewhere in grid_map_ros would reveal what those authors believed map_load_time to mean.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.