Skip to main content

intrinsic.solutions.worlds.ObjectWorld

Extends an ObjectWorldClient with a connect method.

Inherits From: ObjectWorldClient

stub

Returns the gRPC stub.

world_id

Methods

batch_update

View source

Processes a number of world updates all at once.

Arguments

updates

The set of updates to apply.

connect

View source

create_frame

View source

Creates a new frame in the world.

Arguments

frame_name

The name of the new frame. Must be unique amongst all frames under the same object.

parent

The object or frame under which the new frame shall be created. Default is the root object.

parent_t_frame

The transform between the parent and the new frame. Default is a identity transform.

Returns

The created frame.

create_geometry_object

View source

Adds a geometry object to the world.

Arguments

object_name

The name of the newly created object.

geometry_component

Geometry information for the object to be added.

parent

The parent object the new object will be attached to.

parent_object_t_created_object

The transform between the parent object and the new object.

create_object_from_product_part

View source

Adds a product part as object to the world.

Arguments

part

The ProductPart to add.

object_name

The name of the newly created object.

parent

The parent object the new product object will be attached to.

parent_object_t_created_object

The transform between the parent object and the new product object.

delete_frame

View source

Deletes a frame.

Arguments

frame

The frame to delete.

force

Enables force deletion to remove frames including their children.

delete_object

View source

Deletes an object.

Arguments

world_object

The object to delete.

force

Enables force deletion to remove objects including their children.

disable_collisions

View source

Disables collisions between two objects.

Disables collision detection between all pairs (a, b) of entities where a is a entity of 'object_a' and selected by 'entity_filter_a' and b is an entity of 'object_b' and selected by 'entity_filter_b'.

Succeeds and has no effect if collisions were already disabled.

Args

first_object

The first object.

second_object

The second object.

first_entity_filter

Entity filter for the first object. By default all object entities will be included.

second_entity_filter

Entity filter for the second object. By default all object entities will be included.

enable_collisions

View source

Enables collisions between two objects.

Enables collision detection between all pairs (a, b) of entities where a is an entity of 'object_a' and selected by 'entity_filter_a' and b is an entity of 'object_b' and selected by 'entity_filter_b'.

Succeeds and has no effect if collisions were already enabled.

Args

first_object

The first object.

second_object

The second object.

first_entity_filter

Entity filter for the first object. By default all object entities will be included.

second_entity_filter

Entity filter for the second object. By default all object entities will be included.

get_frame

View source

Returns a frame by its reference.

This method accepts a FrameReference or the names of frame and parent object as argument. Expected uses look like:

world.get_frame(object_world_ids.FrameName('my_frame'), object_world_ids.WorldObjectName('my_object'))

world.get_frame(object_world_refs_pb2.FrameReference( by_name=object_world_refs_pb2.FrameReferenceByName( frame_name='my_frame', object_name='my_object')))

Note, if you provide an object by its resource handle, then the frame must be referenced by the frame's name.

Only in Jupyter does it also work with normal strings:

world.get_frame('my_frame', 'my_object')

Args

frame_reference

A reference to the requested frame.

object_name

The optional reference to the frames parent object.

Returns

The frame in the world.

get_kinematic_object

View source

Returns a kinematic object by its unique name.

Args

object_reference

The name of the object, a reference to the object or the name of the equipment associated with the object.

Returns

A kinematic object in the world.

Raises

ValueError

The requested object has no kinematic component and cannot be used as kinematic object.

get_object

View source

Returns an object by its unique name.

Args

object_reference

The name or reference of the object.

Returns

An object in the world as an instance of WorldObject or a subclass thereof.

get_transform

View source

Get the transform between two nodes in the world.

Args

node_a

The first transform node.

node_b

the second transform node.

Returns

The transform 'a_t_b', i.e., the pose of 'node_b' in the space of 'node_a'. 'node_a' and 'node_b' can be arbitrary nodes in the transform tree of the world and don't have to be parent and child.

get_transform_node

View source

Returns a transform node (object or frame).

Args

reference

The id of the transform node or a reference (by id or name) to the transform node.

Returns

The transform node in the world. Either a Frame or a subclass of WorldObject.

list_object_full_paths

View source

Lists the full path names of all objects from the world namespace.

Returns

A list with the fully qualified names of all objects in the world. E.g. ['robot', 'robot.gripper', 'robot.gripper.workpiece', 'workcell']

list_object_names

View source

Lists the names of all objects in the world service.

Returns

A list with the names of all objects in the world.

list_objects

View source

