Function navmap_ros::from_msg(const navmap_ros_interfaces::msg::NavMapLayer&, navmap::NavMap&)

Function Documentation

void navmap_ros::from_msg(const navmap_ros_interfaces::msg::NavMapLayer &msg, navmap::NavMap &nm)

Import a single NavMapLayer message into a NavMap.

If the layer already exists in nm, it is overwritten. Otherwise, it is created. Performs type dispatch based on the message field type.

  • The function verifies that the length of the populated data array matches the number of triangles (NavCels) in nm.

  • Exactly one of the arrays data_u8, data_f32, or data_f64 must be set.

Parameters:
  • msg[in] Input NavMapLayer message.

  • nm[inout] Destination NavMap (must already have navcels sized correctly).

Throws:

std::runtime_error – If sizes are inconsistent or the message is ill-formed.