Obstacles#

class Box

A box collision object.

float x

Width of the box.

float y

Depth of the box.

float z

Height of the box.

Box(float x, float y, float z)

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.

float radius

Radius of the capsule.

float length

Length of the capsule.

Capsule(float radius, float length)

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.

std::optional<std::filesystem::path> file_path

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

std::array<double, 3> get_bounding_box_minimum()

The minimum position of the axis-aligned bounding box.

std::array<double, 3> get_bounding_box_maximum()

The maximum position of the axis-aligned bounding box.

static Convex load_from_file(const std::filesyste::path &path, std::optional<float> scale = std::nullopt)

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].

static Convex reference_studio_file(const std::filesyste::path &path, std::optional<float> scale = std::nullopt)

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.

float radius

Radius of the cylinder.

float length

Length of the cylinder.

Cylinder(float radius, float length)

Construct a cylinder with the given radius and length.

class HeightField

A height field or depth map collision object.

using Matrix = std::vector<std::vector<double>>
float x

Size along the x-axis.

float y

Size along the xyaxis.

Matrix heights

Matrix containing the heights at evenly spaced grid points.

HeightField(float x, float y, const Matrix &heights)

Construct a height field with the given data.

class Sphere

A sphere collision object.

float radius

Radius of the sphere.

Sphere(float radius)

Construct a sphere with the given radius.

class Obstacle

An environment obstacle.

using Object = std::variant<Box, Capsule, Convex, Cylinder, HeightField, Sphere>
std::string name

The name of the obstacle.

std::string color

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

Object collision

The object for collision checking.

Frame origin

The pose of the object.

bool for_visual = true

Whether this obstacle is used for visual checking.

bool for_collision = true

Whether this obstacle is used for collision checking.

float safety_margin = 0.0

An additional obstacle-specific safety margin.

Obstacle(const Box &object, const Frame &origin = Frame::Identity(), const std::string &color = "000000")
Obstacle(const Capsule &object, const Frame &origin = Frame::Identity(), const std::string &color = "000000")
Obstacle(const Convex &object, const Frame &origin = Frame::Identity(), const std::string &color = "000000")
Obstacle(const Cylinder &object, const Frame &origin = Frame::Identity(), const std::string &color = "000000")
Obstacle(const Sphere &object, const Frame &origin = Frame::Identity(), const std::string &color = "000000")
Obstacle(const std::string &name, const Box &object, const Frame &origin = Frame::Identity(), const std::string &color = "000000")
Obstacle(const std::string &name, const Capsule &object, const Frame &origin = Frame::Identity(), const std::string &color = "000000")
Obstacle(const std::string &name, const Convex &object, const Frame &origin = Frame::Identity(), const std::string &color = "000000")
Obstacle(const std::string &name, const Cylinder &object, const Frame &origin = Frame::Identity(), const std::string &color = "000000")
Obstacle(const std::string &name, const Sphere &object, const Frame &origin = Frame::Identity(), const std::string &color = "000000")