Skip to content

Simulation

Attaching and Detaching

Object Simulation - Attach

Attaches movable objects to a given frame, if they are in range.

Name Data type Description
Inputs Frame String The frame to attach the objects to. All objects closer than their attach range are attached to this frame.
Snap Object Boolean True: Objects attached to the gripper are snapped to the tool center point. This means each offset transformation from the attaching frame to the respective object becomes zero.
False: Attached objects keep their relative transformations to the attaching frame.
Outputs -

Object Simulation - Attach by ID

Attaches all stated movable objects to a given frame, ignoring their individual attach range.

Name Data type Description
Inputs Frame String The frame to attach the objects to.
Object List List of Strings List of Object IDs, which are going to be attached to the given frame.
Outputs -

Object Simulation - Detach

Detaches all movable objects from a given frame.

Name Data type Description
Inputs Frame String The frame to detach all the attached objects from.
Outputs -

Object Simulation - Get Attached Object ID

Returns the Object ID of the first object attached to a given frame.

Name Data type Description
Inputs Frame String The frame to check for attached objects.
Outputs Found Object Boolean True, if at least one object is attached to the given frame. False otherwise.
Object ID String The Object ID of the first object attached to the frame. Empty string if no object is attached.

Object Simulation - Reattach All

Attaches all objects currently attached to one source frame to a different target frame.

Name Data type Description
Inputs Source Frame String The frame to detach all the attached objects from.
Target Frame String The frame to attach all the detached objects from the source frame.
Outputs -

Manipulation of Objects Poses

Object Simulation - Get Object Pose

Returns the pose of an object in world coordinate system.

Name Data type Description
Inputs Object ID String The Object ID of the object to get the pose for.
Outputs Pose Pose The pose of this object in world coordinate system.
Exceptions ERROR_ID_NOT_FOUND - The exception is raised if the given Object ID is not known.

Object Simulation - Move Object

Places a given object at a given pose relative to its parent frame.

Name Data type Description
Inputs Object ID String The Object ID of the object to set the pose.
Pose Pose The new pose of the object relative to its parent frame.
Outputs -
Exceptions ERROR_UNKNOWN_OBJECT - The exception is raised if the given Object ID is not known.

Object Simulation - Set Object Frame

Changes the parent frame of a given object.

Name Data type Description
Inputs Object ID String The Object ID of the object to change the parent frame.
Frame String The new parent frame of the object.
Keep World Transform Boolean True: The pose of the object in its parent frame is recalculated such that the absolute pose in world coordinate system does not change. False: The pose is not recalculated. In this case the object might jump as the pose stays constant while the parent frame changes.
Outputs -
Exceptions ERROR_UNKNOWN_OBJECT - The exception is raised if the given Object ID is not known.
ERROR_RECALCULATING_TRANSFORMATION - The exception is raised if the recalculation could not be performed, usually because the original frame has no connection to the new frame in the frame tree.

Object Simulation - Shift Object

Moves a given object relative to its current pose within its parent frame.

Name Data type Description
Inputs Object ID String The Object ID of the object to set the pose.
Pose Pose The pose of the object relative to its current pose within its parent frame.
Outputs -
Exceptions ERROR_UNKNOWN_OBJECT - The exception is raised if the given Object ID is not known.

Simulator Objects - Shift

Deprecated

This function block is deprecated and should not be used any more. Instead use the Object Simulation - Shift Object function block described above.

Moves a list of given objects relative to its current pose within its parent frame.

Name Data type Description
Inputs List of Object IDs List of Strings The Object ID of the object to set the pose.
Pose Pose The pose of the object relative to its current pose within its parent frame.
Outputs Success Boolean True if shifting all objects was successful. False otherwise

Defining, Spawning and Despawning Objects

All simulated objects created with drag&bot are defined in to steps: The first step is the model, which contains all the visual aspects of the object. The second step is the positional part, which is the pose and the parent frame of the object. By separating the model part from the object part it is possible to use the same model for several objects.

Models and objects created by function blocks are considered to be temporary. They are not saved in the scenario and are not listed in the Scenario Designer. In opposite to persistent objects they are deleted when the scenario is resetted by the function block or when the reset button in the 3D visualization is used.

Object Simulation - Define Basic Shape Model

Defines (creates or updates) a model for basic shapes, which can be used to spawn objects. Models created by functions blocks are not saved in the scenario.

Name Data type Description
Inputs Model ID String The ID of the new model.
Shape Select The shape of the new model. Available are: Cube, Cylinder Sphere
Size Float The size of the model in meters for each axis.
Color RGB Integer The color of the object for red, green and blue channel. Each value ranges from 0 to 255.
Moveable Boolean True: Specifies whether an object of this model can be moved or gripped. The attach range defines a sphere around the object frame in which the object can be gripped.
Attach Range Float The attach range defines a sphere around the object in which the object can be gripped.
Outputs -
Exceptions ERROR_INVALID_ID - The exception is raised if the given Model ID is invalid. The name must not be empty and must not contain spaces.

Object Simulation - Define CAD Shape Model

Defines (creates or updates) a model for a mesh shape, which can be used to spawn objects. Models created by functions blocks are not saved in the scenario.

Name Data type Description
Inputs Model ID String The ID of the new model.
Mesh File String The mesh file of the model located inside ~/.dnb/data/meshes, e.g. parts/part1.dae
Scale Factor Float The scale factor to scale the mesh.
Moveable Boolean True: Specifies whether an object of this model can be moved or gripped. The attach range defines a sphere around the object frame in which the object can be gripped.
Attach Range Float The attach range defines a sphere around the object in which the object can be gripped.
Outputs -
Exceptions ERROR_INVALID_ID - The exception is raised if the given Model ID is invalid. The name must not be empty and must not contain spaces.

Object Simulation - Hide/Show Object

Hides or shows an existing object.

Name Data type Description
Inputs Object ID String The Object ID of the object to hide or show.
Hide String True: The object is hided. False: The object is shown.
Outputs -
Exceptions ERROR_ID_NOT_FOUND - The exception is raised if the given Object ID is not found.

Object Simulation - Despawn Object

Removes an existing object from the scene.

Name Data type Description
Inputs Object ID String The Object ID of the object to despawn.
Outputs -
Exceptions ERROR_ID_NOT_FOUND - The exception is raised if the given Object ID is not found.

Object Simulation - Set Object Model

Changes the model of an existing object.

Name Data type Description
Inputs Object ID String The Object ID of the object to change the model.
Model ID String The new Model ID for the object.
Outputs -
Exceptions ERROR_ID_NOT_FOUND - The exception is raised if the given Object ID is not found.
ERROR_INVALID_MODEL - The exception is raised if the given Model ID is not found.

Object Simulation - Spawn Object

Creates a new object defined by a model and adds it to the scene at a specified pose. Objects spawned by functions blocks are not saved in the scenario.

Name Data type Description
Inputs Model ID String The used Model ID for the new object.
Parent Frame String The parent frame of the object.
Pose Pose The pose of the object within its parent frame.
Outputs Object ID String The autogenerated Object ID for the spawned object.
Exceptions ERROR_INVALID_MODEL - The exception is raised if the given Model ID is not found.

Scenario

Scenario - Reset and Reload

Resets the simulated robot to the initial joints and reloads the complete scenario.

Name Data type Description
Inputs -
Outputs -

Scenario - Reset Objects

Resets all movable objects to their initial state in the scenario. Deletes all temporary objects.

Name Data type Description
Inputs -
Outputs -