pycram.world_concepts.world_object#
Attributes#
Classes#
Represents a spawned Object in the World. |
Module Contents#
- pycram.world_concepts.world_object.MJCF = None#
- pycram.world_concepts.world_object.Link#
- class pycram.world_concepts.world_object.Object(name: str, concept: typing_extensions.Type[pycrap.ontologies.PhysicalObject], path: typing_extensions.Optional[str] = None, description: typing_extensions.Optional[pycram.description.ObjectDescription] = None, pose: typing_extensions.Optional[pycram.datastructures.pose.PoseStamped] = None, world: typing_extensions.Optional[pycram.datastructures.world.World] = None, color: typing_extensions.Optional[pycram.datastructures.dataclasses.Color] = None, size: typing_extensions.Optional[typing_extensions.List[float]] = None, ignore_cached_files: bool = False, scale_mesh: typing_extensions.Optional[float] = None, mesh_transform: typing_extensions.Optional[pycram.datastructures.pose.TransformStamped] = None)#
Bases:
pycram.datastructures.world_entity.PhysicalBody,pycram.has_parameters.HasParametersRepresents a spawned Object in the World.
- tf_prospection_world_prefix: str = 'prospection/'#
The prefix for the tf frame of objects in the prospection world.
- extension_to_description_type: typing_extensions.Dict[str, typing_extensions.Type[pycram.description.ObjectDescription]]#
A dictionary that maps the file extension to the corresponding ObjectDescription type.
- ontology_concept: typing_extensions.Type[pycrap.ontologies.PhysicalObject]#
- world = None#
- property name#
The name of the object.
- path: typing_extensions.Optional[str] = None#
- cache_manager#
- local_transformer#
- original_pose#
- _current_pose#
- scale_mesh = None#
- id#
- size_ = None#
- attachments: typing_extensions.Dict[Object, pycram.world_concepts.constraints.Attachment]#
- property parts: typing_extensions.Dict[str, pycram.datastructures.world_entity.PhysicalBody]#
- property tf_frame: str#
The tf frame of the object.
- property color: typing_extensions.Union[pycram.datastructures.dataclasses.Color, typing_extensions.Dict[str, pycram.datastructures.dataclasses.Color]]#
Return the rgba_color of this object. The return is either:
- A Color object with RGBA values, this is the case if the object only has one link (this
happens for example if the object is spawned from a .obj or .stl file)
- A dict with the link name as key and the rgba_color as value. The rgba_color is given as a Color Object.
- Please keep in mind that not every link may have a rgba_color. This is dependent on the URDF from which
the object is spawned.
- Returns:
The rgba_color as Color object with RGBA values between 0 and 1 or a dict with the link name as key and the rgba_color as value.
- property size: typing_extensions.List[float]#
- get_mesh_path() typing_extensions.List[str]#
Get the path to the mesh file of the object.
- Returns:
The path(s) to the mesh file(s).
- _resolve_description(path: typing_extensions.Optional[str] = None, description: typing_extensions.Optional[pycram.description.ObjectDescription] = None) None#
Find the correct description type of the object and initialize it and set the description of this object to it.
- Parameters:
path – The path to the source file.
description – The ObjectDescription of the object.
- set_mobile_robot_pose(pose: pycram.datastructures.pose.PoseStamped) None#
Set the goal for the mobile base joints of a mobile robot to reach a target pose. This is used for example when the simulator does not support setting the pose of the robot directly (e.g. MuJoCo).
- Parameters:
pose – The target pose.
- get_mobile_base_joint_goal(pose: pycram.datastructures.pose.PoseStamped) typing_extensions.Dict[pycram.datastructures.dataclasses.VirtualJoint, float]#
Get the goal for the mobile base joints of a mobile robot to reach a target pose.
- Parameters:
pose – The target pose.
- Returns:
The goal for the mobile base joints.
- get_mobile_base_pose_difference(pose: pycram.datastructures.pose.PoseStamped) typing_extensions.Tuple[pycram.datastructures.pose.Point, float]#
Get the difference between the current and the target pose of the mobile base.
- Parameters:
pose – The target pose.
- Returns:
The difference between the current and the target pose of the mobile base.
- property joint_actuators: typing_extensions.Optional[typing_extensions.Dict[str, str]]#
The joint actuators of the robot.
- property has_actuators: bool#
True if the object has actuators, otherwise False.
- property robot_description: pycram.robot_description.RobotDescription#
The current robot description.
- get_actuator_for_joint(joint: pycrap.ontologies.Joint) typing_extensions.Optional[str]#
Get the actuator name for a joint.
- Parameters:
joint – The joint object for which to get the actuator.
- Returns:
The name of the actuator.
- get_multiple_link_positions(links: typing_extensions.List[Link]) typing_extensions.Dict[str, typing_extensions.List[float]]#
Get the positions of multiple links of the object.
- Parameters:
links – The link objects of which to get the positions.
- Returns:
The positions of the links.
- get_multiple_link_orientations(links: typing_extensions.List[Link]) typing_extensions.Dict[str, typing_extensions.List[float]]#
Get the orientations of multiple links of the object.
- Parameters:
links – The link objects of which to get the orientations.
- Returns:
The orientations of the links.
- get_multiple_link_poses(links: typing_extensions.List[Link]) typing_extensions.Dict[str, pycram.datastructures.pose.PoseStamped]#
Get the poses of multiple links of the object.
- Parameters:
links – The link objects of which to get the poses.
- Returns:
The poses of the links.
- get_poses_of_attached_objects() typing_extensions.Dict[Object, pycram.datastructures.pose.PoseStamped]#
Get the poses of the attached objects.
- Returns:
The poses of the attached objects
- get_target_poses_of_attached_objects_given_parent(pose: pycram.datastructures.pose.PoseStamped) typing_extensions.Dict[Object, pycram.datastructures.pose.PoseStamped]#
- Get the target poses of the attached objects of an object. Given the pose of the parent object. (i.e. the poses
to which the attached objects will move when the parent object is at the given pose)
- Parameters:
pose – The pose of the parent object.
- Returns:
The target poses of the attached objects
- property pose#
The current pose of the object.
- property transform#
The current transform of the object.
- property obj_type: typing_extensions.Type[pycrap.ontologies.PhysicalObject]#
- _spawn_object_and_get_id() int#
Loads an object to the given World with the given position and orientation. The rgba_color will only be used when an .obj or .stl file is given. If a .obj or .stl file is given, before spawning, an urdf file with the .obj or .stl as mesh will be created and this URDf file will be loaded instead. When spawning a URDf file a new file will be created in the cache directory, if there exists none. This new file will have resolved mesh file paths, meaning there will be no references to ROS packages instead there will be absolute file paths.
- Returns:
The unique id of the object and the path of the file that was loaded.
- _update_world_robot_and_description()#
Initialize the robot description of the object, load the description from the RobotDescriptionManager and set the robot as the current robot in the World. Also add the virtual mobile base joints to the robot.
- _update_world_environment_object()#
Initialize the environment as the current environment in the World.
- _add_virtual_move_base_joints()#
Add the virtual mobile base joints to the robot description.
- _init_joint_name_and_id_map() None#
Create a dictionary which maps the joint names to their unique ids and vice versa.
- _init_link_name_and_id_map() None#
Create a dictionary which maps the link names to their unique ids and vice versa.
- _init_links_and_update_transforms() None#
Initialize the link objects from the URDF file and creates a dictionary which maps the link names to the corresponding link objects.
- _init_joints()#
Initialize the joint objects from the URDF file and creates a dictionary which mas the joint names to the corresponding joint objects
- is_joint_virtual(name: str)#
Check if a joint is virtual.
- property virtual_joint_names#
The names of the virtual joints.
- property virtual_joints#
The virtual joints as a list.
- property has_one_link: bool#
True if the object has only one link, otherwise False.
- property link_names: typing_extensions.List[str]#
The names of the links as a list.
- property joint_names: typing_extensions.List[str]#
The names of the joints as a list.
- get_link(link_name: str) pycram.description.ObjectDescription.Link#
Return the link object with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The link object.
- get_link_pose(link_name: str) pycram.datastructures.pose.PoseStamped#
Return the pose of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The pose of the link.
- get_link_position(link_name: str) pycram.datastructures.pose.Point#
Return the position of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The position of the link.
- get_link_position_as_list(link_name: str) typing_extensions.List[float]#
Return the position of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The position of the link.
- get_link_orientation(link_name: str) pycram.datastructures.pose.Quaternion#
Return the orientation of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The orientation of the link.
- get_link_orientation_as_list(link_name: str) typing_extensions.List[float]#
Return the orientation of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The orientation of the link.
- get_link_tf_frame(link_name: str) str#
Return the tf frame of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The tf frame of the link.
- get_link_axis_aligned_bounding_box(link_name: str, transform_to_link_pose: bool = True) pycram.datastructures.dataclasses.AxisAlignedBoundingBox#
Return the axis aligned bounding box of the link with the given name.
- Parameters:
link_name – The name of the link.
transform_to_link_pose – If True, the bounding box will be transformed to fit link pose.
- Returns:
The axis aligned bounding box of the link.
- get_transform_between_links(from_link: str, to_link: str) pycram.datastructures.pose.TransformStamped#
Return the transform between two links.
- Parameters:
from_link – The name of the link from which the transform should be calculated.
to_link – The name of the link to which the transform should be calculated.
- get_link_color(link_name: str) pycram.datastructures.dataclasses.Color#
Return the color of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The color of the link.
- set_link_color(link_name: str, color: typing_extensions.List[float]) None#
Set the color of the link with the given name.
- Parameters:
link_name – The name of the link.
color – The new color of the link.
- get_link_geometry(link_name: str) typing_extensions.List[pycram.datastructures.dataclasses.VisualShape]#
Return the collision geometry of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
List of the collision geometry of the link.
- get_link_visual_geometry(link_name: str) typing_extensions.List[pycram.datastructures.dataclasses.VisualShape]#
Return the visual geometry of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The visual geometry of the link.
- get_link_transform(link_name: str) pycram.datastructures.pose.TransformStamped#
Return the transform of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The transform of the link.
- get_link_origin(link_name: str) pycram.datastructures.pose.PoseStamped#
Return the origin of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The origin of the link as a ‘Pose’.
- get_link_origin_transform(link_name: str) pycram.datastructures.pose.TransformStamped#
Return the origin transform of the link with the given name.
- Parameters:
link_name – The name of the link.
- Returns:
The origin transform of the link.
- property base_origin_shift: numpy.ndarray#
The shift between the base of the object and the origin of the object.
- Returns:
A numpy array with the shift between the base of the object and the origin of the object.
- __repr__()#
- remove() None#
Remove this object from the World it currently resides in. For the object to be removed it has to be detached from all objects it is currently attached to. Then remove this Object from the simulation/world.
- reset(remove_saved_states=False) None#
Reset the Object to the state it was first spawned in. All attached objects will be detached, all joints will be set to the default position of 0 and the object will be set to the position and orientation in which it was spawned.
- Parameters:
remove_saved_states – If True the saved states will be removed.
- reset_all_joints() None#
Reset all joints of the object.
- reset_all_links() None#
Reset all links of the object.
- property is_an_environment: bool#
Check if the object is of type environment.
- Returns:
True if the object is of type environment, False otherwise.
- property is_an_object: bool#
Check if the object is of type Physical Object or Generic Object.
- Returns:
True if the object is of type PhysicalObject , False otherwise.
- property is_a_robot: bool#
Check if the object is a robot. TODO: Check if this is a the correct filter :return: True if the object is a robot, False otherwise.
- merge(other: Object, name: typing_extensions.Optional[str] = None, pose: typing_extensions.Optional[pycram.datastructures.pose.PoseStamped] = None, new_description_file: typing_extensions.Optional[str] = None) Object#
Merge the object with another object. This is done by merging the descriptions of the objects, removing the original objects creating a new merged object.
- Parameters:
other – The object to merge with.
name – The name of the merged object.
pose – The pose of the merged object.
new_description_file – The new description file of the merged object.
- Returns:
The merged object.
- attach(child_object: Object, parent_link: typing_extensions.Optional[str] = None, child_link: typing_extensions.Optional[str] = None, bidirectional: bool = True, coincide_the_objects: bool = False, parent_to_child_transform: typing_extensions.Optional[pycram.datastructures.pose.TransformStamped] = None) None#
Attach another object to this object. This is done by saving the transformation between the given link, if there is one, and the base pose of the other object. Additionally, the name of the link, to which the object is attached, will be saved. Furthermore, a simulator constraint will be created so the attachment also works while simulation. Loose attachments means that the attachment will only be one-directional. For example, if this object moves the other, attached, object will also move but not the other way around.
- Parameters:
child_object – The other object that should be attached.
parent_link – The link name of this object.
child_link – The link name of the other object.
bidirectional – If the attachment should be a loose attachment.
coincide_the_objects – If True the object frames will be coincided.
parent_to_child_transform – The transform from the parent to the child object.
- detach(child_object: Object) None#
Detache another object from this object. This is done by deleting the attachment from the attachments dictionary of both objects and deleting the constraint of the simulator. Afterward the detachment event of the corresponding World will be fired.
- Parameters:
child_object – The object which should be detached
- detach_all() None#
Detach all objects attached to this object.
- get_position() pycram.datastructures.pose.Point#
Return the position of this Object as a list of xyz.
- Returns:
The current position of this object
- get_orientation() pycram.datastructures.pose.PoseStamped.orientation#
Return the orientation of this object as a list of xyzw, representing a quaternion.
- Returns:
A list of xyzw
- get_position_as_list() typing_extensions.List[float]#
Return the position of this Object as a list of xyz.
- Returns:
The current position of this object
- get_base_position_as_list() typing_extensions.List[float]#
Return the position of this Object as a list of xyz.
- Returns:
The current position of this object
- get_orientation_as_list() typing_extensions.List[float]#
Return the orientation of this object as a list of xyzw, representing a quaternion.
- Returns:
A list of xyzw
- get_pose() pycram.datastructures.pose.PoseStamped#
Return the position of this object as a list of xyz. Alias for
get_position().- Returns:
The current pose of this object
- set_pose(pose: pycram.datastructures.pose.PoseStamped, base: bool = False, set_attachments: bool = True) None#
Set the Pose of the object.
- Parameters:
pose – New Pose for the object
base – If True places the object base instead of origin at the specified position and orientation
set_attachments – Whether to set the poses of the attached objects to this object or not.
- reset_base_pose(pose: pycram.datastructures.pose.PoseStamped) bool#
- move_base_to_origin_pose() None#
Move the object such that its base will be at the current origin position. This is useful when placing objects on surfaces where you want the object base in contact with the surface.
- save_state(state_id: int, save_dir: typing_extensions.Optional[str] = None) None#
Save the state of this object by saving the state of all links and attachments.
- Parameters:
state_id – The unique id of the state.
save_dir – The directory in which to save the state.
- save_links_states(state_id: int) None#
Save the state of all links of this object.
- Parameters:
state_id – The unique id of the state.
- save_joints_states(state_id: int) None#
Save the state of all joints of this object.
- Parameters:
state_id – The unique id of the state.
- property current_state: pycram.datastructures.dataclasses.ObjectState#
The current state of this object as an ObjectState.
- set_attachments(attachments: typing_extensions.Dict[Object, pycram.world_concepts.constraints.Attachment]) None#
Set the attachments of this object to the given attachments.
- Parameters:
attachments – A dictionary with the object as key and the attachment as value.
- detach_objects_not_in_attachments(attachments: typing_extensions.Dict[Object, pycram.world_concepts.constraints.Attachment]) None#
Detach objects that are not in the attachments list and are in the current attachments list.
- Parameters:
attachments – A dictionary with the object as key and the attachment as value.
- attach_objects_in_attachments(attachments: typing_extensions.Dict[Object, pycram.world_concepts.constraints.Attachment]) None#
Attach objects that are in the given attachments list but not in the current attachments list.
- Parameters:
attachments – A dictionary with the object as key and the attachment as value.
- mimic_attachment_with_object(attachment: pycram.world_concepts.constraints.Attachment, child_object: Object) None#
Mimic the given attachment for this and the given child objects.
- Parameters:
attachment – The attachment to mimic.
child_object – The child object.
- get_attachment_transform_with_object(attachment: pycram.world_concepts.constraints.Attachment, child_object: Object) pycram.datastructures.pose.TransformStamped#
Return the attachment transform for the given parent and child objects, taking into account the prospection world.
- Parameters:
attachment – The attachment.
child_object – The child object.
- Returns:
The attachment transform.
- property link_states: typing_extensions.Dict[int, pycram.datastructures.dataclasses.LinkState]#
The current state of all links of this object.
- Returns:
A dictionary with the link id as key and the current state of the link as value.
- property joint_states: typing_extensions.Dict[int, pycram.datastructures.dataclasses.JointState]#
The current state of all joints of this object.
- Returns:
A dictionary with the joint id as key and the current state of the joint as value.
- robot_virtual_move_base_joints_names()#
- remove_saved_states() None#
Remove all saved states of this object.
- remove_links_saved_states() None#
Remove all saved states of the links of this object.
- remove_joints_saved_states() None#
Remove all saved states of the joints of this object.
- _set_attached_objects_poses(already_moved_objects: typing_extensions.Optional[typing_extensions.List[Object]] = None) None#
Update the positions of all attached objects. This is done by calculating the new pose in world coordinate frame and setting the base pose of the attached objects to this new pose. After this call _set_attached_objects method for all attached objects.
- Parameters:
already_moved_objects – A list of Objects that were already moved, these will be excluded to prevent loops in the update.
- set_position(position: typing_extensions.Union[pycram.datastructures.pose.PoseStamped, pycram.datastructures.pose.Point, typing_extensions.List], base=False) None#
Set this Object to the given position, if base is true, place the bottom of the Object at the position instead of the origin in the center of the Object. The given position can either be a Pose, in this case only the position is used or a geometry_msgs.msg/Point which is the position part of a Pose.
- Parameters:
position – Target position as xyz.
base – If the bottom of the Object should be placed or the origin in the center.
- set_orientation(orientation: typing_extensions.Union[pycram.datastructures.pose.PoseStamped, pycram.datastructures.pose.Quaternion, typing_extensions.List, typing_extensions.Tuple, numpy.ndarray]) None#
Set the orientation of the Object to the given orientation. Orientation can either be a Pose, in this case only the orientation of this pose is used or a geometry_msgs.msg/Quaternion which is the orientation of a Pose.
- Parameters:
orientation – Target orientation given as a list of xyzw.
- get_joint_id(name: str) int#
Return the unique id for a joint name. As used by the world/simulator.
- Parameters:
name – The joint name
- Returns:
The unique id
- get_root_link_description() pycram.description.LinkDescription#
Return the root link of the URDF of this object.
- Returns:
The root link as defined in the URDF of this object.
- property root_link: pycram.description.ObjectDescription.Link#
The root link of this object.
- Returns:
The root link of this object.
- property tip_link: pycram.description.ObjectDescription.Link#
The tip link of this object.
- Returns:
The tip link of this object.
- get_root_link_id() int#
Return the unique id of the root link of this object.
- Returns:
The unique id of the root link of this object.
- get_link_id(link_name: str) int#
Return a unique id for a link name.
- Parameters:
link_name – The name of the link.
- Returns:
The unique id of the link.
- get_link_by_id(link_id: int) pycram.description.ObjectDescription.Link#
Return the link for a given unique link id
- Parameters:
link_id – The unique id of the link.
- Returns:
The link object.
- reset_all_joints_positions() None#
Set the current position of all joints to 0. This is useful if the joints should be reset to their default
- set_joint_position(joint_name: str, joint_position: float) None#
Set the position of the given joint to the given joint pose and updates the poses of all attached objects.
- Parameters:
joint_name – The name of the joint
joint_position – The target pose for this joint
- set_joint_positions(joint_positions: typing_extensions.Dict[str, float]) None#
- set_multiple_joint_positions(joint_positions: typing_extensions.Dict[str, float]) None#
Set the current position of multiple joints at once, this method should be preferred when setting multiple joints at once instead of running
set_joint_position()in a loop.- Parameters:
joint_positions – A dictionary with the joint names as keys and the target positions as values.
- clip_joint_positions_to_limits(joint_positions: typing_extensions.Dict[str, float]) typing_extensions.Dict[str, float]#
Clip the given joint positions to the joint limits.
- Parameters:
joint_positions – A dictionary with the joint names as keys and the target positions as values.
- Returns:
A dictionary with the joint names as keys and the clipped positions as values.
- get_joint_position(joint_name: str) float#
Return the current position of the given joint.
- Parameters:
joint_name – The name of the joint
- Returns:
The current position of the given joint
- get_joint_damping(joint_name: str) float#
Return the damping of the given joint (friction).
- Parameters:
joint_name – The name of the joint
- Returns:
The damping of the given joint
- get_joint_upper_limit(joint_name: str) float#
Return the upper limit of the given joint.
- Parameters:
joint_name – The name of the joint
- Returns:
The upper limit of the given joint
- get_joint_lower_limit(joint_name: str) float#
Return the lower limit of the given joint.
- Parameters:
joint_name – The name of the joint
- Returns:
The lower limit of the given joint
- get_joint_axis(joint_name: str) pycram.datastructures.pose.Point#
Return the axis of the given joint.
- Parameters:
joint_name – The name of the joint
- Returns:
The axis of the given joint
- get_joint_type(joint_name: str) pycram.datastructures.enums.JointType#
Return the type of the given joint.
- Parameters:
joint_name – The name of the joint
- Returns:
The type of the given joint
- get_joint_limits(joint_name: str) typing_extensions.Tuple[float, float]#
Return the lower and upper limits of the given joint.
- Parameters:
joint_name – The name of the joint
- Returns:
The lower and upper limits of the given joint
- get_joint_child_link(joint_name: str) pycram.description.ObjectDescription.Link#
Return the child link of the given joint.
- Parameters:
joint_name – The name of the joint
- Returns:
The child link of the given joint
- get_joint_parent_link(joint_name: str) pycram.description.ObjectDescription.Link#
Return the parent link of the given joint.
- Parameters:
joint_name – The name of the joint
- Returns:
The parent link of the given joint
- find_joint_above_link(link_name: str, joint_type: typing_extensions.Optional[pycram.datastructures.enums.JointType] = None) typing_extensions.Optional[str]#
Traverses the chain from ‘link’ to the URDF origin and returns the first joint that is of type ‘joint_type’. If no joint type is given, the first joint that is not FIXED is returned.
- Parameters:
link_name – AbstractLink name above which the joint should be found
joint_type – Joint type that should be searched for
- Returns:
Name of the first joint which has the given type
- get_multiple_joint_positions(joint_names: typing_extensions.List[str]) typing_extensions.Dict[str, float]#
Return the positions of multiple joints at once.
- Parameters:
joint_names – A list of joint names.
- Returns:
A dictionary with the joint names as keys and the joint positions as values.
- get_positions_of_controllable_joints() typing_extensions.Dict[str, float]#
Return a list of all controllable joints of this object.
- Returns:
A list of all controllable joints.
- get_positions_of_all_joints() typing_extensions.Dict[str, float]#
Return the positions of all joints of the object as a dictionary of joint names and joint positions.
- Returns:
A dictionary with all joints positions’.
- update_link_transforms(transform_time: typing_extensions.Optional[pycram.ros.Time] = None) None#
Update the transforms of all links of this object using time ‘transform_time’ or the current ros time.
- Parameters:
transform_time – The time to use for the transform update.
- property contact_points: pycram.datastructures.dataclasses.ContactPointsList#
Return a list of contact points of this Object with other Objects.
- Returns:
A list of all contact points with other objects
- contact_points_simulated() pycram.datastructures.dataclasses.ContactPointsList#
Return a list of all contact points between this Object and other Objects after stepping the simulation once.
- Returns:
A list of contact points between this Object and other Objects
- closest_points(max_distance: float) pycram.datastructures.dataclasses.ClosestPointsList#
Return a list of closest points between this Object and other Objects.
- Parameters:
max_distance – The maximum distance between the closest points
- Returns:
A list of closest points between this Object and other Objects
- closest_points_with_obj(other_object: Object, max_distance: float) pycram.datastructures.dataclasses.ClosestPointsList#
Return a list of closest points between this Object and another Object.
- Parameters:
other_object – The other object
max_distance – The maximum distance between the closest points
- Returns:
A list of closest points between this Object and the other Object
- set_color(rgba_color: pycram.datastructures.dataclasses.Color) None#
- get_color() typing_extensions.Union[pycram.datastructures.dataclasses.Color, typing_extensions.Dict[str, pycram.datastructures.dataclasses.Color]]#
- property links_colors: typing_extensions.Dict[str, pycram.datastructures.dataclasses.Color]#
The color of each link as a dictionary with link names as keys and RGBA colors as values.
- get_axis_aligned_bounding_box(shift_to_object_position: bool = True) pycram.datastructures.dataclasses.AxisAlignedBoundingBox#
Return the axis aligned bounding box of this object.
- Parameters:
shift_to_object_position – If True, the bounding box will be shifted to the object position.
- Returns:
The axis aligned bounding box of this object.
- get_rotated_bounding_box() pycram.datastructures.dataclasses.RotatedBoundingBox#
Return the rotated bounding box of this object.
- Returns:
The rotated bounding box of this object.
- get_convex_hull() trimesh.parent.Geometry3D#
Return the convex hull of this object.
- Returns:
The convex hull of this object.
- get_base_origin() pycram.datastructures.pose.PoseStamped#
Return the origin of the base/bottom of this object.
- Returns:
the origin of the base/bottom of this object.
- get_joint_by_id(joint_id: int) pycrap.ontologies.Joint#
Return the joint object with the given id.
- Parameters:
joint_id – The unique id of the joint.
- Returns:
The joint object.
- get_link_for_attached_objects() typing_extensions.Dict[Object, pycram.description.ObjectDescription.Link]#
Return a dictionary which maps attached object to the link of this object to which the given object is attached.
- Returns:
The link of this object to which the given object is attached.
- copy_to_prospection() Object#
Copy this object to the prospection world.
- Returns:
The copied object in the prospection world.
- copy_to_world(world: pycram.datastructures.world.World) Object#
Copy this object to the given world.
- Parameters:
world – The world to which the object should be copied.
- Returns:
The copied object in the given world.
- parent_entity() pycram.datastructures.world.World#
- Returns:
The parent of this object which is the world.
- frozen_copy() pycram.datastructures.dataclasses.FrozenObject#
Creates a copied version of this object which contains the information of this object but can not be interacted with.
- Return FrozenObject:
The copied forzen object.
- classmethod define_parameters() typing_extensions.Dict[str, typing_extensions.Any]#
Defines the parameters of Object for the HasParameter flattener. Relevant parameters for objects are only the Pose and Type.
- Returns:
A dictionary with the parameters of the object