pycram.world_concepts.constraints

pycram.world_concepts.constraints#

Classes#

AbstractConstraint

Represents an abstract constraint concept, this could be used to create joints for example or any kind of constraint

Constraint

Represents a constraint between two links in the World.

Attachment

Represents an abstract constraint concept, this could be used to create joints for example or any kind of constraint

Module Contents#

class pycram.world_concepts.constraints.AbstractConstraint(parent_link: pycram.description.Link, child_link: pycram.description.Link, _type: pycram.datastructures.enums.JointType, parent_to_constraint: pycram.datastructures.pose.TransformStamped, child_to_constraint: pycram.datastructures.pose.TransformStamped)#

Represents an abstract constraint concept, this could be used to create joints for example or any kind of constraint between two links in the world.

type: pycram.datastructures.enums.JointType#
parent_to_constraint#
child_to_constraint#
_parent_to_child = None#
get_child_object_pose() pycram.datastructures.pose.PoseStamped#
Returns:

The pose of the child object.

get_child_object_pose_given_parent(pose: pycram.datastructures.pose.PoseStamped) pycram.datastructures.pose.PoseStamped#

Get the pose of the child object given the parent pose.

Parameters:

pose – The parent object pose.

Returns:

The pose of the child object.

Set the target pose of the child object to the current pose of the child object in the parent object frame.

Returns:

The target pose of the child object. (The pose of the child object in the parent object frame)

Get the target pose of the child object link given the parent link pose.

Parameters:

parent_pose – The parent link pose.

Returns:

The target pose of the child object link.

property parent_to_child_transform: pycram.datastructures.pose.TransformStamped#

Return the transform from the parent link to the child link of the constraint.

Returns:

The transform from the parent link to the child link of the constraint.

property parent_object_id: int#
Returns:

The id of the parent object of the constraint

property child_object_id: int#
Returns:

The id of the child object of the constraint

Returns:

The id of the parent link of the constraint

Returns:

The id of the child link of the constraint

property position_wrt_parent_as_list: typing_extensions.List[float]#
Returns:

The constraint frame pose with respect to the parent origin as a list

property orientation_wrt_parent_as_list: typing_extensions.List[float]#
Returns:

The constraint frame orientation with respect to the parent origin as a list

property pose_wrt_parent: pycram.datastructures.pose.PoseStamped#
Returns:

The joint frame pose with respect to the parent origin

property position_wrt_child_as_list: typing_extensions.List[float]#
Returns:

The constraint frame pose with respect to the child origin as a list

property orientation_wrt_child_as_list: typing_extensions.List[float]#
Returns:

The constraint frame orientation with respect to the child origin as a list

property pose_wrt_child: pycram.datastructures.pose.PoseStamped#
Returns:

The joint frame pose with respect to the child origin

class pycram.world_concepts.constraints.Constraint(parent_link: pycram.description.Link, child_link: pycram.description.Link, _type: pycram.datastructures.enums.JointType, axis_in_child_frame: pycram.datastructures.pose.Point, constraint_to_parent: pycram.datastructures.pose.TransformStamped, child_to_constraint: pycram.datastructures.pose.TransformStamped)#

Bases: AbstractConstraint

Represents a constraint between two links in the World.

axis: pycram.datastructures.pose.Point#
property axis_as_list: typing_extensions.List[float]#
Returns:

The axis of this constraint as a list of xyz

class pycram.world_concepts.constraints.Attachment(parent_link: pycram.description.Link, child_link: pycram.description.Link, bidirectional: bool = False, parent_to_child_transform: typing_extensions.Optional[pycram.datastructures.pose.TransformStamped] = None, constraint_id: typing_extensions.Optional[int] = None, is_inverse: bool = False)#

Bases: AbstractConstraint

Represents an abstract constraint concept, this could be used to create joints for example or any kind of constraint between two links in the world.

id = None#
bidirectional: bool = False#
_loose: bool = False#
is_inverse: bool = False#
property parent_object#
property child_object#
update_transform_and_constraint() None#

Update the transform and constraint of this attachment.

update_transform() None#

Update the transform of this attachment by calculating the transform from the parent link to the child link.

update_constraint() None#

Update the constraint of this attachment by removing the old constraint if one exists and adding a new one.

add_fixed_constraint() None#

Add a fixed constraint between the parent link and the child link.

calculate_transform() pycram.datastructures.pose.TransformStamped#

Calculate the transform from the parent link to the child link.

remove_constraint_if_exists() None#

Remove the constraint between the parent and the child links if one exists.

get_inverse() Attachment#
Returns:

A new Attachment object with the parent and child links swapped.

property loose: bool#

If true, then the child object will not move when parent moves.

__del__() None#

Remove the constraint between the parent and the child links if one exists when the attachment is deleted.

__copy__()#
__eq__(other)#
__hash__()#