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: 3 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ColumnLimit: 120
AlignAfterOpenBracket: AlwaysBreak
QualifierAlignment: Left
---
Language: Json
BasedOnStyle: llvm
---
BasedOnStyle: Chromium
Language: JavaScript
...
130 changes: 85 additions & 45 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,71 +1,118 @@
# AR4
# AR4 ROS 2 Software

The [Annin Robotics AR4](https://www.anninrobotics.com/) robot is a 6DOF desktop size industrial robot that is a free, open plan low cost robot. This repository contains the necessary ROS 2 packages to plan and execute motions in Gazebo sim. It provides the arm description, simulation controllers and Moveit configuration needed to command it.
The [Annin Robotics AR4](https://www.anninrobotics.com/) robot is a 6DOF desktop size industrial robot that is a free, open plan low cost robot.

<p align="center">
<img src="docs/ar4.png" width=500 />
</p>
This package is a ROS 2 software stack for the AR4 robot. It contains both the necessary packages to control the robot in real hardware and in simulation environments based on [Gazebo](https://gazebosim.org/home), [Isaac Sim](https://docs.isaacsim.omniverse.nvidia.com/latest/index.html), and [MuJoCo](https://mujoco.org/).

## Package Summary
https://github.com/user-attachments/assets/0edf4c30-70d1-4992-a5ee-e3e813877bb5

- [`ar4_gazebo`](./ar4_gazebo): Gazebo simulation for the ar4 arm.
- [`ar4_description`](./ar4_description): Contains the URDF of the arm.
- [`ar4_hardware_interface`](./ar4_hardware_interface): Contains the software required to connect the computer with the real robot.
- [`ar4_moveit_config`](./ar4_moveit_config): Contains configuration and launch files to run and command the arm.

## Package summary

These are the main packages providing launch files for the different use cases:

- [`ar4_description`](./ar4_description): Contains the platform-agnostic parts of the URDF robot description.
- [`ar4_gazebo_bringup`](./ar4_gazebo): Launch a Gazebo Sim simulation of AR4.
- [`ar4_isaac_bringup`](./ar4_gazebo): **Not yet available.** Launch an Isaac Sim simulation of AR4.
- [`ar4_mujoco_bringup`](./ar4_gazebo): **Not yet available.** Launch a MuJoCo-based simulation of AR4.
- [`ar4_realbot_bringup`](./ar4_gazebo): Launch drivers and control software for the real AR4 robot.
- [`ar4_isaac`](./ar4_isaac): Isaac simulation for the ar4 arm.

## Installation

### Prerequisites
```mermaid
graph TD
A[**ar4_moveit_config** <br> main.launch.py]
B[**ar4_common** <br> main.launch.py]
C[**ar4_description** <br> main.launch.py]
D[**ar4_gazebo_sim** <br> main.launch.py]
E[**ar4_gazebo_bringup** <br> main.launch.py]
F[**ar4_hardware_interface** <br> main.launch.py]
G[**ar4_realbot_bringup** <br> main.launch.py]

It is a requirement to have `docker engine` with the `docker compose plugin` already installed in the host machine.
A --> F
C --> F

See: [Docker Installation Guide](https://docs.docker.com/engine/install/ubuntu/)
H[**ar4_isaac_bringup** <br> main.launch.py]
I[**ar4_isaac_sim** <br> main.launch.py]

### Running the dev container
B --> H
I --> H

Build and run the container for the use case you are interested in
J[**ar4_mujoco_bringup** <br> main.launch.py]
K[**ar4_mujoco_sim** <br> main.launch.py]

#### Gazebo
```bash
./docker/run.sh -s ar4_gazebo
```
B --> J
K --> J

#### Hardware

* [Hardware Interface Instructions](ar4_hardware_interface/README.md)
A --> B

## Build the packages
C --> D
C --> A

Build the packages
B --> E
D --> E

```
colcon build
B --> G
F --> G
```

Source the built packages
## Prerequisites

```
source install/setup.bash
You need a working ROS 2 environment to be able to build and run the packages in this repository. The exact details of the environment will depend on the specific package you are trying to run (realbot, Gazebo, Isaac Sim, or MuJoCo).

To help you get started and to provide a reference environment, we provide development docker images that contain all the necessary dependencies to run the contents of this repository.

To be able to use the development docker images, you need to have `docker` and `docker-compose` installed in your host machine.

You can find the Docker installation instructions for Ubuntu [here](https://docs.docker.com/engine/install/ubuntu/).

## Running on simulated environments

The AR4 robot can be run using different simulators. The following sections describe how to launch the AR4 robot in Gazebo, Isaac Sim, and MuJoCo.

### Gazebo

To run the AR4 robot in Gazebo Sim use the `ar4_gazebo` version of the development docker image.

```bash
./docker/run.sh -s ar4_gazebo --build
```

---
See further instructions in [the Gazebo bringup package README file](ar4_gazebo_bringup/README.md)

### Launch
![Ar4 Gazebo](media/ar4_gazebo.png)

After building and sourcing the packages, run the specific launch file for your use case:
### Isaac sim

#### Gazebo
To run the AR4 robot in Isaac Sim use the `ar4_isaac` version of the development docker image.

```bash
./docker/run.sh -s ar4_isaac --build
```
ros2 launch ar4_gazebo moveit.launch.py

See further instructions in [the Isaac Sim bringup package README file](ar4_isaac/README.md)

![Ar4 Isaac](media/ar4_isaac.png)

### MuJoCo

To run the AR4 robot in MuJoCo use the `ar4_mujoco` version of the development docker image.

```bash
./docker/run.sh -s ar4_mujoco --build
```

![Ar4 Gazebo](docs/ar4.png)
See further instructions in [the MuJoCo bringup package README file](ar4_mujoco_bringup/README.md)

---
![Ar4 MuJoCo](media/ar4_mujoco.png)

### Controlling the AR4 with MoveIt

## Using on real hardware

See further instructions in [the Realbot bringup package README file](ar4_realbot_bringup/README.md)

## Controlling the AR4 with MoveIt

Comment thread
glpuga marked this conversation as resolved.
To plan and command the arm to execute a motion, this launch file will also start MoveIt automatically. Once launched, you should see RViz showing the robot visualization and the MotionPlanning panel on the left.

Expand All @@ -80,18 +127,11 @@ This will select a random position for the arm that would not cause a collision
[Random valid position video](https://github.com/user-attachments/assets/ec926968-8952-4ccf-ba63-5423e94f61cd)


#### 2. Moving end effector to a desired position
### 2. Moving end effector to a desired position
This allows you to select a goal position for the end effector, which is currently the last link in the arm as no gripper is being used. This is done by dragging and dropping where the end effector should move to.

[User selected position video](https://github.com/user-attachments/assets/04dbb11c-bca4-4c05-95ae-251d70f41931)


## Isaac sim

![Ar4 Isaac](docs/ar4_isaac.png)

See: [Isaac Sim Instructions](ar4_isaac/README.md)

## Licenses

All packages in this repository except for `ar4_description` and `ar4_hardware_interface` are distributed under a **BSD 3-Clause** License.
Expand Down
38 changes: 38 additions & 0 deletions ar4_common/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# BSD 3-Clause License
#
# Copyright 2025 Ekumen, Inc.
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
#
# 2. Redistributions in binary form must reproduce the above copyright notice,
# this list of conditions and the following disclaimer in the documentation
# and/or other materials provided with the distribution.
#
# 3. Neither the name of the copyright holder nor the names of its
# contributors may be used to endorse or promote products derived from
# this software without specific prior written permission.
#
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

cmake_minimum_required(VERSION 3.7)
project(ar4_common)

find_package(ament_cmake REQUIRED)

install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}/)

ament_package()
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,28 @@
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.


import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import ExecuteProcess
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare


def generate_launch_description():
pkg_ar4_gazebo = get_package_share_directory('ar4_gazebo')
bridge_config_file_path = os.path.join(pkg_ar4_gazebo, 'config', 'bridge.yaml')

bridge_process = ExecuteProcess(
cmd=[
'ros2',
'run',
'ros_gz_bridge',
'parameter_bridge',
'--ros-args',
'-p',
f'config_file:={bridge_config_file_path}',
],
shell=True,
output='screen',
moveit_planning_include = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
[
FindPackageShare("ar4_moveit_config"),
"launch",
"demo.launch.py",
]
)
)
)

ld = LaunchDescription()
ld.add_action(bridge_process)

return ld
return LaunchDescription(
[
moveit_planning_include,
]
)
20 changes: 20 additions & 0 deletions ar4_common/package.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
<?xml version="1.0"?>
<package format="3">
<name>ar4_common</name>
<version>0.0.1</version>
<description>Package containint launcher for HAL-independent parts of the stack</description>
<author email="santiago.mendez@creativa77.com.ar">Santiago Lopez mendez</author>
<maintainer email="steven.desvars@creativa77.com.ar">Steven Desvars</maintainer>
<maintainer email="santiago.mendez@creativa77.com.ar">Santiago Lopez mendez</maintainer>
<maintainer email="glpuga@ekumenlabs.com">Gerardo Puga</maintainer>
<license file="LICENSE">BSD-3-Clause</license>

<buildtool_depend>ament_cmake</buildtool_depend>

<exec_depend>ar4_moveit_config</exec_depend>
<exec_depend>ros2launch</exec_depend>

<export>
<build_type>ament_cmake</build_type>
</export>
</package>
1 change: 1 addition & 0 deletions ar4_description/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ install(
DIRECTORY config
launch
meshes
rviz
urdf
DESTINATION share/${PROJECT_NAME}/)

Expand Down
79 changes: 0 additions & 79 deletions ar4_description/launch/ar4.launch.py

This file was deleted.

Loading
Loading