naturerobots / mesh_tools

Tools and Messages for Annotated 3D Triangle Meshes in ROS
https://wiki.ros.org/mesh_tools
BSD 3-Clause "New" or "Revised" License
229 stars 42 forks source link

fix msg cache lookup to work when msgs have stamp=0 #34

Closed Cakem1x closed 5 months ago

Cakem1x commented 5 months ago

This PR fixes caching for simulation envs.

In the last PR, I used a workaround to avoid a segfault. But the workaround causes chached msgs to be ignored when incoming map data has header.stamp=0. In practice, this happens almost every time when using simulation (when the map server starts at sim startup, sim_time is still 0 when the map is published).

This PR changes the lookup behavior to avoid the issue above. Additionally, it will only find msgs with matching stamp. The latest mesh_map version ensures that stamps of geometry and costs/colors match, so this should be fine.