-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add episode recording and playback guide (#14)
* Add episode recording and playback guide * note -> tip
- Loading branch information
1 parent
f6a237e
commit 2a9f1fa
Showing
2 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,4 @@ Operation | |
|
||
./operation/mobile.rst | ||
./operation/stationary.rst | ||
./operation/data_collection.rst |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
=============== | ||
Data Collection | ||
=============== | ||
|
||
Task Creation | ||
============= | ||
|
||
Task configuration can be found in the ALOHA package's aloha module under ``constants.py`` in the ``TASK_CONFIGS`` dictionary. | ||
A template task (``aloha_template``) is provided containing all possible fields and some placeholder values. | ||
Here, we will focus only on the task name, the dataset directory, the episode length, and the observation cameras. | ||
|
||
.. list-table:: | ||
:align: center | ||
:widths: 25 75 | ||
:header-rows: 1 | ||
:width: 60% | ||
|
||
* - Configuration Field | ||
- Description | ||
* - Task Name | ||
- The task name should accurately describe the task that the ALOHA is performing. | ||
* - Dataset Directory | ||
- The ``dataset_dir`` field sets the directory episodes will saved to. | ||
* - Episode Length | ||
- The ``episode_len`` field sets the length of the episode in number of timesteps. | ||
* - Camera Names | ||
- The ``camera_names`` field takes in a list of strings corresponding to camera names. | ||
These camera names will be used as observation sources during dataset collection. | ||
|
||
Recording Episodes | ||
================== | ||
|
||
To record an episode, follow the steps below: | ||
|
||
#. Bring up the ALOHA control stack according to your platform | ||
|
||
* Stationary: :ref:`operation/stationary:Running ALOHA Bringup` | ||
* Mobile: :ref:`operation/mobile:Running ALOHA Bringup` | ||
|
||
#. Configure the environment and run the episode recording script as follows: | ||
|
||
.. code-block:: bash | ||
$ source /opt/ros/humble/setup.bash # configure ROS system install environment | ||
$ source ~/interbotix_ws/install/setup.bash # configure ROS workspace environment | ||
$ source /<path_to_aloha_venv>/bin/activate # configure ALOHA Python environment | ||
$ cd ~/interbotix_ws/src/aloha/scripts/ | ||
$ python3 record_episodes.py --task_name <task_name> --episode_idx <episode_idx> | ||
.. note:: | ||
|
||
The ``task_name`` argument should match one of the task names in the ``TASK_CONFIGS``, as configured in the :ref:`operation/data_collection:Task Creation` section. | ||
|
||
.. tip:: | ||
|
||
Each platform has a "dummy" task that can be used to test basic data collection and playback. | ||
For the Stationary variant, use the ``aloha_stationary_dummy`` task. | ||
For the Mobile variant, use the ``aloha_mobile_dummy`` task. | ||
|
||
An example for the Mobile variant would look like: | ||
|
||
.. code-block:: bash | ||
$ python3 record_episodes.py --task_name aloha_mobile_dummy --episode_idx 0 | ||
Episode Playback | ||
================ | ||
|
||
To play back a previously-recorded episode, follow the steps below: | ||
|
||
#. Bring up the ALOHA control stack according to your platform | ||
|
||
* Stationary: :ref:`operation/stationary:Running ALOHA Bringup` | ||
* Mobile: :ref:`operation/mobile:Running ALOHA Bringup` | ||
|
||
#. Configure the environment and run the episode playback script as follows: | ||
|
||
.. code-block:: bash | ||
$ source /opt/ros/humble/setup.bash # configure ROS system install environment | ||
$ source ~/interbotix_ws/install/setup.bash # configure ROS workspace environment | ||
$ source /<path_to_aloha_venv>/bin/activate # configure ALOHA Python environment | ||
$ cd ~/interbotix_ws/src/aloha/scripts/ | ||
$ python3 replay_episodes.py --dataset_dir </path/to/dataset> --episode_idx <episode_idx> | ||
.. tip:: | ||
|
||
An example for replaying the dummy Mobile episode recorded above would look like: | ||
|
||
.. code-block:: bash | ||
$ python3 replay_episodes.py --dataset_dir ~/aloha_data/aloha_mobile_dummy/ --episode_idx 0 |