Skip to content
Closed
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
92 changes: 61 additions & 31 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,68 +1,98 @@
# 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. This repository contains the necessary ROS 2 packages to plan and execute motions in Gazebo sim.

It provides a ROS 2 set of packages to be able to control the AR4 robot both in real hardware and
a number of different simulation environments.

<p align="center">
<img src="docs/ar4.png" width=500 />
</p>

## Package Summary

- [`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.
These are the main packages providing launch files for the different use cases:

## Installation
- [`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.

### Prerequisites

It is a requirement to have `docker engine` with the `docker compose plugin` already installed in the host machine.
```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]

See: [Docker Installation Guide](https://docs.docker.com/engine/install/ubuntu/)
A --> F
C --> F

### Running the dev container
H[**ar4_isaac_bringup** <br> main.launch.py <br> ...not yet available...]
I[**...** <br> main.launch.py]

Build and run the container for the use case you are interested in
B --> H
I --> H

#### Gazebo
```bash
./docker/run.sh -s ar4_gazebo
```
J[**ar4_mujoco_bringup** <br> main.launch.py <br> ...not yet available...]
K[**...** <br> main.launch.py]

#### Hardware
B --> J
K --> J

* [Hardware Interface Instructions](ar4_hardware_interface/README.md)

## Build the packages
A --> B

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

```
colcon build
B --> E
D --> E

B --> G
F --> G
```

Source the built packages
## Installation

```
source install/setup.bash
```
### Prerequisites

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

### Launch
See: [Docker Installation Guide](https://docs.docker.com/engine/install/ubuntu/)

After building and sourcing the packages, run the specific launch file for your use case:
### Running the dev container

Build and run the container for the use case you are interested in

#### Gazebo

Launch the docker container with the following command:

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

Then build and launch Gazebo bringup launch file:

```bash
colcon build --symlink-install --packages-up-to ar4_gazebo_bringup \
&& source install/setup.bash \
&& ros2 launch ar4_gazebo_bringup main.launch.py
```

![Ar4 Gazebo](docs/ar4.png)

---

#### Hardware

* [Hardware Interface Instructions](ar4_hardware_interface/README.md)


### Controlling the AR4 with MoveIt

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.

56 changes: 56 additions & 0 deletions ar4_description/launch/display.launch.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/usr/bin/python3

# Copyright 2024 Gerardo Puga
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.


from launch import LaunchDescription
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():
rviz_config_filepath = PathJoinSubstitution(
[
FindPackageShare('ar4_description'),
"rviz",
"display.rviz",
]
)

urdf_launch_include = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
PathJoinSubstitution(
[
FindPackageShare('urdf_launch'),
"launch",
"display.launch.py",
]
)
),
launch_arguments={
"urdf_package": "ar4_description",
"urdf_package_path": "urdf/ar4_in_world.urdf.xacro",
"rviz_config": rviz_config_filepath,
"jsp_gui": "true",
}.items(),
)

return LaunchDescription(
[
urdf_launch_include,
]
)
Loading