pyrobosim.utils.polygon.box_to_coords

pyrobosim.utils.polygon.box_to_coords(dims: Sequence[float], origin: Sequence[float] = (0.0, 0.0), ang: float = 0.0) list[Sequence[float]]

Converts box dimensions and origin to a Shapely compatible list of coordinate tuples.

Parameters:
  • dims – The box dimensions (width, height).

  • origin – The box (x,y) origin

  • ang – The angle to rotate the box, in radians.

Returns:

A list of 2D coordinate representing the polygon.

Example:

coords = box_to_coords(dims=[2.5, 2.5], origin=[1, 2], ang=0.5)