Function navmap_ros::from_pointcloud2
Defined in File conversions.hpp
Function Documentation
-
navmap::NavMap navmap_ros::from_pointcloud2(const sensor_msgs::msg::PointCloud2 &pc2, navmap_ros_interfaces::msg::NavMap &out_msg, BuildParams params)
Build a NavMap surface from a ROS
sensor_msgs::msg::PointCloud2.The cloud is decoded to
pcl::PointXYZand processed as in navmap_ros::from_points.Non-Cartesian fields present in
pc2are ignored by this overload.The resulting NavMap is exported to
out_msgfor downstream publication or storage.
Note
If the message is empty or lacks the required fields, no geometry is produced.
- Parameters:
pc2 – [in] Input PointCloud2 message (expects fields
x,y,z).out_msg – [out] Output transport message mirroring the created NavMap.
params – [in] Meshing and filtering parameters (see ::BuildParams).
- Returns:
The constructed
navmap::NavMap.- Throws:
std::runtime_error – If decoding fails or meshing cannot be completed.