List all objects in the world service.

Returns

A list with all objects in the world.

register_geometry

View source

Registers geometry so that it can be referenced to create an object.

Arguments

geometry

Geometry data to be registered.

Raises

RuntimeError

if ObjectWorldClient was not configured with the geometry service client.

Returns

Opaque references corresponding to the registered geometry.

reparent_frame

View source

Re-parent an existing frame in the world to another frame or object.

Arguments

frame

The frame you want to reparent.

parent

The object or frame under which the new frame shall be moved. If parent type is WorldObject, the frame will attach to the final entity.

reparent_object

View source

Reparents an object to a new parent object.

Leaves the global pose of the reparented object unaffected (i.e., "parent_t_object" might change but "root_t_object" will not change).

If the new parent object is a kinematic object, this method attaches the child object to the parent's base object entity (also see reparent_object_to_final_entity()).

Args

child_object

The object that should be reparented.

new_parent

The new parent object.

reparent_object_to

View source

Reparents an object to a new parent object.

Leaves the global pose of the reparented object unaffected (i.e., "parent_t_object" might change but "root_t_object" will not change).

This method attaches the child object to the parent's object entity that matches the given filter.

Args

child_object

The object that should be reparented.

new_parent

The new parent object.

entity_filter

The object entity filter.

reparent_object_to_final_entity

View source

Reparents an object to the final entity of a kinematic object.

Leaves the global pose of the reparented object unaffected (i.e., "parent_t_object" might change but "root_t_object" will not change).

If a final entity of the new parent object cannot be determined uniquely, an error will be returned.

Args

child_object

The object that should be reparented.

new_parent

The new parent object, which must be a kinematic object.

reset

View source

Restores the initial world from the world service.

Overrides the current belief world.

update_frame_name

View source

Changes the name of the given frame to the given name.

Args

frame_to_update

The frame that should be updated.

new_name

The name of the new frame.

Raises

InvalidArgumentError

The new name is already used for another frame under the same object.

update_joint_application_limits

View source

Sets the joint application limits of the kinematic object to the given values.

Args

kinematic_object

The kinematic object that should be changed.

joint_limits

The new joint limits. The field JointLimits.max_effort is currently not supported and will be ignored.

update_joint_positions

View source

Sets the joint positions of the kinematic object to the given values.

Args

kinematic_object

The kinematic object that should be changed.

joint_positions

The new joint positions in radians (for revolute joints) or meters (for prismatic joints).

joint_names

Optional joint names to correspond to the given joint_positions must either be empty or match the size of the joint_positions list.

update_joint_system_limits

View source

Sets the joint system limits of the kinematic object to the given values.

Args

kinematic_object

The kinematic object that should be changed.

joint_limits

The new joint system limits. The field JointLimits.max_effort is currently not supported and will be ignored.

update_kinematic_object_cartesian_limits

View source

Sets the cartesian limits of the kinematic object to the given values.

Args

kinematic_object

The kinematic object that should be changed.

limits

The new cartesian limits.

update_kinematic_object_payload

View source

update_object_name

View source

Changes the name of the given object to the given name.

Args

object_to_update

The object that should be updated.

new_name

The new name of the object.

name_is_global_alias

If True, new_name is globally unique. If False, new_name is only unique in its namespace

Raises

InvalidArgumentError

The new name is already used for another object.

update_transform

View source

Updates the pose between two nodes.

If node_to_update is None this updates the pose between two neighboring nodes 'node_a' and 'node_b' such that the transform between the two becomes 'a_t_b'. If 'node_b' is the direct child of 'node_a', 'node_b.parent_t_this' is updated; if 'node_a' is the direct child of 'node_b', 'node_a.parent_t_this' is updated; otherwise, an error will be returned.

If node_to_update is not None this updates the pose of the given 'node_to_update' in the space of its parent (i.e., 'node_to_update.parent_t_this') such that the transform between 'node_a' and 'node_b' becomes 'a_t_b'. Returns an error if 'node_to_update' is not located on the path from 'node_a' to 'node_b'. It is valid to set 'node_a'=='node_to_update' or 'node_b'=='node_to_update'.

Args

node_a

First transform node.

node_b

The second transform node.

a_t_b

The desired transform between the two nodes 'node_a' and 'node_b'.

node_to_update

Optional transform node whose pose (between itself and its parent) shall be updated. Can be left out if 'node_a' and 'node_b' are neighbors in the transform tree, then the pose of the child node will be updated.

Raises

RpcError

Error communicating with the world service.