Skip to content

Commit fbff94c

Browse files
committed
Add mujoco
1 parent 91be0ea commit fbff94c

37 files changed

+1139
-31
lines changed

README.md

Lines changed: 61 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -1,69 +1,99 @@
1-
# AR4
1+
# AR4 ROS 2 Software
22

3-
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.
3+
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.
4+
5+
It provides a ROS 2 set of packages to be able to control the AR4 robot both in real hardware and
6+
a number of different simulation environments.
47

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

912
## Package Summary
1013

11-
- [`ar4_gazebo`](./ar4_gazebo): Gazebo simulation for the ar4 arm.
12-
- [`ar4_description`](./ar4_description): Contains the URDF of the arm.
13-
- [`ar4_hardware_interface`](./ar4_hardware_interface): Contains the software required to connect the computer with the real robot.
14-
- [`ar4_moveit_config`](./ar4_moveit_config): Contains configuration and launch files to run and command the arm.
14+
These are the main packages providing launch files for the different use cases:
15+
16+
- [`ar4_description`](./ar4_description): Contains the platform-agnostic parts of the URDF robot description.
17+
- [`ar4_gazebo_bringup`](./ar4_gazebo): Launch a Gazebo Sim simulation of AR4.
18+
- [`ar4_isaac_bringup`](./ar4_gazebo): **Not yet available.** Launch an Isaac Sim simulation of AR4.
19+
- [`ar4_mujoco_bringup`](./ar4_gazebo): **Not yet available.** Launch a Mujoco-based simulation of AR4.
20+
- [`ar4_realbot_bringup`](./ar4_gazebo): Launch drivers and control software for the real AR4 robot.
1521
- [`ar4_isaac`](./ar4_isaac): Isaac simulation for the ar4 arm.
1622

17-
## Installation
1823

