Obstacles

class Box

A box collision object.

x: float

Width of the box.

y: float

Depth of the box.

z: float

Height of the box.

__init__(x: float, y: float, z: float)

Construct a box of size x, y, z along the respective axis, corresponding to the width, depth, height of the box.

class Capsule

A capsule collision object.

radius: float

Radius of the capsule.

length: float

Length of the capsule.

__init__(radius: float, length: float)

Construct a capsule with the given radius and length. As a side note, a capsule is computationally efficient for collision checking.

class Convex

A convex mesh collision object.

file_path: Path | None

The file path of the mesh object when loaded from a file.

property bounding_box_minimum: List[float]

The minimum position of the axis-aligned bounding box.

property bounding_box_maximum: List[float]

The maximum position of the axis-aligned bounding box.

load_from_file(path: Path, scale: float = None)

Loads a mesh from a *.obj or *.stl file from the given path, and returns the convex hull of the mesh. If no scale is given, we automatically estimate the scale of the mesh to match base SI units e.g. [m].

reference_studio_file(path: Path, scale: float = None)

Create a reference to a mesh file with the given filename already uploaded to a Studio project. This is helpful to visualize objects dynamically using Studio Live.

class Cylinder

A cylinder collision object.

radius: float

Radius of the cylinder.

length: float

Length of the cylinder.

__init__(radius: float, length: float)

Construct a cylinder with the given radius and length.

class HeightField

A height field or depth map collision object.

class Matrix

Type alias for List[List[float]].

x: float

Size along the x-axis.

y: float

Size along the y-axis.

height: Matrix

Matrix containing the heights at evenly spaced grid points. The collision object will interpolate linearly between the heights, and will create a volume to zero height.

__init__(x: float, y: float, heights: Matrix)

Construct a height field with the given data.

class Sphere

A sphere collision object.

radius: float

Radius of the sphere.

__init__(radius: float)

Construct a sphere with the given radius.

Obstacle: Element

An environment obstacle.

class Object

Type alias for Box | Capsule | Convex | Cylinder | HeightField | Sphere.

name: str

The name of the obstacle.

color: str

The hex-string representation of the obstacle’s color, without the leading #.

collision: Object

The object for collision checking.

origin: Frame

The pose of the object.

for_visual: bool = True

Whether this obstacle is used for visual checking.

for_collision: bool = True

Whether this obstacle is used for collision checking.

safety_margin: float = 0.0

An additional obstacle-specific safety margin. Currently, only positive values are supported. Setting a value of -infinity disables the collision check completely.

Obstacle(object: Object, origin: Frame = Frame.Identity(), color: str = '000000')
Obstacle(name: str, object: Object, origin: Frame = Frame.Identity(), color: str = '000000')