Function navmap_ros::from_msg(const navmap_ros_interfaces::msg::NavMapLayer&, navmap::NavMap&)
Defined in File conversions.hpp
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 fieldtype.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, ordata_f64must 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.