19-
### Prerequisites
24+
```mermaid
25+
graph TD
26+
A[**ar4_moveit_config** <br> main.launch.py]
27+
B[**ar4_common** <br> main.launch.py]
28+
C[**ar4_description** <br> main.launch.py]
29+
D[**ar4_gazebo_sim** <br> main.launch.py]
30+
E[**ar4_gazebo_bringup** <br> main.launch.py]
31+
F[**ar4_hardware_interface** <br> main.launch.py]
32+
G[**ar4_realbot_bringup** <br> main.launch.py]
2033
21-
It is a requirement to have `docker engine` with the `docker compose plugin` already installed in the host machine.
34+
A --> F
35+
C --> F
2236
23-
See: [Docker Installation Guide](https://docs.docker.com/engine/install/ubuntu/)
37+
H[**ar4_isaac_bringup** <br> main.launch.py <br> ...not yet available...]
38+
I[**...** <br> main.launch.py]
2439
25-
### Running the dev container
40+
B --> H
41+
I --> H
2642
27-
Build and run the container for the use case you are interested in
43+
J[**ar4_mujoco_bringup** <br> main.launch.py <br> ...not yet available...]
44+
K[**...** <br> main.launch.py]
2845
29-
#### Gazebo
30-
```bash
31-
./docker/run.sh -s ar4_gazebo
32-
```
46+
B --> J
47+
K --> J
3348
34-
#### Hardware
3549
36-
* [Hardware Interface Instructions](ar4_hardware_interface/README.md)
50+
A --> B
3751
38-
## Build the packages
52+
C --> D
53+
C --> A
3954
40-
Build the packages
55+
B --> E
56+
D --> E
4157
42-
```
43-
colcon build
58+
B --> G
59+
F --> G
4460
```
4561

46-
Source the built packages
62+
## Installation
4763

48-
```
49-
source install/setup.bash
50-
```
64+
### Prerequisites
5165

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

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

56-
After building and sourcing the packages, run the specific launch file for your use case:
70+
### Running the dev container
71+
72+
Build and run the container for the use case you are interested in
5773

5874
#### Gazebo
5975

76+
Launch the docker container with the following command:
77+
78+
```bash
79+
./docker/run.sh -s ar4_gazebo
6080
```
61-
ros2 launch ar4_gazebo moveit.launch.py
81+
82+
Then build and launch Gazebo bringup launch file:
83+
84+
```bash
85+
colcon build --symlink-install --packages-up-to ar4_gazebo_bringup \
86+
&& source install/setup.bash \
87+
&& ros2 launch ar4_gazebo_bringup main.launch.py
6288
```
6389

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

66-
---
92+
93+
#### Hardware
94+
95+
* [Hardware Interface Instructions](ar4_hardware_interface/README.md)
96+
6797

6898
### Controlling the AR4 with MoveIt
6999

ar4_mujoco_bringup/CMakeLists.txt

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
# BSD 3-Clause License
2+
#
3+
# Copyright 2025 Ekumen, Inc.
4+
# All rights reserved.
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions are met:
8+
#
9+
# 1. Redistributions of source code must retain the above copyright notice, this
10+
# list of conditions and the following disclaimer.
11+
#
12+
# 2. Redistributions in binary form must reproduce the above copyright notice,
13+
# this list of conditions and the following disclaimer in the documentation
14+
# and/or other materials provided with the distribution.
15+
#
16+
# 3. Neither the name of the copyright holder nor the names of its
17+
# contributors may be used to endorse or promote products derived from
18+
# this software without specific prior written permission.
19+
#
20+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
31+
cmake_minimum_required(VERSION 3.7)
32+
project(ar4_mujoco_bringup)
33+
34+
find_package(ament_cmake REQUIRED)
35+
36+
install(DIRECTORY launch DESTINATION share/${PROJECT_NAME}/)
37+
38+
ament_package()

ar4_mujoco_bringup/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2025, Ekumen Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# BSD 3-Clause License
2+
#
3+
# Copyright 2025 Ekumen, Inc.
4+
# All rights reserved.
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions are met:
8+
#
9+
# 1. Redistributions of source code must retain the above copyright notice, this
10+
# list of conditions and the following disclaimer.
11+
#
12+
# 2. Redistributions in binary form must reproduce the above copyright notice,
13+
# this list of conditions and the following disclaimer in the documentation
14+
# and/or other materials provided with the distribution.
15+
#
16+
# 3. Neither the name of the copyright holder nor the names of its
17+
# contributors may be used to endorse or promote products derived from
18+
# this software without specific prior written permission.
19+
#
20+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
31+
"""launch file for integrating Gazebo with MoveIt for the AR4 robot."""
32+
33+
from launch import LaunchDescription
34+
from launch_ros.actions import SetParameter
35+
from launch_ros.substitutions import FindPackageShare
36+
from launch.actions import IncludeLaunchDescription
37+
from launch.launch_description_sources import PythonLaunchDescriptionSource
38+
from launch.substitutions import PathJoinSubstitution
39+
40+
41+
def generate_launch_description():
42+
use_sim_time_param = SetParameter(name="use_sim_time", value=True)
43+
44+
common_stack_include = IncludeLaunchDescription(
45+
PythonLaunchDescriptionSource(
46+
PathJoinSubstitution(
47+
[
48+
FindPackageShare("ar4_common"),
49+
"launch",
50+
"main.launch.py",
51+
]
52+
)
53+
)
54+
)
55+
56+
gz_sim_include = IncludeLaunchDescription(
57+
PythonLaunchDescriptionSource(
58+
PathJoinSubstitution(
59+
[
60+
FindPackageShare("ar4_mujoco_sim"),
61+
"launch",
62+
"main.launch.py",
63+
]
64+
)
65+
)
66+
)
67+
68+
return LaunchDescription(
69+
[
70+
use_sim_time_param,
71+
common_stack_include,
72+
gz_sim_include,
73+
]
74+
)

ar4_mujoco_bringup/package.xml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
<?xml version="1.0"?>
2+
<package format="3">
3+
<name>ar4_mujoco_bringup</name>
4+
<version>0.0.1</version>
5+
<description>Launch AR4 software against a Mujoco simulation of the robot</description>
6+
<author email="glpuga@ekumenlabs.com">Gerardo Puga</author>
7+
<maintainer email="glpuga@ekumenlabs.com">Gerardo Puga</maintainer>
8+
<license file="LICENSE">BSD-3-Clause</license>
9+
10+
<buildtool_depend>ament_cmake</buildtool_depend>
11+
12+
<exec_depend>ar4_common</exec_depend>
13+
<exec_depend>ar4_mujoco_sim</exec_depend>
14+
<exec_depend>ros2launch</exec_depend>
15+
16+
<export>
17+
<build_type>ament_cmake</build_type>
18+
</export>
19+
</package>

ar4_mujoco_sim/CMakeLists.txt

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# BSD 3-Clause License
2+
#
3+
# Copyright 2025 Ekumen, Inc.
4+
# All rights reserved.
5+
#
6+
# Redistribution and use in source and binary forms, with or without
7+
# modification, are permitted provided that the following conditions are met:
8+
#
9+
# 1. Redistributions of source code must retain the above copyright notice, this
10+
# list of conditions and the following disclaimer.
11+
#
12+
# 2. Redistributions in binary form must reproduce the above copyright notice,
13+
# this list of conditions and the following disclaimer in the documentation
14+
# and/or other materials provided with the distribution.
15+
#
16+
# 3. Neither the name of the copyright holder nor the names of its
17+
# contributors may be used to endorse or promote products derived from
18+
# this software without specific prior written permission.
19+
#
20+
# THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
# AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
# DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
# SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
# CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
# OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
# OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
30+
31+
cmake_minimum_required(VERSION 3.7)
32+
project(ar4_mujoco_sim)
33+
34+
find_package(ament_cmake REQUIRED)
35+
36+
install(
37+
DIRECTORY launch
38+
meta
39+
mjcf
40+
urdf
41+
xacro
42+
DESTINATION share/${PROJECT_NAME}/)
43+
44+
ament_package()

ar4_mujoco_sim/LICENSE

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2025, Ekumen Inc.
4+
All rights reserved.
5+
6+
Redistribution and use in source and binary forms, with or without
7+
modification, are permitted provided that the following conditions are met:
8+
9+
1. Redistributions of source code must retain the above copyright notice, this
10+
list of conditions and the following disclaimer.
11+
12+
2. Redistributions in binary form must reproduce the above copyright notice,
13+
this list of conditions and the following disclaimer in the documentation
14+
and/or other materials provided with the distribution.
15+
16+
3. Neither the name of the copyright holder nor the names of its
17+
contributors may be used to endorse or promote products derived from
18+
this software without specific prior written permission.
19+
20+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
21+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
23+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
24+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
26+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
27+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
28+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
29+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

ar4_mujoco_sim/README.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Description
2+
A Gazebo simulation of the AR4 Package.
3+
4+
To build the package, run
5+
`colcon build`
6+
7+
To run the simulation, source and run
8+
`ros2 launch ar4_mujoco_sim ar4_sim.launch.py`
9+
10+
#### Launch file arguments
11+
- 'rsp':
12+
- Run [`robot state publisher`](https://github.com/ros/robot_state_publisher) node. (default: 'false')
13+
- 'rviz':
14+
- Start RViz. (default: 'false')

0 commit comments

Comments
 (0)