Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion ros2/.devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ RUN apt-get update && apt-get install -y \
libfmt-dev \
libpoco-dev \
ros-humble-pinocchio \
ros-humble-rmw-cyclonedds-cpp \
# Install ros packages
python3-colcon-common-extensions \
python3-colcon-mixin \
Expand Down Expand Up @@ -66,4 +67,4 @@ mkdir -p /tmp/franka_ros2 && cd /tmp/franka_ros2 && \
cd .. && \
rm -rf /tmp/franka_ros2 && \
echo "source /opt/ros/humble/franka/setup.bash" >> ~/.bashrc && \
echo "source /opt/ros/humble/franka/setup.sh" >> ~/.profile'
echo "source /opt/ros/humble/franka/setup.sh" >> ~/.profile'
5 changes: 3 additions & 2 deletions ros2/.devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
services:
gello-ros2:
gello-ros2:
build: .
privileged: true
restart: no
Expand All @@ -15,4 +15,5 @@ services:
DISPLAY: ${DISPLAY}
QT_X11_NO_MITSH: "1"
XAUTHORITY: /tmp/.docker.xauth

RMW_IMPLEMENTATION: ${RMW_IMPLEMENTATION:-rmw_cyclonedds_cpp}
ROS_DOMAIN_ID: ${ROS_DOMAIN_ID:-0}
5 changes: 5 additions & 0 deletions ros2/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

> This changelog covers only the changes relevant to the ROS 2 implementation of GELLO.

## `ros2-v2.1.0` - 2026-04-08
- Updated the Dockerfile and Docker Compose files to support Cyclone DDS as the ROS 2 RMW.
- **Behavioral**: Cyclone DDS is now the default RMW in the devcontainer.
- Added getting started guide for Franka GELLO Duo.

## `ros2-v2.0.0` - 2026-02-16
- Published joint positions are now independent of the GELLO's joint positions on power-on.
- Added assembly offset calculation script which differs from the one in the non-ROS part of this repository.
Expand Down
9 changes: 0 additions & 9 deletions ros2/CHANGELOG.rst

This file was deleted.

139 changes: 87 additions & 52 deletions ros2/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,6 @@

This folder contains all required ROS 2 packages for using GELLO with a Franka FR3 robot.

## Packages Overview

### 1. `franka_fr3_arm_controllers`
This package provides a Joint Impedance controller for the Franka FR3. It subscribes to the GELLO joint states and sends torque commands to the robot.

#### Key Features:
- Implements a `JointImpedanceController` for controlling the robot's torques.
- Subscribes to `/gello/joint_states` topic for the GELLO joint states.

#### Launch Files:
- **`franka.launch.py`**: Launches the Franka robot ros interfaces.
- **`franka_fr3_arm_controllers.launch.py`**: Launches the Joint Impedance controller.

### 2. `franka_gello_state_publisher`
This package provides a ROS 2 node that reads input from the GELLO and publishes it as `sensor_msgs/msg/JointState` messages.

