pycram.datastructures.dataclasses#
Attributes#
The closest point between two objects which has the same structure as ContactPoint. |
|
The list of closest points which has same structure as ContactPointsList. |
Classes#
A dataclass for storing the information of a manipulator that is used for creating a robot description for that |
|
Dataclass for storing rgba_color as an RGBA value. |
|
Enum for easy access to some common colors. |
|
Dataclass for storing an axis-aligned bounding box. |
|
Dataclass for storing an axis-aligned bounding box. |
|
Dataclass for storing a rotated bounding box. |
|
Dataclass for storing the collision callbacks which are callables that get called when there is a collision |
|
Dataclass for storing the information of a multibody which consists of a base and multiple links with joints. |
|
Abstract dataclass for storing the information of a visual shape. |
|
Dataclass for storing the information of a box visual shape |
|
Dataclass for storing the information of a sphere visual shape |
|
Dataclass for storing the information of a capsule visual shape |
|
Dataclass for storing the information of a cylinder visual shape |
|
Dataclass for storing the information of a mesh visual shape |
|
Dataclass for storing the information of a plane visual shape |
|
Abstract dataclass for storing the state of an entity (e.g. world, object, link, joint). |
|
Dataclass for storing the state of a physical body. |
|
Dataclass for storing the state of a link. |
|
Dataclass for storing the state of a joint. |
|
Dataclass for storing the state of an object. |
|
Dataclass for storing the state of the world. |
|
Dataclass for storing the information of the lateral friction. |
|
Dataclass for storing the information of a contact point between two bodies. |
|
A list of contact points. |
|
Dataclass for storing text annotations that can be displayed in the simulation. |
|
A virtual (not real) joint that is most likely used for simulation purposes. |
|
A dictionary that defines standard quaternions for different grasps and orientations. This is mainly used |
|
Dataclass for storing the names, types and axes of the virtual mobile base joints of a mobile robot. |
|
Meta data for the Multiverse Client, the simulation_name should be non-empty and unique for each simulation |
|
A dataclass to store the ray result. The ray result contains the body name that the ray intersects with and the |
|
A dataclass to store the ray result. The ray result contains the body name that the ray intersects with and the |
|
A dataclass to store all the contact data returned from Multiverse for a single object. |
|
Result of a reasoning result of knowledge source |
|
Functions#
|
Return the point as a list. |
Module Contents#
- class pycram.datastructures.dataclasses.ManipulatorData#
A dataclass for storing the information of a manipulator that is used for creating a robot description for that manipulator. A manipulator is an Arm with an end-effector that can be used to interact with the environment.
- name: str#
Name of the Manipulator.
- base_link: str#
Manipulator’s base link.
- arm_end_link: str#
Manipulator’s arm end link.
- joint_names: typing_extensions.List[str]#
List of joint names.
- home_joint_values: typing_extensions.List[float]#
List of joint values for the home position. (default position)
- gripper_name: str#
Name of the gripper at the end of the arm.
- gripper_tool_frame: str#
Name of the frame of the gripper tool.
- gripper_joint_names: typing_extensions.List[str]#
List of gripper joint names.
- closed_joint_values: typing_extensions.List[float]#
List of joint values for the gripper in the closed position.
- open_joint_values: typing_extensions.List[float]#
List of joint values for the gripper in the open position.
- opening_distance: float#
The opening distance of the gripper.
- fingers_link_names: typing_extensions.Optional[typing_extensions.List[str]] = None#
List of link names for the fingers of the gripper.
- relative_dir: str = ''#
Relative directory of the manipulator description file in the resources directory.
- gripper_cmd_topic: typing_extensions.Optional[str] = None#
Gripper command topic in ROS if it has one.
- gripper_open_cmd_value: typing_extensions.Optional[float] = None#
Grip open command value.
- gripper_close_cmd_value: typing_extensions.Optional[float] = None#
Grip close command value.
- gripper_relative_dir: typing_extensions.Optional[str] = None#
- Relative directory of the gripper description file in the resources directory if it has one and is not part of the
manipulator description file.
- pycram.datastructures.dataclasses.get_point_as_list(point: pycram.datastructures.pose.Point) typing_extensions.List[float]#
Return 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])#
Set the rgba_color from a list of RGBA values.
- Parameters:
color – The list of RGBA values
- classmethod from_rgb(rgb: typing_extensions.List[float])#
Set the rgba_color from a list of RGB values.
- Parameters:
rgb – The list of RGB values
- classmethod from_rgba(rgba: typing_extensions.List[float])#
Set the rgba_color from a list of RGBA values.
- Parameters:
rgba – The list of RGBA values
- get_rgba() typing_extensions.List[float]#
Return 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]#
Return the rgba_color as a list of RGB values.
- Returns:
The rgba_color as a list of RGB values
- class pycram.datastructures.dataclasses.Colors#
Bases:
Color,enum.EnumEnum for easy access to some common colors.
- PINK = (1, 0, 1, 1)#
- BLACK = (0, 0, 0, 1)#
- WHITE = (1, 1, 1, 1)#
- RED = (1, 0, 0, 1)#
- GREEN = (0, 1, 0, 1)#
- BLUE = (0, 0, 1, 1)#
- YELLOW = (1, 1, 0, 1)#
- CYAN = (0, 1, 1, 1)#
- MAGENTA = (1, 0, 1, 1)#
- GREY = (0.5, 0.5, 0.5, 1)#
- class pycram.datastructures.dataclasses.BoundingBox#
Dataclass for storing an axis-aligned bounding box.
An axis aligned bounding box is the cartesian product of the three closed intervals [min_x, max_x] x [min_y, max_y] x [min_z, max_z].
Depth is the distance between the min_x and max_x, and should always be the long side (excluding height). Width is the distance between the min_y and max_y, and should always be the short side (excluding height). Height is the distance between the min_z and max_z, “up” is according to how the object would stand on a table.
Set-Algebraic operations are possible by converting the bounding box to a random event.
- min_x: float#
The minimum x-coordinate of the bounding box.
- min_y: float#
The minimum y-coordinate of the bounding box.
- min_z: float#
The minimum z-coordinate of the bounding box.
- max_x: float#
The maximum x-coordinate of the bounding box.
- max_y: float#
The maximum y-coordinate of the bounding box.
- max_z: float#
The maximum z-coordinate of the bounding box.
- x_variable#
The x variable for the random-events interface.
- y_variable#
The y variable for the random-events interface.
- z_variable#
The z variable for the random-events interface.
- __hash__()#
- property x_interval: random_events.interval.SimpleInterval#
- Returns:
The x interval of the bounding box.
- property y_interval: random_events.interval.SimpleInterval#
- Returns:
The y interval of the bounding box.
- property z_interval: random_events.interval.SimpleInterval#
- Returns:
The z interval of the bounding box.
- property simple_event: random_events.product_algebra.SimpleEvent#
- Returns:
The bounding box as a random event.
- classmethod from_simple_event(simple_event: random_events.product_algebra.SimpleEvent)#
Create a list of bounding boxes from a simple random event.
- Parameters:
simple_event – The random event.
- Returns:
The list of bounding boxes.
- classmethod from_event(event: random_events.product_algebra.Event) typing_extensions.List[typing_extensions.Self]#
Create a list of bounding boxes from a random event.
- Parameters:
event – The random event.
- Returns:
The list of bounding boxes.
- intersection_with(other: BoundingBox) typing_extensions.Optional[BoundingBox]#
Compute the intersection of two bounding boxes.
- Parameters:
other – The other bounding box.
- Returns:
The intersection of the two bounding boxes or None if they do not intersect.
- contains(x: float, y: float, z: float)#
Check if the bounding box contains a point.
- Parameters:
x – The x-coordinate of the point.
y – The y-coordinate of the point.
z – The z-coordinate of the point.
- Returns:
True if the bounding box contains the point, False otherwise.
- contains_box(other: BoundingBox)#
Check if the bounding box contains another bounding box.
- Parameters:
other – The other bounding box.
- Returns:
True if the bounding box contains the other bounding box, False otherwise.
- classmethod merge_multiple_bounding_boxes_into_mesh(bounding_boxes: typing_extensions.List[BoundingBox], save_mesh_to: typing_extensions.Optional[str] = None, use_random_events: bool = True, plot: bool = False) trimesh.Trimesh#
Merge multiple axis-aligned bounding boxes into a single mesh.
- Parameters:
bounding_boxes – The list of axis-aligned bounding boxes.
save_mesh_to – The file path to save the mesh to.
use_random_events – If True, use random events to compute the new shape, otherwise use pyvista.
plot – If True, plot the mesh.
- Returns:
The mesh of the merged bounding boxes.
- property transform: pycram.datastructures.pose.TransformStamped#
- Abstractmethod:
Get the transformation of the bounding box.
- extents() numpy.ndarray#
- Returns:
The size of the bounding box in each dimension.
- static get_mesh_from_boxes(boxes: typing_extensions.List[BoundingBox]) trimesh.Trimesh#
Get the mesh from the boxes
- Parameters:
boxes – The list of boxes
- Returns:
The mesh.
- property as_mesh: trimesh.Trimesh#
- Returns:
The mesh of the bounding box.
- static get_mesh_from_event(event: random_events.product_algebra.Event) trimesh.Trimesh#
Get the mesh from the event.
- Parameters:
event – The event.
- Returns:
The mesh.
- static get_box_faces() typing_extensions.List[typing_extensions.List[int]]#
- classmethod from_min_max(min_point: typing_extensions.Sequence[float], max_point: typing_extensions.Sequence[float])#
Set the axis-aligned bounding box from a minimum and maximum point.
- Parameters:
min_point – The minimum point
max_point – The maximum point
- property origin: typing_extensions.List[float]#
- property base_origin: typing_extensions.List[float]#
- property origin_point: pycram.datastructures.pose.Point#
- get_points_list() typing_extensions.List[typing_extensions.List[float]]#
- Returns:
The points of the bounding box as a list of lists of floats.
- get_points() typing_extensions.List[pycram.datastructures.pose.Point]#
- Returns:
The points of the bounding box as a list of Point instances.
- 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
- get_min_point() pycram.datastructures.pose.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
- 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
- get_min() typing_extensions.List[float]#
- 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
- enlarge(min_x: float = 0.0, min_y: float = 0, min_z: float = 0, max_x: float = 0.0, max_y: float = 0.0, max_z: float = 0.0)#
Enlarge the axis-aligned bounding box by a given amount in-place. :param min_x: The amount to enlarge the minimum x-coordinate :param min_y: The amount to enlarge the minimum y-coordinate :param min_z: The amount to enlarge the minimum z-coordinate :param max_x: The amount to enlarge the maximum x-coordinate :param max_y: The amount to enlarge the maximum y-coordinate :param max_z: The amount to enlarge the maximum z-coordinate
- enlarge_all(amount: float)#
Enlarge the axis-aligned bounding box in all dimensions by a given amount in-place.
- Parameters:
amount – The amount to enlarge the bounding box
- property depth: float#
- property height: float#
- property width: float#
- property dimensions: typing_extensions.List[float]#
According to the IAI conventions, found at https://ai.uni-bremen.de/wiki/3dmodeling/items 1. z is height, according to how the object would stand on a table 2. x is depth, representing the long side of the object 3. y is width, representing the remaining dimension
- static plot_3d_points(list_of_points: typing_extensions.List[numpy.ndarray])#
- class pycram.datastructures.dataclasses.AxisAlignedBoundingBox#
Bases:
BoundingBoxDataclass for storing an axis-aligned bounding box.
An axis aligned bounding box is the cartesian product of the three closed intervals [min_x, max_x] x [min_y, max_y] x [min_z, max_z].
Depth is the distance between the min_x and max_x, and should always be the long side (excluding height). Width is the distance between the min_y and max_y, and should always be the short side (excluding height). Height is the distance between the min_z and max_z, “up” is according to how the object would stand on a table.
Set-Algebraic operations are possible by converting the bounding box to a random event.
- property transform: pycram.datastructures.pose.TransformStamped#
Get the transformation of the bounding box.
- get_rotated_box(transform: pycram.datastructures.pose.TransformStamped) RotatedBoundingBox#
Apply a transformation to the axis-aligned bounding box and return the transformed axis-aligned bounding box.
- Returns:
The transformed axis-aligned bounding box
- classmethod from_origin_and_half_extents(origin: pycram.datastructures.pose.Point, half_extents: pycram.datastructures.pose.Point)#
Set the axis-aligned bounding box from the origin of the body and half the size.
- Parameters:
origin – The origin point
half_extents – The half size of the bounding box.
- classmethod from_multiple_bounding_boxes(bounding_boxes: typing_extensions.List[AxisAlignedBoundingBox]) AxisAlignedBoundingBox#
Set the axis-aligned bounding box from multiple axis-aligned bounding boxes.
- Parameters:
bounding_boxes – The list of axis-aligned bounding boxes.
- shift_by(shift: pycram.datastructures.pose.Point) AxisAlignedBoundingBox#
Shift the axis-aligned bounding box by a given shift.
- Parameters:
shift – The shift to apply
- Returns:
The shifted axis-aligned bounding box
- class pycram.datastructures.dataclasses.RotatedBoundingBox(min_x: float, min_y: float, min_z: float, max_x: float, max_y: float, max_z: float, transform: typing_extensions.Optional[pycram.datastructures.pose.TransformStamped] = None, points: typing_extensions.Optional[typing_extensions.List[pycram.datastructures.pose.Point]] = None)#
Bases:
BoundingBoxDataclass for storing a rotated bounding box.
- _transform: typing_extensions.Optional[pycram.datastructures.pose.TransformStamped] = None#
- _points: typing_extensions.Optional[typing_extensions.List[pycram.datastructures.pose.Point]] = None#
- property transform: pycram.datastructures.pose.TransformStamped#
Get the transformation of the bounding box.
- classmethod from_min_max(min_point: typing_extensions.Sequence[float], max_point: typing_extensions.Sequence[float], transform: typing_extensions.Optional[pycram.datastructures.pose.TransformStamped] = None)#
Set the rotated bounding box from a minimum, maximum point, and a transformation.
- Parameters:
min_point – The minimum point
max_point – The maximum point
transform – The transformation
- get_points() typing_extensions.List[pycram.datastructures.pose.Point]#
- Returns:
The points of the rotated bounding box.
- class pycram.datastructures.dataclasses.CollisionCallbacks#
Dataclass for storing the collision callbacks which are callables that get called when there is a collision or when a collision is no longer there.
- on_collision_cb: typing_extensions.Callable#
- no_collision_cb: typing_extensions.Optional[typing_extensions.Callable] = None#
- class pycram.datastructures.dataclasses.MultiBody#
Dataclass for storing the information of a multibody which consists of a base and multiple links with joints.
- base_visual_shape_index: int#
- base_pose: pycram.datastructures.pose.PoseStamped#
- link_visual_shape_indices: typing_extensions.List[int]#
- link_poses: typing_extensions.List[pycram.datastructures.pose.PoseStamped]#
- link_masses: typing_extensions.List[float]#
- link_inertial_frame_poses: typing_extensions.List[pycram.datastructures.pose.PoseStamped]#
- link_parent_indices: typing_extensions.List[int]#
- link_joint_types: typing_extensions.List[pycram.datastructures.enums.JointType]#
- link_joint_axis: typing_extensions.List[pycram.datastructures.pose.Point]#
- link_collision_shape_indices: typing_extensions.List[int]#
- class pycram.datastructures.dataclasses.VisualShape#
Bases:
abc.ABCAbstract dataclass for storing the information of a visual shape.
- 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) as a dictionary.
- property visual_geometry_type: pycram.datastructures.enums.Shape#
- Abstractmethod:
- Returns:
The visual geometry type of the visual shape (e.g. box, sphere) as a Shape object.
- abstract get_axis_aligned_bounding_box() AxisAlignedBoundingBox#
- Returns:
The axis-aligned bounding box of the visual shape.
- class pycram.datastructures.dataclasses.BoxVisualShape#
Bases:
VisualShapeDataclass for storing the information of a box visual shape
- 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) as a dictionary.
- property visual_geometry_type: pycram.datastructures.enums.Shape#
- Returns:
The visual geometry type of the visual shape (e.g. box, sphere) as a Shape object.
- property size: typing_extensions.List[float]#
- get_axis_aligned_bounding_box() AxisAlignedBoundingBox#
- Returns:
The axis-aligned bounding box of the box visual shape.
- class pycram.datastructures.dataclasses.SphereVisualShape#
Bases:
VisualShapeDataclass for storing the information of a sphere visual shape
- 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) as a dictionary.
- property visual_geometry_type: pycram.datastructures.enums.Shape#
- Returns:
The visual geometry type of the visual shape (e.g. box, sphere) as a Shape object.
- get_axis_aligned_bounding_box() AxisAlignedBoundingBox#
- Returns:
The axis-aligned bounding box of the sphere visual shape.
- class pycram.datastructures.dataclasses.CapsuleVisualShape#
Bases:
VisualShapeDataclass for storing the information of a capsule visual shape
- 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) as a dictionary.
- property visual_geometry_type: pycram.datastructures.enums.Shape#
- Returns:
The visual geometry type of the visual shape (e.g. box, sphere) as a Shape object.
- get_axis_aligned_bounding_box() AxisAlignedBoundingBox#
- Returns:
The axis-aligned bounding box of the capsule visual shape.
- class pycram.datastructures.dataclasses.CylinderVisualShape#
Bases:
CapsuleVisualShapeDataclass for storing the information of a cylinder visual shape
- property visual_geometry_type: pycram.datastructures.enums.Shape#
- Returns:
The visual geometry type of the visual shape (e.g. box, sphere) as a Shape object.
- class pycram.datastructures.dataclasses.MeshVisualShape#
Bases:
VisualShapeDataclass for storing the information of a mesh visual shape
- 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) as a dictionary.
- property visual_geometry_type: pycram.datastructures.enums.Shape#
- Returns:
The visual geometry type of the visual shape (e.g. box, sphere) as a Shape object.
- get_axis_aligned_bounding_box(file_path: typing_extensions.Optional[str] = None) AxisAlignedBoundingBox#
- Parameters:
file_path – An alternative file path.
- Returns:
The axis-aligned bounding box of the mesh visual shape.
- class pycram.datastructures.dataclasses.PlaneVisualShape#
Bases:
VisualShapeDataclass for storing the information of a plane visual shape
- 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) as a dictionary.
- property visual_geometry_type: pycram.datastructures.enums.Shape#
- Returns:
The visual geometry type of the visual shape (e.g. box, sphere) as a Shape object.
- pycram.datastructures.dataclasses.VisualShapeUnion#
- class pycram.datastructures.dataclasses.State#
Bases:
abc.ABCAbstract dataclass for storing the state of an entity (e.g. world, object, link, joint).
- class pycram.datastructures.dataclasses.PhysicalBodyState#
Bases:
StateDataclass for storing the state of a physical body.
- is_translating: bool#
- is_rotating: bool#
- velocity: typing_extensions.List[float]#
- acceptable_pose_error: typing_extensions.Tuple[float, float] = (0.001, 0.001)#
- acceptable_velocity_error: typing_extensions.Tuple[float, float] = (0.001, 0.001)#
- __eq__(other: PhysicalBodyState)#
- pose_is_almost_equal(other: PhysicalBodyState) bool#
Check if the pose of the object is almost equal to the pose of another object.
- Parameters:
other – The state of the other object.
- Returns:
True if the poses are almost equal, False otherwise.
- velocity_is_almost_equal(other: PhysicalBodyState) bool#
Check if the velocity of the object is almost equal to the velocity of another object.
- Parameters:
other – The state of the other object.
- Returns:
True if the velocities are almost equal, False otherwise.
- static vector_is_almost_equal(vector1: typing_extensions.List[float], vector2: typing_extensions.List[float], acceptable_error: float) bool#
Check if the vector is almost equal to another vector.
- Parameters:
vector1 – The first vector.
vector2 – The second vector.
acceptable_error – The acceptable error.
- Returns:
True if the vectors are almost equal, False otherwise.
- __copy__()#
- class pycram.datastructures.dataclasses.LinkState#
Bases:
StateDataclass for storing the state of a link.
- body_state: PhysicalBodyState#
- constraint_ids: typing_extensions.Dict[pycram.description.Link, int]#
- all_constraints_exist(other: LinkState) bool#
Check if all constraints exist in the other link state.
- Parameters:
other – The state of the other link.
- Returns:
True if all constraints exist, False otherwise.
- all_constraints_are_equal(other: LinkState) bool#
Check if all constraints are equal to the ones in the other link state.
- Parameters:
other – The state of the other link.
- Returns:
True if all constraints are equal, False otherwise.
- __copy__()#
- class pycram.datastructures.dataclasses.JointState#
Bases:
StateDataclass for storing the state of a joint.
- position: float#
- acceptable_error: float#
- __eq__(other: JointState)#
- __copy__()#
- class pycram.datastructures.dataclasses.ObjectState#
Bases:
StateDataclass for storing the state of an object.
- body_state: PhysicalBodyState#
- attachments: typing_extensions.Dict[pycram.world_concepts.world_object.Object, pycram.world_concepts.constraints.Attachment]#
- joint_states: typing_extensions.Dict[int, JointState]#
- __eq__(other: ObjectState)#
- property pose: pycram.datastructures.pose.PoseStamped#
- all_attachments_exist(other: ObjectState) bool#
Check if all attachments exist in the other object state.
- Parameters:
other – The state of the other object.
- Returns:
True if all attachments exist, False otherwise.
- all_attachments_are_equal(other: ObjectState) bool#
Check if all attachments are equal to the ones in the other object state.
- Parameters:
other – The state of the other object.
- Returns:
True if all attachments are equal, False otherwise
- __copy__()#
- class pycram.datastructures.dataclasses.WorldState#
Bases:
StateDataclass for storing the state of the world.
- object_states: typing_extensions.Dict[str, ObjectState]#
- simulator_state_id: typing_extensions.Optional[int] = None#
- __eq__(other: WorldState)#
- simulator_state_is_equal(other: WorldState) bool#
Check if the simulator state is equal to the simulator state of another world state.
- Parameters:
other – The state of the other world.
- Returns:
True if the simulator states are equal, False otherwise.
- all_objects_exist(other: WorldState) bool#
Check if all objects exist in the other world state.
- Parameters:
other – The state of the other world.
- Returns:
True if all objects exist, False otherwise.
- all_objects_states_are_equal(other: WorldState) bool#
Check if all object states are equal to the ones in the other world state.
- Parameters:
other – The state of the other world.
- Returns:
True if all object states are equal, False otherwise.
- __copy__()#
- class pycram.datastructures.dataclasses.LateralFriction#
Dataclass for storing the information of the lateral friction.
- lateral_friction: float#
- lateral_friction_direction: typing_extensions.List[float]#
- class pycram.datastructures.dataclasses.ContactPoint#
Dataclass for storing the information of a contact point between two bodies.
- position_on_body_a: typing_extensions.Optional[typing_extensions.List[float]] = None#
- position_on_body_b: typing_extensions.Optional[typing_extensions.List[float]] = None#
- normal_on_body_b: typing_extensions.Optional[typing_extensions.List[float]] = None#
- distance: typing_extensions.Optional[float] = None#
- normal_force: typing_extensions.Optional[float] = None#
- lateral_friction_1: typing_extensions.Optional[LateralFriction] = None#
- lateral_friction_2: typing_extensions.Optional[LateralFriction] = None#
- property normal: typing_extensions.List[float]#
- property bodies: typing_extensions.Tuple[pycram.datastructures.world_entity.PhysicalBody, pycram.datastructures.world_entity.PhysicalBody]#
- __str__()#
- __repr__()#
- pycram.datastructures.dataclasses.ClosestPoint#
The closest point between two objects which has the same structure as ContactPoint.
- class pycram.datastructures.dataclasses.ContactPointsList#
Bases:
listA list of contact points.
- get_bodies_that_got_removed(previous_points: ContactPointsList) typing_extensions.List[pycram.datastructures.world_entity.PhysicalBody]#
Return the bodies that are not in the current points list but were in the initial points list.
- Parameters:
previous_points – The initial points list.
- Returns:
A list of bodies that got removed.
- get_all_bodies(excluded: typing_extensions.List[pycram.datastructures.world_entity.PhysicalBody] = None) typing_extensions.List[pycram.datastructures.world_entity.PhysicalBody]#
- Returns:
A list of all involved bodies in the points.
- check_if_two_objects_are_in_contact(obj_a: pycram.world_concepts.world_object.Object, obj_b: pycram.world_concepts.world_object.Object) bool#
Check if two objects are in contact.
- Parameters:
obj_a – An instance of the Object class that represents the first object.
obj_b – An instance of the Object class that represents the second object.
- Returns:
True if the objects are in contact, False otherwise.
- static is_body_in_object(body: pycram.datastructures.world_entity.PhysicalBody, obj: pycram.world_concepts.world_object.Object) bool#
Check if the body belongs to the object.
- Parameters:
body – The body.
obj – The object.
- Returns:
True if the body belongs to the object, False otherwise.
- get_normals_of_object(obj: pycram.world_concepts.world_object.Object) typing_extensions.List[typing_extensions.List[float]]#
Get the normals of the object.
- Parameters:
obj – An instance of the Object class that represents the object.
- Returns:
A list of float vectors that represent the normals of the object.
- get_normals() typing_extensions.List[typing_extensions.List[float]]#
Get the normals of the points.
- Returns:
A list of float vectors that represent the normals of the contact points.
- get_links_in_contact_of_object(obj: pycram.world_concepts.world_object.Object) typing_extensions.List[pycram.datastructures.world_entity.PhysicalBody]#
Get the links in contact of the object.
- Parameters:
obj – An instance of the Object class that represents the object.
- Returns:
A list of Link instances that represent the links in contact of the object.
- get_points_of_object(obj: pycram.world_concepts.world_object.Object) ContactPointsList#
Get the points of the object.
- Parameters:
obj – An instance of the Object class that represents the object that the points are related to.
- Returns:
A ContactPointsList instance that represents the contact points of the object.
- get_points_of_link(link: pycram.description.Link) ContactPointsList#
Get the points of the link.
- Parameters:
link – An instance of the Link class that represents the link that the points are related to.
- Returns:
A ContactPointsList instance that represents the contact points of the link.
- get_points_of_body(body: pycram.datastructures.world_entity.PhysicalBody) ContactPointsList#
Get the points of the body.
- Parameters:
body – An instance of the PhysicalBody class that represents the body that the points are related to.
- Returns:
A ContactPointsList instance that represents the contact points of the body.
- get_objects_that_got_removed(previous_points: ContactPointsList) typing_extensions.List[pycram.world_concepts.world_object.Object]#
Return the object that is not in the current points list but was in the initial points list.
- Parameters:
previous_points – The initial points list.
- Returns:
A list of Object instances that represent the objects that got removed.
- get_new_objects(previous_points: ContactPointsList) typing_extensions.List[pycram.world_concepts.world_object.Object]#
Return the object that is not in the initial points list but is in the current points list.
- Parameters:
previous_points – The initial points list.
- Returns:
A list of Object instances that represent the new objects.
- is_object_in_the_list(obj: pycram.world_concepts.world_object.Object) bool#
Check if the object is one of the objects that have points in the list.
- Parameters:
obj – An instance of the Object class that represents the object.
- Returns:
True if the object is in the list, False otherwise.
- get_names_of_objects_that_have_points() typing_extensions.List[str]#
Return the names of the objects that have points in the list.
- Returns:
A list of strings that represent the names of the objects that have points in the list.
- get_objects_that_have_points() typing_extensions.List[pycram.world_concepts.world_object.Object]#
Return the objects that have points in the list.
- Returns:
A list of Object instances that represent the objects that have points in the list.
- __str__()#
Return str(self).
- __repr__()#
Return repr(self).
- pycram.datastructures.dataclasses.ClosestPointsList#
The list of closest points which has same structure as ContactPointsList.
- class pycram.datastructures.dataclasses.TextAnnotation#
Dataclass for storing text annotations that can be displayed in the simulation.
- text: str#
- position: typing_extensions.List[float]#
- id: int#
- size: float = 0.1#
- class pycram.datastructures.dataclasses.VirtualJoint#
A virtual (not real) joint that is most likely used for simulation purposes.
- name: str#
- axes: typing_extensions.Optional[pycram.datastructures.pose.Point] = None#
- property type#
- property is_virtual#
- __hash__()#
- class pycram.datastructures.dataclasses.Rotations#
Bases:
typing_extensions.Dict[typing_extensions.Optional[typing_extensions.Union[pycram.datastructures.enums.Grasp,bool]],typing_extensions.List[float]]A dictionary that defines standard quaternions for different grasps and orientations. This is mainly used to automatically calculate all grasp descriptions of a robot gripper for the robot description.
SIDE_ROTATIONS: The quaternions for the different approach directions (front, back, left, right) VERTICAL_ROTATIONS: The quaternions for the different vertical alignments, in case the object requires for example a top grasp HORIZONTAL_ROTATIONS: The quaternions for the different horizontal alignments, in case the gripper needs to roll 90°
- SIDE_ROTATIONS#
- VERTICAL_ROTATIONS#
- HORIZONTAL_ROTATIONS#
- class pycram.datastructures.dataclasses.VirtualMobileBaseJoints#
Dataclass for storing the names, types and axes of the virtual mobile base joints of a mobile robot.
- translation_x: typing_extensions.Optional[VirtualJoint]#
- translation_y: typing_extensions.Optional[VirtualJoint]#
- angular_z: typing_extensions.Optional[VirtualJoint]#
- property names: typing_extensions.List[str]#
Return the names of the virtual mobile base joints.
- get_types() typing_extensions.Dict[str, pycram.datastructures.enums.JointType]#
Return the joint types of the virtual mobile base joints.
- get_axes() typing_extensions.Dict[str, pycram.datastructures.pose.Point]#
Return the axes (i.e. The axis on which the joint moves) of the virtual mobile base joints.
- class pycram.datastructures.dataclasses.MultiverseMetaData#
Meta data for the Multiverse Client, the simulation_name should be non-empty and unique for each simulation
- world_name: str = 'world'#
- simulation_name: str = 'cram'#
- length_unit: str = 'm'#
- angle_unit: str = 'rad'#
- mass_unit: str = 'kg'#
- time_unit: str = 's'#
- handedness: str = 'rhs'#
- class pycram.datastructures.dataclasses.RayResult#
A dataclass to store the ray result. The ray result contains the body name that the ray intersects with and the distance from the ray origin to the intersection point.
- obj_id: int#
The object id of the body that the ray intersects with.
- link_id: int = -1#
The link id of the body that the ray intersects with, -1 if root link or None.
- _hit_fraction: typing_extensions.Optional[float] = None#
The fraction of the ray length at which the intersection point is located a range in [0, 1].
- hit_position: typing_extensions.Optional[typing_extensions.List[float]] = None#
The intersection point in cartesian world coordinates.
- hit_normal: typing_extensions.Optional[typing_extensions.List[float]] = None#
The normal at the intersection point in cartesian world coordinates.
- distance: typing_extensions.Optional[float] = None#
The distance from the ray origin to the intersection point.
- property intersected: bool#
Check if the ray intersects with a body. return: Whether the ray intersects with a body.
- property hit_fraction: typing_extensions.Optional[float]#
- update_distance(from_position: typing_extensions.List[float], to_position: typing_extensions.Optional[typing_extensions.List[float]] = None) float#
The distance from the ray origin to the intersection point.
- class pycram.datastructures.dataclasses.MultiverseRayResult#
A dataclass to store the ray result. The ray result contains the body name that the ray intersects with and the distance from the ray origin to the intersection point.
- body_name: str#
- distance: float#
- intersected() bool#
Check if the ray intersects with a body. return: Whether the ray intersects with a body.
- class pycram.datastructures.dataclasses.MultiverseContactPoint#
A dataclass to store all the contact data returned from Multiverse for a single object.
- body_1: str#
- body_2: str#
- position: typing_extensions.List[float]#
- normal: typing_extensions.List[float]#
- class pycram.datastructures.dataclasses.ReasoningResult#
Result of a reasoning result of knowledge source
- success: bool#
- reasoned_parameter: typing_extensions.Dict[str, typing_extensions.Any]#
- class pycram.datastructures.dataclasses.FrozenObject#
- name: str#
Name of this Object
- concept: typing_extensions.Type[pycrap.ontologies.PhysicalObject]#
The Concept of the Object as the PyCRAP concept
- path: typing_extensions.Optional[str] = None#
The path to the source file
- description: typing_extensions.Optional[pycram.description.ObjectDescription] = None#
The description of the object, this is a combination of links and joints
- pose: typing_extensions.Optional[pycram.datastructures.pose.PoseStamped]#
The pose at which this object is placed
- links: typing_extensions.Optional[typing_extensions.Dict[str, FrozenLink]] = None#
A dictionary with the link name as key and the link object as value
- joints: typing_extensions.Optional[typing_extensions.Dict[str, FrozenJoint]] = None#
A dictionary of all joints, with the joint name as key and the joint object as value
- class pycram.datastructures.dataclasses.FrozenLink#
- name: str#
Name of this FrozenLink
- pose: pycram.datastructures.pose.PoseStamped#
Pose of this Link in the world frame
- geometry: typing_extensions.Union[VisualShape, typing_extensions.List[VisualShape]]#
The geometry of this link
- class pycram.datastructures.dataclasses.FrozenJoint#
- name: str#
Name of this FrozenJoints
- type: pycram.datastructures.enums.JointType#
The type of this joint
- children: typing_extensions.Sequence[str]#
A sequence of the names of all children
- parent: typing_extensions.Optional[str]#
The name of the parent joint or None if there is no parent joint
- state: float#
State of the joint