|
NavMap
|
Conversions between core NavMap and ROS-level structures. More...
Namespaces | |
| namespace | io |
| IO helpers to persist NavMap objects to/from disk. | |
Classes | |
| struct | BuildParams |
| Parameters controlling NavMap construction from point clouds. More... | |
| struct | ViewpointFilterStats |
| Points removed by filter_with_viewpoints(). More... | |
Typedefs | |
| using | Triangle = Eigen::Vector3i |
Functions | |
| bool | build_navmap_from_mesh (const pcl::PointCloud< pcl::PointXYZ > &cloud, const std::vector< Eigen::Vector3i > &triangles, const std::string &frame_id, navmap_ros_interfaces::msg::NavMap &out_msg, navmap::NavMap *out_core_opt) |
| pcl::PointCloud< pcl::PointXYZ > | filter_with_viewpoints (const pcl::PointCloud< pcl::PointWithViewpoint > &input_points, const BuildParams ¶ms, ViewpointFilterStats *stats=nullptr) |
| Clean a cloud with the sensor position of each point (vp_x, vp_y, vp_z). | |
| navmap::NavMap | from_msg (const NavMap &msg) |
| navmap::NavMap | from_msg (const NavMap &msg, std_msgs::msg::Header &header) |
| navmap::NavMap | from_msg (const navmap_ros_interfaces::msg::NavMap &msg) |
| Backward-compatible overload (ignores message header). | |
| navmap::NavMap | from_msg (const navmap_ros_interfaces::msg::NavMap &msg, std_msgs::msg::Header &header) |
| Reconstruct a core navmap::NavMap from the ROS transport message. | |
| void | from_msg (const navmap_ros_interfaces::msg::NavMapLayer &msg, navmap::NavMap &nm) |
| Backward-compatible overload (ignores message header). | |
| void | from_msg (const navmap_ros_interfaces::msg::NavMapLayer &msg, navmap::NavMap &nm, std_msgs::msg::Header &header) |
| Import a single NavMapLayer message into a NavMap. | |
| navmap::NavMap | from_occupancy_grid (const nav_msgs::msg::OccupancyGrid &grid) |
| Backward-compatible overload (ignores grid header). | |
| navmap::NavMap | from_occupancy_grid (const nav_msgs::msg::OccupancyGrid &grid, std_msgs::msg::Header &header) |
| Build a navmap::NavMap from a nav_msgs::msg::OccupancyGrid using a regular triangular surface with shared vertices. | |
| navmap::NavMap | 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. | |
| navmap::NavMap | from_points (const pcl::PointCloud< pcl::PointWithViewpoint > &input_points, navmap_ros_interfaces::msg::NavMap &out_msg, BuildParams params) |
| Build a NavMap from a cloud with the sensor position of each point. | |
| navmap::NavMap | from_points (const pcl::PointCloud< pcl::PointXYZ > &input_points, navmap_ros_interfaces::msg::NavMap &out_msg, BuildParams params) |
| Build a NavMap from an unorganized point cloud (multi-level grid triangulation). | |
| navmap::NavMap | from_regular_grid (const pcl::PointCloud< pcl::PointXYZ > &grid_points, navmap_ros_interfaces::msg::NavMap &out_msg, BuildParams params) |
| Build a NavMap surface from an organized (grid-shaped) PCL point cloud. | |
| navmap_ros_interfaces::msg::NavMapLayer | to_layer_update_msg (const navmap::NavMap &nm, const std::string &layer, const std_msgs::msg::Header &header=std_msgs::msg::Header(), float max_sparse_fraction=0.25f) |
| Layer update with only what changed since the layer's last clear_changes(). | |
| navmap_ros_interfaces::msg::NavMap | to_msg (const navmap::NavMap &nm) |
| Backward-compatible overload (no header provided). | |
| navmap_ros_interfaces::msg::NavMapLayer | to_msg (const navmap::NavMap &nm, const std::string &layer) |
| Backward-compatible overload (no header provided). | |
| navmap_ros_interfaces::msg::NavMapLayer | to_msg (const navmap::NavMap &nm, const std::string &layer, const std_msgs::msg::Header &header) |
| Convert a single layer from a NavMap into a ROS message. | |
| navmap_ros_interfaces::msg::NavMap | to_msg (const navmap::NavMap &nm, const std_msgs::msg::Header &header) |
| Convert a core navmap::NavMap into its compact ROS transport message. | |
| nav_msgs::msg::OccupancyGrid | to_occupancy_grid (const navmap::NavMap &nm) |
| Backward-compatible overload. | |
| nav_msgs::msg::OccupancyGrid | to_occupancy_grid (const navmap::NavMap &nm, const std_msgs::msg::Header &header) |
| Convert a navmap::NavMap back to nav_msgs::msg::OccupancyGrid. | |
Variables | |
| constexpr std::uint8_t | FREE_SPACE |
| Known free. | |
| constexpr std::uint8_t | INSCRIBED_INFLATED_OBSTACLE |
| The robot would touch an obstacle. | |
| constexpr std::uint8_t | LETHAL_OBSTACLE |
| Obstacle. | |
| constexpr std::uint8_t | MAX_NON_OBSTACLE |
| Highest traversable cost. | |
| constexpr std::uint8_t | NO_INFORMATION |
| Unknown, not observed. | |
Conversions between core NavMap and ROS-level structures.
| using Triangle = Eigen::Vector3i |
| bool build_navmap_from_mesh | ( | const pcl::PointCloud< pcl::PointXYZ > & | cloud, |
| const std::vector< Eigen::Vector3i > & | triangles, | ||
| const std::string & | frame_id, | ||
| navmap_ros_interfaces::msg::NavMap & | out_msg, | ||
| navmap::NavMap * | out_core_opt ) |
| pcl::PointCloud< pcl::PointXYZ > filter_with_viewpoints | ( | const pcl::PointCloud< pcl::PointWithViewpoint > & | input_points, |
| const BuildParams & | params, | ||
| ViewpointFilterStats * | stats = nullptr ) |
Clean a cloud with the sensor position of each point (vp_x, vp_y, vp_z).
| navmap::NavMap from_msg | ( | const NavMap & | msg | ) |
| navmap::NavMap from_msg | ( | const NavMap & | msg, |
| std_msgs::msg::Header & | header ) |
| navmap::NavMap from_msg | ( | const navmap_ros_interfaces::msg::NavMap & | msg | ) |
Backward-compatible overload (ignores message header).
| navmap::NavMap from_msg | ( | const navmap_ros_interfaces::msg::NavMap & | msg, |
| std_msgs::msg::Header & | header ) |
Reconstruct a core navmap::NavMap from the ROS transport message.
| [in] | msg | Input navmap_ros_interfaces::msg::NavMap message. |
| [out] | header | Header extracted from the message. |
msg.| std::runtime_error | If the message describes inconsistent geometry or layer sizes. |
| void from_msg | ( | const navmap_ros_interfaces::msg::NavMapLayer & | msg, |
| navmap::NavMap & | nm ) |
Backward-compatible overload (ignores message header).
| void from_msg | ( | const navmap_ros_interfaces::msg::NavMapLayer & | msg, |
| navmap::NavMap & | nm, | ||
| std_msgs::msg::Header & | header ) |
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.
| [in] | msg | Input NavMapLayer message. |
| [in,out] | nm | Destination NavMap (must already have navcels sized correctly). |
| [out] | header | Header extracted from the message. |
| std::runtime_error | If the message belongs to another geometry, a sparse update does not match its layer, or the type is unsupported. |
| navmap::NavMap from_occupancy_grid | ( | const nav_msgs::msg::OccupancyGrid & | grid | ) |
Backward-compatible overload (ignores grid header).
| navmap::NavMap from_occupancy_grid | ( | const nav_msgs::msg::OccupancyGrid & | grid, |
| std_msgs::msg::Header & | header ) |
Build a navmap::NavMap from a nav_msgs::msg::OccupancyGrid using a regular triangular surface with shared vertices.
| [in] | grid | Input ROS OccupancyGrid (row-major, width×height, resolution and origin). |
| [out] | header | Header to assign to the resulting message. |
| navmap::NavMap 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.
| [in] | pc2 | Input PointCloud2 message (expects fields x, y, z). |
| [out] | out_msg | Output transport message mirroring the created NavMap. |
| [in] | params | Meshing and filtering parameters (see ::BuildParams). |
pc2 are ignored by this overload.out_msg for downstream publication or storage.| std::runtime_error | If decoding fails or meshing cannot be completed. |
| navmap::NavMap from_points | ( | const pcl::PointCloud< pcl::PointWithViewpoint > & | input_points, |
| navmap_ros_interfaces::msg::NavMap & | out_msg, | ||
| BuildParams | params ) |
Build a NavMap from a cloud with the sensor position of each point.
Same as the PointXYZ overload, on the cloud cleaned by filter_with_viewpoints().
| navmap::NavMap from_points | ( | const pcl::PointCloud< pcl::PointXYZ > & | input_points, |
| navmap_ros_interfaces::msg::NavMap & | out_msg, | ||
| BuildParams | params ) |
Build a NavMap from an unorganized point cloud (multi-level grid triangulation).
| [in] | input_points | Point set in world coordinates (pcl::PointXYZ). |
| [out] | out_msg | Output transport message mirroring the created NavMap. |
| [in] | params | Meshing and filtering parameters (see ::BuildParams). |
params.resolution. In each cell, points closer than max(min_clearance, max_dz) in z form one level. Its height at the cell centre comes from a robust plane fit of its upper face (points above a gap of max_dz / 2, e.g. a slab seen from above and below); a face whose spread around the plane exceeds max_dz is clutter and keeps a high top (an obstacle). Stacked floors give several vertices per cell.| navmap::NavMap from_regular_grid | ( | const pcl::PointCloud< pcl::PointXYZ > & | grid_points, |
| navmap_ros_interfaces::msg::NavMap & | out_msg, | ||
| BuildParams | params ) |
Build a NavMap surface from an organized (grid-shaped) PCL point cloud.
Unlike navmap_ros::from_points – which discovers connectivity by neighbor search over an otherwise-unstructured point set, a heuristic that needs either a generous params.neighbor_radius (at real cost in redundant, overlapping triangles) or leaves gaps on an evenly-sampled surface even when every cell is individually navigable – this overload takes a cloud whose grid connectivity is already known (row-major, cloud.width x cloud.height, exactly as PCL's own "organized point cloud" convention) and builds the two triangles per grid cell directly from the (i, j) indices, the same deterministic scheme navmap_ros::from_occupancy_grid already uses. No neighbor search, no possibility of a meshing-artifact gap: the only triangles skipped are ones that fail the slope filter (params.max_slope_deg) or reference a non-finite vertex, i.e. every remaining hole is a real "not navigable here" gap, not a search-radius artifact.
| [in] | grid_points | Organized point set (cloud.height must be > 1); row j, column i is at index j * cloud.width + i. |
| [out] | out_msg | Output transport message mirroring the created NavMap. |
| [in] | params | Only params.max_slope_deg and params.max_surfaces apply here; the neighbor-search/edge-length/angle fields are meaningless without a search step and are ignored. |
grid_points is not organized (height <= 1) or is smaller than 2x2. | navmap_ros_interfaces::msg::NavMapLayer to_layer_update_msg | ( | const navmap::NavMap & | nm, |
| const std::string & | layer, | ||
| const std_msgs::msg::Header & | header = std_msgs::msg::Header(), | ||
| float | max_sparse_fraction = 0.25f ) |
Layer update with only what changed since the layer's last clear_changes().
Sparse (indices + values) when few NavCels changed one by one; the full layer when the whole layer changed, nothing did, or more than max_sparse_fraction of it did. Carries the geometry id, so a receiver can reject an update for another map. Does not clear the changes.
| std::runtime_error | If the layer does not exist. |
| NavMap to_msg | ( | const navmap::NavMap & | nm | ) |
Backward-compatible overload (no header provided).
The returned message header will be default-constructed.
| navmap_ros_interfaces::msg::NavMapLayer to_msg | ( | const navmap::NavMap & | nm, |
| const std::string & | layer ) |
Backward-compatible overload (no header provided).
| navmap_ros_interfaces::msg::NavMapLayer to_msg | ( | const navmap::NavMap & | nm, |
| const std::string & | layer, | ||
| const std_msgs::msg::Header & | header ) |
Convert a single layer from a NavMap into a ROS message.
| [in] | nm | Input NavMap. |
| [in] | layer | Name of the layer to export. |
| [in] | header | Header to assign to the resulting message. |
nm.| std::runtime_error | If the layer does not exist or has an unsupported type. |
| NavMap to_msg | ( | const navmap::NavMap & | nm, |
| const std_msgs::msg::Header & | header ) |
Convert a core navmap::NavMap into its compact ROS transport message.
| [in] | nm | Core NavMap to be serialized into a ROS message. |
| [in] | header | Header to assign to the resulting message. |
nm is preserved in the resulting message.| nav_msgs::msg::OccupancyGrid to_occupancy_grid | ( | const navmap::NavMap & | nm | ) |
Backward-compatible overload.
| nav_msgs::msg::OccupancyGrid to_occupancy_grid | ( | const navmap::NavMap & | nm, |
| const std_msgs::msg::Header & | header ) |
Convert a navmap::NavMap back to nav_msgs::msg::OccupancyGrid.
| [in] | nm | Core NavMap to be rasterized as an occupancy grid. |
nm.Two paths are considered:
|
constexpr |
Known free.
|
constexpr |
The robot would touch an obstacle.
|
constexpr |
Obstacle.
|
constexpr |
Highest traversable cost.
|
constexpr |
Unknown, not observed.