#### Key Features:
- Publishes GELLO state to the `/gello/joint_states` topic.
- Optionally sets the internal control parameters of the Dynamixel motors. This allows for [virtual springs and dampers](#virtual-springs-dampers) in the GELLO joints.

#### Launch Files:
- **`main.launch.py`**: Launches the GELLO publisher node.

### 3. `franka_gripper_manager`
This package provides a ROS 2 node for managing the gripper connected to the Franka robot. Supported grippers are either the `Franka Hand` or the `Robotiq 2F-85`. It allows sending commands to control the gripper's width and perform homing actions.

#### Key Features:
- Subscribes to `/gripper/gripper_client/target_gripper_width_percent` for gripper width commands.
- Supports homing and move actions for the gripper.

#### Launch Files:
- **`franka_gripper_client.launch.py`**: Launches the gripper manager node for the `Franka Hand`.
- **`robotiq_gripper_controller_client.launch.py`**: Launches the gripper manager node for the `Robotiq 2F-85`.

## Setup Environment

### Option 1: VS-Code Dev-Container (recommended)
Expand All @@ -59,6 +25,7 @@ If you choose not to use the Dev-Container, please refer to the [Local Setup](#o
Refer to the [Franka Robotics documentation](https://frankarobotics.github.io/docs/index.html) for installation steps and compatibility information.
- **ros2_robotiq_gripper** (if required) must be installed.
See the [ros2_robotiq_gripper GitHub repository](https://github.com/PickNikRobotics/ros2_robotiq_gripper) for installation and usage instructions.
- We recommend using Cyclone DDS as ROS 2 RMW. Refer to [the ROS 2 documentation](https://docs.ros.org/en/humble/Installation/RMW-Implementations/DDS-Implementations/Working-with-Eclipse-CycloneDDS.html) for installation instructions and detailed information.

> 💡 **Hint:**
> You can also find example installation commands for `libfranka`, `franka_ros2`, and `ros2_robotiq_gripper` in the [Dockerfile](./.devcontainer/Dockerfile) located in the `ros2/.devcontainer` directory. These commands can be copy-pasted for your local setup.
Expand All @@ -69,28 +36,41 @@ After installing the prerequisites, you may need to install additional dependenc

If you add new dependencies to your packages, remember to update the relevant `requirements.txt`, `requirements_dev.txt` or `package.xml` files and re-run the script.

## Build and Test

> ⚠️ **Important:**
> All commands for building and testing must be executed from the `ros2` directory of this repository.

### Building the project

To build the project, use the following `colcon` command with CMake arguments, required for clang-tidy:
## Getting Started - Pre-assembled Franka GELLO Single with the Franka Hand

```bash
colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCHECK_TIDY=ON
```
- Configure the `com_port` in `franka_gello_single.yaml` and `example_fr3_config_franka_hand.yaml`, and set the `robot_ip` in `example_fr3_config.yaml`. For a complete description, see the [Detailed Launch Routine](#detailed-launch-routine) section.
- Run the following commands:
```bash
# Follow the Setup Environment section. If using Option 2, substitute /workspace/ with the path to the gello_software folder
# Go to the ROS 2 workspace, build it, and source it
cd /workspace/ros2 && colcon build && source install/setup.bash
# Start the GELLO node
ros2 launch franka_gello_state_publisher main.launch.py config_file:=franka_gello_single.yaml
# Start the Franka Hand node
ros2 launch franka_gripper_manager franka_gripper_client.launch.py config_file:=example_fr3_config_franka_hand.yaml
# Hold the GELLO and place it in a comfortable position with some distance from the base pin
# Start the robot node (the robot position will sync directly to the GELLO position. Avoid moving the GELLO abruptly during synchronization)
ros2 launch franka_fr3_arm_controllers franka_fr3_arm_controllers.launch.py robot_config_file:=example_fr3_config.yaml
```

### Testing the project
## Getting Started - Pre-assembled Franka GELLO Duo with the Franka Vision and Manipulation Kit

The packages come with a set of tests, which can be executed using the following command:

```bash
colcon test
```
- Configure the `com_port` in `franka_gello_duo.yaml` and `example_fr3_duo_config_robotiq.yaml`, and set the `robot_ip` in `example_fr3_duo_config.yaml`. For a complete description, see the [Detailed Launch Routine](#detailed-launch-routine) section.
- Run the following commands:
```bash
# Follow the Setup Environment section. If using Option 2, substitute /workspace/ with the path to the gello_software folder
# Go to the ROS 2 workspace, build it, and source it
cd /workspace/ros2 && colcon build && source install/setup.bash
# Start the GELLO node
ros2 launch franka_gello_state_publisher main.launch.py config_file:=franka_gello_duo.yaml
# Start the Robotiq gripper node
ros2 launch franka_gripper_manager robotiq_gripper_controller_client.launch.py config_file:=example_fr3_duo_config_robotiq.yaml
# Hold the GELLOs and place them in a comfortable position with some distance from the base pins
# Start the robot node (the robot position will sync directly to the GELLO position. Avoid moving the GELLOs abruptly during synchronization)
ros2 launch franka_fr3_arm_controllers franka_fr3_arm_controllers.launch.py robot_config_file:=example_fr3_duo_config.yaml
```

## Getting Started
## Detailed Launch Routine and Configuration

### 1. **Run the GELLO Publisher**
#### Step 1: Determine the port IDs of your communication converters
Expand Down Expand Up @@ -252,6 +232,61 @@ The `config_file` argument is **optional**. If not provided, it defaults either
- `namespace`: ROS 2 namespace (must match the robot and the Gello state publisher).
- `com_port`: **(Robotiq only)** The `ROBOTIQ_USB_ID` can be determined by `ls /dev/serial/by-id`

## Packages Overview

### 1. `franka_fr3_arm_controllers`
This package provides a Joint Impedance controller for the Franka FR3. It subscribes to the GELLO joint states and sends torque commands to the robot.

#### Key Features:
- Implements a `JointImpedanceController` for controlling the robot's torques.
- Subscribes to `/gello/joint_states` topic for the GELLO joint states.

#### Launch Files:
- **`franka.launch.py`**: Launches the Franka robot ros interfaces.
- **`franka_fr3_arm_controllers.launch.py`**: Launches the Joint Impedance controller.

### 2. `franka_gello_state_publisher`
This package provides a ROS 2 node that reads input from the GELLO and publishes it as `sensor_msgs/msg/JointState` messages.

#### Key Features:
- Publishes GELLO state to the `/gello/joint_states` topic.
- Optionally sets the internal control parameters of the Dynamixel motors. This allows for [virtual springs and dampers](#virtual-springs-dampers) in the GELLO joints.

#### Launch Files:
- **`main.launch.py`**: Launches the GELLO publisher node.

### 3. `franka_gripper_manager`
This package provides a ROS 2 node for managing the gripper connected to the Franka robot. Supported grippers are either the `Franka Hand` or the `Robotiq 2F-85`. It allows sending commands to control the gripper's width and perform homing actions.

#### Key Features:
- Subscribes to `/gripper/gripper_client/target_gripper_width_percent` for gripper width commands.
- Supports homing and move actions for the gripper.

#### Launch Files:
- **`franka_gripper_client.launch.py`**: Launches the gripper manager node for the `Franka Hand`.
- **`robotiq_gripper_controller_client.launch.py`**: Launches the gripper manager node for the `Robotiq 2F-85`.

## Build and Test

> ⚠️ **Important:**
> All commands for building and testing must be executed from the `ros2` directory of this repository.

### Building the project

To build the project, use the following `colcon` command with CMake arguments, required for clang-tidy:

```bash
colcon build --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=ON -DCHECK_TIDY=ON
```

### Testing the project

The packages come with a set of tests, which can be executed using the following command:

```bash
colcon test
```

## Troubleshooting

### SerialException(msg.errno, "could not open port {}: {}".format(self._port, msg))
Expand Down
Loading