Skip to content

Commit

Permalink
Added GUI Documentation and Fixed Some Reviewed Code
Browse files Browse the repository at this point in the history
  • Loading branch information
shantanuparab-tr committed Dec 6, 2024
1 parent 1a429bc commit 0319194
Show file tree
Hide file tree
Showing 17 changed files with 306 additions and 79 deletions.
7 changes: 3 additions & 4 deletions docs/getting_started/mobile/software_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,16 +79,15 @@ ALOHA Software Installation

.. admonition:: Important Compatibility Notice

This documentation and software correspond to **Aloha version 2.0**.
This documentation and software correspond to **Interbotix Aloha version 2.0**.
It supports features such as teleoperation, data recording, replay, and visualization.
However, it is **not compatible** with training and evaluation for **ACT** or **ACT++**.

For end-to-end training of **Aloha Stationary** and **Aloha Mobile**, stick to **Aloha 1.0**.
You can find the Aloha 1.0 documentation here: `Aloha 1.0 Documentation <https://docs.trossenrobotics.com/aloha_docs>`_
For end-to-end training of **Aloha Stationary** and **Aloha Mobile**, stick to **Interbotix Aloha 1.0**.
You can find the Aloha 1.0 documentation here: `Aloha 1.0 Documentation <https://docs.trossenrobotics.com/aloha_docs/1.0/index.html>`_

We are actively working on updates to provide full compatibility in the future.


1. Clone the Interbotix fork of ALOHA into the workspace's source directory:

.. code-block:: bash
Expand Down
5 changes: 2 additions & 3 deletions docs/getting_started/solo/hardware_setup.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
===========================
=========================
Solo ALOHA Hardware Setup
===========================
=========================

.. attention::

Expand All @@ -22,7 +22,6 @@ Video Overview
Steps
-----


#. Attach the camera mount and fix the camera securely on the Viper arm.
#. Find a stable, flat surface to place your arms. Once satisfied, secure them using `Gorilla Tape <https://a.co/d/2v591vP>`_ or G-Clamps.
#. Connect the power cables to the arms.
Expand Down
18 changes: 9 additions & 9 deletions docs/getting_started/solo/software_setup.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
===============================
=========================
Solo ALOHA Software Setup
===============================
=========================

.. note::

Expand Down Expand Up @@ -113,10 +113,10 @@ Arm Symlink Setup
We will configure udev rules to bind the arms to specific device names.
Depending on the orientation of the pair you plan to use, configure the device names accordingly as either left or right:

* ``ttyDXL_leader_left`` for the left leader arm
* ``ttyDXL_follower_left`` for the left follower arm
* ``ttyDXL_leader_right`` for the right leader arm
* ``ttyDXL_follower_right`` for the right follower arm
* ``ttyDXL_leader_left`` for the left oriented leader arm
* ``ttyDXL_follower_left`` for the follower arm
* ``ttyDXL_leader_right`` for the right oriented leader arm
* ``ttyDXL_follower_right`` for the follower arm


To set these up, do the following:
Expand All @@ -142,15 +142,15 @@ To set these up, do the following:
SUBSYSTEM=="tty", ATTRS{serial}=="<SERIAL NUMBER>", ENV{ID_MM_DEVICE_IGNORE}="1", ATTR{device/latency_timer}="1", SYMLINK+="ttyDXL_leader_left"
# ^^^^^^^^^^^^^^^ The result from the previous step
6. Repeat for the rest of the arms.
6. Repeat for the other arm.

7. To update and refresh the rules, run the following command:

.. code-block:: bash
$ sudo udevadm control --reload && sudo udevadm trigger
8. Plug all arms back into the computer and verify that you can see all devices.
8. Plug both arms back into the computer and verify that you can see all devices.
Depending on whether you configured the arms for a left or right orientation, you will see the corresponding device names:

.. code-block:: bash
Expand Down Expand Up @@ -191,7 +191,7 @@ Camera Setup

3. Click on Info for the camera, find the Serial Number, and copy it.

.. image:: images/rsviewer_serialno.png
.. image:: ../../images/rsviewer_serialno.png
:align: center

4. Put the camera serial number in the appropriate config entry at ``~/interbotix_ws/src/aloha/config/robot/aloha_solo.yaml``.
Expand Down
4 changes: 2 additions & 2 deletions docs/getting_started/stationary/software_setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -67,11 +67,11 @@ ALOHA Software Installation

.. admonition:: Important Compatibility Notice

This documentation and software correspond to **Aloha version 2.0**.
This documentation and software correspond to **Interbotix Aloha version 2.0**.
It supports features such as teleoperation, data recording, replay, and visualization.
However, it is **not compatible** with training and evaluation for **ACT** or **ACT++**.

