Spawn objects in the workcell
Spawning refers to the process of introducing world objects into the belief world that weren't initially present in the workcell. Every solution includes definitions for one or more scene objects. These objects can either be part of the Initial World within the workcell, or they can be introduced during the execution of a process. Here are some examples of situations where objects might be spawned:
- An object arrives on a conveyor belt
- A neighboring robot places an object into the workspace
- A hopper that places a part in the workspace upon receipt of an external signal
- A human inserts a part in the workspace after being prompted by an HMI
Objects can be spawned anywhere in the workcell area. The parameters for spawning them can also randomize their orientation and position.
Add a basic spawner service
First, ensure a solution is running on a physical workcell or simulator.
-
In the services tab, select Add a service
-
Select the Basic Object Spawner from the dialog.
-
Assign an expressive name to the spawner in the new dialog window, such as
spawner. This service has no configuration.noteUpdate the service asset to the latest version if you see the some fields in the service configuration. These have been deprecated.
Configure your behavior tree to spawn objects
Add a Create Object skill
In your behavior tree, add a node with the the create_object skill from the
catalog. This is the point in your behavior tree where objects will be created
in the world specified by the input parameters. In the Inputs tab, select
your spawner service as the parameter to the Create_object constraint.
Configure the spawned objects
First, choose the object you want to spawn from your installed scene object assets. Remember, these objects can be spawned even if they're not yet present in the scene. The quantity of objects spawned is determined by the number of poses you define. For instance, if you provide ten poses, ten instances of the selected object will be created.
Configure the world within which to spawn objects
The create_object lets you choose which
world to create
objects in. For simple behavior trees, creating objects only in the belief world
might be enough. However, if objects need to interact with the
simulator (for example if we need to run a pose estimator), you'll want
to create them in the simulated world as well.
Configure random spawn positions and orientations
create_object supports various different configurations for spawning
objects with randomized positions and orientations. These are all available
using the optional randomization parameter. Once selected, you may choose
whether to randomize the position, orientation, or both of the generated
objects.
For positional randomization, you specify a bounding box around the target spawn
location where the spawned object's origin may be placed. This bounding box
describes the maximum and minimum passible positions of the spawned object's
origin. A value of zero indicates no randomization along that axis. For example,
to specify that all spawned objects should spawn with a 3 cm offset
along the X axis of the spawner, set the positional_randomization_domain to be
the values X: 0.03, Y: 0, Z: 0. For orientation randomization, we currently
only support a single randomization parameter: randomizing in any orientation.