pyrobosim.utils.polygon.polygon_and_height_from_footprint
- pyrobosim.utils.polygon.polygon_and_height_from_footprint(footprint: dict[str, Any], pose: Pose | None = None, parent_polygon: Polygon | None = None) tuple[Polygon, float | None]
Returns a Shapely polygon and vertical (Z) height given footprint metadata. Valid footprint metadata comes from YAML files, and can include:
"type": Type of footprint. Supported geometries include:"box": Box geometry"dims": (x, y) dimensions
"circle": Circle geometry"radius": radius of circle
"polygon": Generic polygon geometry"coords": List of (x, y) coordinates
"mesh": Load geometry as 2D convex hull from mesh file"model_path": Path to folder containing the .sdf and mesh files"mesh path": Path to mesh file relative to model_path
"parent": Requiresparent_polygonargument to also be passed in"padding": Additional padding relative to the parent polygon
"offset": Offset (x, y) or (x, y, yaw) from the specified geometry above
- Parameters:
footprint – Footprint metadata from YAML file
pose – Pose with which to transform the resulting polygon
parent_polygon – Shapely polygon representing the parent geometry, if applicable
- Returns:
Shapely polygon representing the loaded polygon, plus the vertical (Z) height (which could be None if unset).