Function navmap_ros::io::save_msg_to_file

Function Documentation

bool navmap_ros::io::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.

Note

The format is portable across ROS 2 nodes using the same message type.

Parameters:
  • msg[in] Message to save.

  • path[in] Destination file path.

  • options[in] Save options (currently unused, reserved).

  • ec[out] Optional error code; if not null, it will be set on failure.

Returns:

true on success, false otherwise (and ec is set if provided).