pycram.datastructures.dataclasses

Module Contents

Classes

Color

Dataclass for storing rgba_color as an RGBA value.

AxisAlignedBoundingBox

Dataclass for storing an axis-aligned bounding box.

CollisionCallbacks

MultiBody

VisualShape

Helper class that provides a standard way to create an ABC using

BoxVisualShape

Helper class that provides a standard way to create an ABC using

SphereVisualShape

Helper class that provides a standard way to create an ABC using

CapsuleVisualShape

Helper class that provides a standard way to create an ABC using

CylinderVisualShape

Helper class that provides a standard way to create an ABC using

MeshVisualShape

Helper class that provides a standard way to create an ABC using

PlaneVisualShape

Helper class that provides a standard way to create an ABC using

State

Helper class that provides a standard way to create an ABC using

LinkState

Helper class that provides a standard way to create an ABC using

JointState

Helper class that provides a standard way to create an ABC using

ObjectState

Helper class that provides a standard way to create an ABC using

WorldState

Helper class that provides a standard way to create an ABC using

Functions

get_point_as_list(→ typing_extensions.List[float])

Returns the point as a list.

pycram.datastructures.dataclasses.get_point_as_list(point: pycram.datastructures.pose.Point) typing_extensions.List[float]

Returns the point as a list.

Parameters:

point – The point.

Returns:

The point as a list

class pycram.datastructures.dataclasses.Color

Dataclass for storing rgba_color as an RGBA value. The values are stored as floats between 0 and 1. The default rgba_color is white. ‘A’ stands for the opacity.

R: float = 1
G: float = 1
B: float = 1
A: float = 1
classmethod from_list(color: typing_extensions.List[float])

Sets the rgba_color from a list of RGBA values.

Parameters:

color – The list of RGBA values

classmethod from_rgb(rgb: typing_extensions.List[float])

Sets the rgba_color from a list of RGB values.

Parameters:

rgb – The list of RGB values

classmethod from_rgba(rgba: typing_extensions.List[float])

Sets the rgba_color from a list of RGBA values.

Parameters:

rgba – The list of RGBA values

get_rgba() typing_extensions.List[float]

Returns the rgba_color as a list of RGBA values.

Returns:

The rgba_color as a list of RGBA values

get_rgb() typing_extensions.List[float]

Returns the rgba_color as a list of RGB values.

Returns:

The rgba_color as a list of RGB values

class pycram.datastructures.dataclasses.AxisAlignedBoundingBox

Dataclass for storing an axis-aligned bounding box.

min_x: float
min_y: float
min_z: float
max_x: float
max_y: float
max_z: float
classmethod from_min_max(min_point: typing_extensions.List[float], max_point: typing_extensions.List[float])

Sets the axis-aligned bounding box from a minimum and maximum point.

Parameters:
  • min_point – The minimum point

  • max_point – The maximum point

get_min_max_points() typing_extensions.Tuple[pycram.datastructures.pose.Point, pycram.datastructures.pose.Point]

Returns the axis-aligned bounding box as a tuple of minimum and maximum points.

Returns:

The axis-aligned bounding box as a tuple of minimum and maximum points

get_min_point() pycram.datastructures.pose.Point

Returns the axis-aligned bounding box as a minimum point.

Returns:

The axis-aligned bounding box as a minimum point

get_max_point() pycram.datastructures.pose.Point

Returns the axis-aligned bounding box as a maximum point.

Returns:

The axis-aligned bounding box as a maximum point

get_min_max() typing_extensions.Tuple[typing_extensions.List[float], typing_extensions.List[float]]

Returns the axis-aligned bounding box as a tuple of minimum and maximum points.

Returns:

The axis-aligned bounding box as a tuple of minimum and maximum points

get_min() typing_extensions.List[float]

Returns the minimum point of the axis-aligned bounding box.

Returns:

The minimum point of the axis-aligned bounding box

get_max() typing_extensions.List[float]

Returns the maximum point of the axis-aligned bounding box.

Returns:

The maximum point of the axis-aligned bounding box

class pycram.datastructures.dataclasses.CollisionCallbacks
on_collision_cb: typing_extensions.Callable
no_collision_cb: typing_extensions.Optional[typing_extensions.Callable]
class pycram.datastructures.dataclasses.MultiBody
base_visual_shape_index: int
base_pose: pycram.datastructures.pose.Pose
class pycram.datastructures.dataclasses.VisualShape

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