For end-to-end training of **Aloha Stationary** and **Aloha Mobile**, stick to **Aloha 1.0**.
For end-to-end training of **Aloha Stationary** and **Aloha Mobile**, stick to **Interbotix Aloha 1.0**.
You can find the Aloha 1.0 documentation here: `Aloha 1.0 Documentation <https://docs.trossenrobotics.com/aloha_docs>`_

We are actively working on updates to provide full compatibility in the future.
Expand Down
242 changes: 242 additions & 0 deletions docs/gui.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
Trossen Aloha UI
======================

.. image:: ./images/aloha_gui.png
:alt: ALOHA GUI

Overview
--------

**Trossen Aloha UI** is a Python-based application designed for seamless and efficient robotic data collection.
It provides an intuitive GUI to manage robot configurations, perform task recordings, and streamline data collection with advanced features like camera views, task management, and progress tracking.

Pre-Installation Setup
----------------------

Before installing the application, complete the following setup:

#. Install Miniconda:
Download and install `Miniconda <https://docs.conda.io/en/latest/miniconda.html>`_ for your operating system.

#. Create a Virtual Environment:
Use Miniconda to create a virtual environment:

.. code-block:: bash
conda create -n aloha_env python=3.10 -y
conda activate aloha_env
Installation
------------

Install **Trossen Aloha UI** directly using `pip`:

.. code-block:: bash
pip install trossen_aloha_ui
Post-Installation
-----------------

After installation, run the following command to set up the application:

- Clones and installs required dependencies for `lerobot`.
- Resolves common issues with OpenCV and video encoding.
- Creates a desktop icon for launching the application.

.. code-block:: bash
post_install
Launching the Application
-------------------------

Desktop Application
^^^^^^^^^^^^^^^^^^^

After installation, a desktop shortcut named **Trossen Aloha UI** is available. Click on it to launch the application.

Command Line
^^^^^^^^^^^^

Alternatively, you can run the application directly from the terminal:

.. code-block:: bash
trossen_aloha_ui
Application Features
--------------------

#. Task Management:

- Task Names: Select predefined tasks from the dropdown menu.
- Episodes: Specify the number of episodes using the spin box. Adjust the count using the `+` and `-` buttons.

#. Recording Controls:

- Start Recording: Initiates data collection for the selected task.
- Stop Recording: Stops the current data collection session.
- Re-Record: Allows re-recording of the current episode if necessary.

#. Progress Tracking:
- A progress bar tracks the recording session in real-time, displaying completion percentage.

#. Camera Views:
- View multiple camera feeds in real-time during recording for better monitoring.

#. Configuration Management:

- Edit Robot Configuration: Modify the robot's YAML configuration for granular control.
- Edit Task Configuration: Adjust task-specific parameters via a YAML editor.

#. Quit Button:
- Use the Quit button in the menu to gracefully exit the application.

Configuration Management
========================

The **Trossen Aloha UI** application provides two primary configuration files for setup:

#. Task Configuration: Used to manage task-specific parameters like task names, episode lengths, warmup times, and more.
#. Robot Configuration: Used to define arm and camera settings, motor limits, and safety parameters.

Task Configuration
------------------

Task-specific parameters are stored in the `tasks_config.yaml` file. Below is an example configuration:

.. code-block:: yaml
tasks:
- task_name: "aloha_solo_dummy"
episode_length_s: 12
warmup_time_s: 1
reset_time_s: 5
hf_user: "TrossenRobotics"
fps: 30
push_to_hub: false
- task_name: "aloha_mobile_dummy"
episode_length_s: 15
warmup_time_s: 5
reset_time_s: 10
hf_user: "TrossenRobotics"
fps: 30
push_to_hub: false
- task_name: "aloha_stationary_dummy"
episode_length_s: 9
warmup_time_s: 5
reset_time_s: 5
hf_user: "TrossenRobotics"
fps: 30
push_to_hub: false
**Key Fields**

- **task_name**: A unique identifier for the task. Ensure no duplicate task names exist.
- **episode_length_s**: Duration of each episode in seconds.
- **warmup_time_s**: Time in seconds for the system to warm up before starting the episode.
- **reset_time_s**: Time in seconds for the system to reset after each episode.
- **hf_user**: Your Hugging Face username to associate with the dataset.
- **fps**: Frames per second for recording data.
- **push_to_hub**: Set to `true` to upload datasets automatically to Hugging Face Hub. Ensure Hugging Face authentication is set up if this is enabled.

Hugging Face Authentication
^^^^^^^^^^^^^^^^^^^^^^^^^^^

