When we receive global waypoints, save the the data to a file global_waypoint_cache before de-serializing. If a file already exists, do not overwrite it immediately as we may lose power during an overwrite. If the file exists, then:
Create a new file global_waypoint_cache_temp
Write new global waypoint data to global_waypoint_cache_temp
Move global_waypoint_cache_temp to global_waypoint_cache, overwriting it.
On startup, check if a global waypoints file exists. If it does, read it, de-serialize it, and immediately publish it to ROS.
Purpose
Load last known global waypoints on start.
Description
global_waypoint_cache
before de-serializing. If a file already exists, do not overwrite it immediately as we may lose power during an overwrite. If the file exists, then:global_waypoint_cache_temp
global_waypoint_cache_temp
global_waypoint_cache_temp
toglobal_waypoint_cache
, overwriting it.Resources