Skip to content

Commit 5c4a5bf

Browse files
authored
Add seq task usage example to docs (#475)
## Summary Add example of how to use sequential tasks to existing Tasks concept docs
1 parent 4fd95ba commit 5c4a5bf

1 file changed

Lines changed: 24 additions & 0 deletions

File tree

docs/pages/concepts/concept_tasks_design.rst

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,3 +107,27 @@ Usage Examples
107107
destination_bin = asset_registry.get_asset_by_name("sorting_bin")()
108108
109109
task = G1LocomanipPickAndPlaceTask(pick_object, destination_bin, galileo_scene)
110+
111+
Sequential Tasks
112+
----------------
113+
114+
Tasks can be composed sequentially to form longer horizon, more complex tasks using the ``SequentialTaskBase`` class.
115+
``SequentialTaskBase`` takes a list of ``TaskBase`` instances and automatically composes them into a single task.
116+
The order of the tasks in the list determines the order in which subtasks must be completed.
117+
118+
**Usage Example (Pick and Place Task and Close Door Task Composition)**
119+
120+
.. code-block:: python
121+
122+
pick_object = asset_registry.get_asset_by_name("mustard_bottle")()
123+
destination = ObjectReference("refrigerator_shelf", parent_asset=kitchen)
124+
pick_and_place_task = PickAndPlaceTask(pick_object, destination, kitchen)
125+
126+
openable_object = OpenableObjectReference("refrigerator", parent_asset=kitchen, openable_joint_name="fridge_door_joint")
127+
close_door_task = CloseDoorTask(openable_object, closedness_threshold=0.10)
128+
129+
sequential_task = SequentialTaskBase(subtasks=[pick_and_place_task, close_door_task])
130+
131+
**Available Examples**
132+
133+
- **PutAndCloseDoorTask**: Pick up and move an object to a destination location and then close a door (within **GR1PutAndCloseDoorEnvironment**).

0 commit comments

Comments
 (0)