To enable dataset uploads to the Hugging Face Hub, set up authentication using the following guide:
`Hugging Face Authentication Guide <https://huggingface.co/docs/huggingface_hub/en/quick-start#authentication>`_

Robot Configuration
--------------------

The robot's settings are defined in a YAML file (e.g., `aloha_solo.yaml`).
Below is a simplified version of a robot configuration file:

.. code-block:: yaml
:emphasize-lines: 5,10,21,32,38
_target_: lerobot.common.robot_devices.robots.manipulator.ManipulatorRobot
robot_type: aloha
calibration_dir: trossen_aloha_ui/configs/calibration/aloha_default
max_relative_target: null # Set to null for more precise control once comfortable
leader_arms:
right:
_target_: lerobot.common.robot_devices.motors.dynamixel.DynamixelMotorsBus
port: /dev/ttyDXL_leader_right
motors:
waist: [1, xm430-w350]
shoulder: [2, xm430-w350]
elbow: [4, xm430-w350]
wrist_rotate: [8, xl430-w250]
gripper: [9, xc430-w150]
follower_arms:
right:
_target_: lerobot.common.robot_devices.motors.dynamixel.DynamixelMotorsBus
port: /dev/ttyDXL_follower_right
motors:
waist: [1, xm540-w270]
shoulder: [2, xm540-w270]
elbow: [4, xm540-w270]
wrist_rotate: [8, xm430-w350]
gripper: [9, xm430-w350]
cameras:
cam_right_wrist:
_target_: lerobot.common.robot_devices.cameras.intelrealsense.IntelRealSenseCamera
serial_number: 218622272670
fps: 30
width: 640
height: 480
cam_top:
_target_: lerobot.common.robot_devices.cameras.intelrealsense.IntelRealSenseCamera
serial_number: 128422271347
fps: 30
width: 640
height: 480
**Key Fields**

- **max_relative_target**: Limits the motion range of motors for safety. Set to `null` for precise control after gaining confidence.
- **leader_arms / follower_arms**: Specifies motor configurations for both leader and follower arms, including ports and motor models.
- **cameras**: Configures Intel RealSense cameras with serial numbers, frame rates, and resolutions.

**Steps to Configure the Robot YAML:**

#. **Set Ports for Arms**:
Update the `port` fields for `leader_arms` and `follower_arms` based on the symbolic links set for the robotic arms.

#. **Add Serial Numbers for Cameras**:
Use the Intel RealSense Viewer to obtain and add the correct serial numbers for each camera under the `cameras` section.

#. **Verify Calibration**:
Ensure the `calibration_dir` points to the appropriate calibration files.

Once the above configurations are completed, your setup is ready for teleoperation, data recording, and other tasks.

Hardware Setup
--------------

For detailed instructions on the hardware setup, please refer to the official documentation:
`Aloha Hardware Setup Guide <https://docs.trossenrobotics.com/aloha_docs/>`_

This guide provides comprehensive information, including:

- Connecting the Arms: Step-by-step guidance to assemble and connect the robotic arms.
- Serial Number Configuration: Instructions on setting up and verifying serial numbers for the arms.
- Camera Setup: Using the Intel RealSense Viewer for calibrating and positioning cameras effectively.


License
-------

This project is licensed under the **BSD-3-Clause License**.
You are free to use, modify, and distribute this software under the conditions of the BSD-3-Clause license.

See the `LICENSE <LICENSE>`_ file for full license details.
Binary file added docs/images/aloha_gui.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/images/rsviewer_serialno.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 4 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,11 @@ What's Here
* :doc:`specifications` - Specifications for the ALOHA, Mobile ALOHA and related hardware.
* :doc:`getting_started` - Guides to walk you through the process of setting up your ALOHA and Mobile ALOHA kits.
* :doc:`operation` - Guides demonstrating usage of the ALOHA platforms.
* :doc:`training` - Comprehensive guides on training models using the ALOHA platforms, covering dataset preparation and policy evaluation.
* :doc:`gui` - Guide to using the Trossen ALOHA GUI for intuitive control, data recording, and task management.
* :doc:`troubleshooting` - Small guides to walk users through possible issues that may occur when using the ALOHA kits.


Table of Contents
=================

Expand All @@ -24,4 +27,5 @@ Table of Contents
getting_started.rst
operation.rst
training.rst
gui.rst
troubleshooting.rst
1 change: 0 additions & 1 deletion docs/operation/bringup_shutdown.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@ While the ALOHA bringup is running in another terminal, open a new one and run t
$ cd ~/interbotix_ws/src/aloha/scripts/
$ python3 sleep.py -r <configuration>
.. important::

The robot argument is required to specify which ALOHA configuration to bring up.
Expand Down
Loading

0 comments on commit 0319194

Please sign in to comment.