NavMap
|
IO helpers to persist NavMap objects to/from disk. More...
Classes | |
struct | SaveOptions |
Save options. More... | |
Functions | |
bool | load_from_file (const std::string &path, navmap::NavMap &out_map, std::error_code *ec=nullptr) |
Load a navmap::NavMap by deserializing a message and converting to core. | |
bool | load_msg_from_file (const std::string &path, navmap_ros_interfaces::msg::NavMap &out_msg, std::error_code *ec=nullptr) |
Load a NavMap message from a file created by this saver. | |
bool | save_msg_to_file (const navmap_ros_interfaces::msg::NavMap &msg, const std::string &path, const SaveOptions &options={}, std::error_code *ec=nullptr) |
Save a NavMap message to disk using ROS 2 CDR serialization. | |
bool | save_to_file (const navmap::NavMap &map, const std::string &path, const SaveOptions &options={}, std::error_code *ec=nullptr) |
Save a navmap::NavMap by converting it to a message and serializing to disk. | |
IO helpers to persist NavMap objects to/from disk.
bool load_from_file | ( | const std::string & | path, |
navmap::NavMap & | out_map, | ||
std::error_code * | ec = nullptr ) |
Load a navmap::NavMap
by deserializing a message and converting to core.
Requires navmap_core
headers and navmap_ros::from_msg
.
[in] | path | Source file path. |
[out] | out_map | Output core map. |
[out] | ec | Optional error code; if not null, it will be set on failure. |
true
on success, false
otherwise.bool load_msg_from_file | ( | const std::string & | path, |
navmap_ros_interfaces::msg::NavMap & | out_msg, | ||
std::error_code * | ec = nullptr ) |
Load a NavMap
message from a file created by this saver.
The loader first tries to parse the header; if the magic header is missing, it falls back to treating the whole file as a raw CDR payload.
[in] | path | Source file path. |
[out] | out_msg | Output message deserialized from file. |
[out] | ec | Optional error code; if not null, it will be set on failure. |
true
on success, false
otherwise (and ec
is set if provided). bool save_msg_to_file | ( | const navmap_ros_interfaces::msg::NavMap & | msg, |
const std::string & | path, | ||
const SaveOptions & | options = {}, | ||
std::error_code * | ec = nullptr ) |
Save a NavMap
message to disk using ROS 2 CDR serialization.
The resulting file contains a small header (magic, version, size) followed by the CDR payload.
[in] | msg | Message to save. |
[in] | path | Destination file path. |
[in] | options | Save options (currently unused, reserved). |
[out] | ec | Optional error code; if not null, it will be set on failure. |
true
on success, false
otherwise (and ec
is set if provided).bool save_to_file | ( | const navmap::NavMap & | map, |
const std::string & | path, | ||
const SaveOptions & | options = {}, | ||
std::error_code * | ec = nullptr ) |
Save a navmap::NavMap
by converting it to a message and serializing to disk.
Requires navmap_core
headers and navmap_ros::to_msg
.
[in] | map | Core map to save. |
[in] | path | Destination file path. |
[in] | options | Save options (currently unused, reserved). |
[out] | ec | Optional error code; if not null, it will be set on failure. |
true
on success, false
otherwise.