abstract property visual_geometry_type: pycram.datastructures.enums.Shape

Returns the visual geometry type of the visual shape (e.g. box, sphere).

rgba_color: Color
visual_frame_position: typing_extensions.List[float]
abstract shape_data() typing_extensions.Dict[str, typing_extensions.Any]

Returns the shape data of the visual shape (e.g. half extents for a box, radius for a sphere).

class pycram.datastructures.dataclasses.BoxVisualShape

Bases: VisualShape

Helper class that provides a standard way to create an ABC using inheritance.

property visual_geometry_type: pycram.datastructures.enums.Shape

Returns the visual geometry type of the visual shape (e.g. box, sphere).

property size: typing_extensions.List[float]
half_extents: typing_extensions.List[float]
shape_data() typing_extensions.Dict[str, typing_extensions.List[float]]

Returns the shape data of the visual shape (e.g. half extents for a box, radius for a sphere).

class pycram.datastructures.dataclasses.SphereVisualShape

Bases: VisualShape

Helper class that provides a standard way to create an ABC using inheritance.

property visual_geometry_type: pycram.datastructures.enums.Shape

Returns the visual geometry type of the visual shape (e.g. box, sphere).

radius: float
shape_data() typing_extensions.Dict[str, float]

Returns the shape data of the visual shape (e.g. half extents for a box, radius for a sphere).

class pycram.datastructures.dataclasses.CapsuleVisualShape

Bases: VisualShape

Helper class that provides a standard way to create an ABC using inheritance.

property visual_geometry_type: pycram.datastructures.enums.Shape

Returns the visual geometry type of the visual shape (e.g. box, sphere).

radius: float
length: float
shape_data() typing_extensions.Dict[str, float]

Returns the shape data of the visual shape (e.g. half extents for a box, radius for a sphere).

class pycram.datastructures.dataclasses.CylinderVisualShape

Bases: CapsuleVisualShape

Helper class that provides a standard way to create an ABC using inheritance.

property visual_geometry_type: pycram.datastructures.enums.Shape

Returns the visual geometry type of the visual shape (e.g. box, sphere).

class pycram.datastructures.dataclasses.MeshVisualShape

Bases: VisualShape

Helper class that provides a standard way to create an ABC using inheritance.

property visual_geometry_type: pycram.datastructures.enums.Shape

Returns the visual geometry type of the visual shape (e.g. box, sphere).

scale: typing_extensions.List[float]
file_name: str
shape_data() typing_extensions.Dict[str, typing_extensions.Union[typing_extensions.List[float], str]]

Returns the shape data of the visual shape (e.g. half extents for a box, radius for a sphere).

class pycram.datastructures.dataclasses.PlaneVisualShape

Bases: VisualShape

Helper class that provides a standard way to create an ABC using inheritance.

property visual_geometry_type: pycram.datastructures.enums.Shape

Returns the visual geometry type of the visual shape (e.g. box, sphere).

normal: typing_extensions.List[float]
shape_data() typing_extensions.Dict[str, typing_extensions.List[float]]

Returns the shape data of the visual shape (e.g. half extents for a box, radius for a sphere).

class pycram.datastructures.dataclasses.State

Bases: abc.ABC

Helper class that provides a standard way to create an ABC using inheritance.

class pycram.datastructures.dataclasses.LinkState

Bases: State

Helper class that provides a standard way to create an ABC using inheritance.

constraint_ids: typing_extensions.Dict[pycram.description.Link, int]
class pycram.datastructures.dataclasses.JointState

Bases: State

Helper class that provides a standard way to create an ABC using inheritance.

position: float
class pycram.datastructures.dataclasses.ObjectState

Bases: State

Helper class that provides a standard way to create an ABC using inheritance.

pose: pycram.datastructures.pose.Pose
attachments: typing_extensions.Dict[pycram.world_concepts.world_object.Object, pycram.world_concepts.constraints.Attachment]
joint_states: typing_extensions.Dict[int, JointState]
class pycram.datastructures.dataclasses.WorldState

Bases: State

Helper class that provides a standard way to create an ABC using inheritance.

simulator_state_id: int
object_states: typing_extensions.Dict[str, ObjectState]