pyrobosim.utils.polygon.polygon_and_height_from_footprint

pyrobosim.utils.polygon.polygon_and_height_from_footprint(footprint, pose=None, parent_polygon=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": Requires parent_polygon argument 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 (dict) – Footprint metadata from YAML file

  • pose (pyrobosim.utils.pose.Pose) – Pose with which to transform the resulting polygon

  • parent_polygon (shapely.geometry.Polygon) – Shapely polygon representing the parent geometry, if applicable

Returns:

Shapely polygon representing the loaded polygon, plus the vertical (Z) height.

Return type:

(class:shapely.geometry.Polygon, float)