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
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ repos:
exclude: ^ar4_description/config/ar4.yaml$
- id: check-xml
- id: end-of-file-fixer
exclude: 'ar4_isaac/usda/'
- id: trailing-whitespace

- repo: https://github.com/pre-commit/mirrors-clang-format
Expand Down
11 changes: 9 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ The [Annin Robotics AR4](https://www.anninrobotics.com/) robot is a 6DOF desktop
- [`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.
- [`ar4_isaac`](./ar4_isaac): Isaac simulation for the ar4 arm.

## Installation

Expand Down Expand Up @@ -76,15 +77,21 @@ There are two ways of selecting a target position for the arm using `RViz`:
#### 1. Selecting random valid position
This will select a random position for the arm that would not cause a collision with itself or objects around it, calculated from the semantic information of the robot.

[Random valid position video](https://github.com/user-attachments/assets/be9406d2-6589-456c-8ae6-edbbe067b701)
[Random valid position video](https://github.com/user-attachments/assets/ec926968-8952-4ccf-ba63-5423e94f61cd)


#### 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/a3057320-02ba-4898-8c07-b08d86ec0dcf)
[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
11 changes: 11 additions & 0 deletions ar4_description/docs/UPDATE_MESHES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Update the robot meshes

To change the robot meshes, you can use [Blender](https://www.blender.org/), loading the [`ar4.blend`](../meshes/ar4.blend)


After the modifications, you'll need to update the meshes used in [`ar4.urdf.xacro`](../urdf/ar4.urdf.xacro). If new meshes are added, you'll need to add that in the `link` macro, as well as it's material.


If a new material is created, please create an entry in [`materials.xacro`](../urdf/include/materials.xacro).

Before exporting the new meshes as `STL` reset the transforms of all objects with: `ALT+G`.
Binary file added ar4_description/meshes/ar4.blend
Binary file not shown.
Binary file removed ar4_description/meshes/base_link.STL
Binary file not shown.
Binary file added ar4_description/meshes/base_link.stl
Binary file not shown.
Binary file added ar4_description/meshes/base_link_bottom.stl
Binary file not shown.
Binary file added ar4_description/meshes/base_link_motor.stl
Binary file not shown.
Binary file not shown.
Binary file added ar4_description/meshes/link_1_motor.stl
Binary file not shown.
Binary file not shown.
Binary file added ar4_description/meshes/link_2_cover.stl
Binary file not shown.
Binary file added ar4_description/meshes/link_2_cover_logo.stl
Binary file not shown.
Binary file added ar4_description/meshes/link_2_motor.stl
Binary file not shown.
Binary file not shown.
Binary file added ar4_description/meshes/link_3_misc.stl
Binary file not shown.
Binary file added ar4_description/meshes/link_3_motor.stl
Binary file not shown.
Binary file not shown.
Binary file added ar4_description/meshes/link_4_motor.stl
Binary file not shown.
Binary file removed ar4_description/meshes/link_5.STL
Binary file not shown.
Binary file added ar4_description/meshes/link_5.stl
Binary file not shown.
Binary file added ar4_description/meshes/link_5_motor.stl
Binary file not shown.
File renamed without changes.
28 changes: 21 additions & 7 deletions ar4_description/urdf/ar4.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,17 @@
<xacro:link link_name="base_link"
inertial="${robot_properties['base_link']['inertial']}"
visual="${robot_properties['base_link']['visual']}"
collision="${robot_properties['base_link']['collision']}">
collision="${robot_properties['base_link']['collision']}"
meshes="${['base_link', 'base_link_bottom', 'base_link_motor']}"
materials="${['grey', 'blue', 'black']}">
<origin xyz="0 0 0" rpy="0 0 0" />
</xacro:link>
<xacro:link link_name="link_1"
inertial="${robot_properties['link_1']['inertial']}"
visual="${robot_properties['link_1']['visual']}"
collision="${robot_properties['link_1']['collision']}">
collision="${robot_properties['link_1']['collision']}"
meshes="${['link_1', 'link_1_motor']}"
materials="${['grey', 'black']}">
<origin xyz="0 0 0" rpy="0 0 0" />
</xacro:link>
<joint name="joint_1" type="revolute">
Expand All @@ -31,7 +35,9 @@
<xacro:link link_name="link_2"
inertial="${robot_properties['link_2']['inertial']}"
visual="${robot_properties['link_2']['visual']}"
collision="${robot_properties['link_2']['collision']}">
collision="${robot_properties['link_2']['collision']}"
meshes="${['link_2', 'link_2_motor', 'link_2_cover', 'link_2_cover_logo']}"
materials="${['grey', 'black', 'white', 'blue']}">
<origin xyz="0 0 0" rpy="0 0 0" />
</xacro:link>
<joint name="joint_2" type="revolute">
Expand All @@ -45,7 +51,9 @@
<xacro:link link_name="link_3"
inertial="${robot_properties['link_3']['inertial']}"
visual="${robot_properties['link_3']['visual']}"
collision="${robot_properties['link_3']['collision']}">
collision="${robot_properties['link_3']['collision']}"
meshes="${['link_3', 'link_3_motor', 'link_3_misc']}"
materials="${['grey', 'black', 'black']}">
<origin xyz="0 0 0" rpy="0 0 0" />
</xacro:link>
<joint name="joint_3" type="revolute">
Expand All @@ -59,7 +67,9 @@
<xacro:link link_name="link_4"
inertial="${robot_properties['link_4']['inertial']}"
visual="${robot_properties['link_4']['visual']}"
collision="${robot_properties['link_4']['collision']}">
collision="${robot_properties['link_4']['collision']}"
meshes="${['link_4', 'link_4_motor']}"
materials="${['grey', 'black']}">
<origin xyz="0 0 0" rpy="0 0 0" />
</xacro:link>
<joint name="joint_4" type="revolute">
Expand All @@ -73,7 +83,9 @@
<xacro:link link_name="link_5"
inertial="${robot_properties['link_5']['inertial']}"
visual="${robot_properties['link_5']['visual']}"
collision="${robot_properties['link_5']['collision']}">
collision="${robot_properties['link_5']['collision']}"
meshes="${['link_5', 'link_5_motor']}"
materials="${['grey', 'black']}">
<origin xyz="0 0 0" rpy="0 0 0" />
</xacro:link>
<joint name="joint_5" type="revolute">
Expand All @@ -87,7 +99,9 @@
<xacro:link link_name="link_6"
inertial="${robot_properties['link_6']['inertial']}"
visual="${robot_properties['link_6']['visual']}"
collision="${robot_properties['link_6']['collision']}">
collision="${robot_properties['link_6']['collision']}"
meshes="${['link_6']}"
materials="${['grey']}">
<origin xyz="0 0 0" rpy="0 0 0" />
</xacro:link>
<joint name="joint_6" type="revolute">
Expand Down
83 changes: 46 additions & 37 deletions ar4_description/urdf/include/common_macros.urdf.xacro
Original file line number Diff line number Diff line change
Expand Up @@ -2,43 +2,52 @@
<robot xmlns:xacro="http://www.ros.org/wiki/xacro">
<!-- ===================== Arm link xacro ================================== -->

<xacro:macro name="link" params="link_name *origin inertial visual collision">
<link name="${link_name}">
<xacro:insert_block name="origin"/>
<xacro:box_inertia m="${inertial['mass']}"
x="${inertial['size']['dx']}"
y="${inertial['size']['dy']}"
z="${inertial['size']['dz']}"
o_xyz="${inertial['origin']['dx']} ${inertial['origin']['dy']} ${inertial['origin']['dz']}"
o_rpy="${inertial['origin']['dr']} ${inertial['origin']['dp']} ${inertial['origin']['dY']}">
</xacro:box_inertia>
<visual>
<origin rpy="${visual['origin']['dr']}
${visual['origin']['dp']}
${visual['origin']['dY']}"
xyz="${visual['origin']['dx']}
${visual['origin']['dy']}
${visual['origin']['dz']}"/>
<geometry>
<mesh filename="file://$(find ar4_description)/meshes/${link_name}.STL"/>
</geometry>
<material name="">
<color rgba="1 1 0 1"/>
</material>
</visual>
<collision>
<origin rpy="${collision['origin']['dr']}
${collision['origin']['dp']}
${collision['origin']['dY']}"
xyz="${collision['origin']['dx']}
${collision['origin']['dy']}
${collision['origin']['dz']}"/>
<geometry>
<mesh filename="file://$(find ar4_description)/meshes/${link_name}.STL"/>
</geometry>
</collision>
</link>
</xacro:macro>
<xacro:include filename="$(find ${package_name})/urdf/include/materials.xacro" />
<xacro:macro name="link" params="link_name *origin inertial visual collision meshes:=^ materials:=^">
<link name="${link_name}">
<xacro:insert_block name="origin"/>

<xacro:box_inertia m="${inertial['mass']}"
x="${inertial['size']['dx']}"
y="${inertial['size']['dy']}"
z="${inertial['size']['dz']}"
o_xyz="${inertial['origin']['dx']} ${inertial['origin']['dy']} ${inertial['origin']['dz']}"
o_rpy="${inertial['origin']['dr']} ${inertial['origin']['dp']} ${inertial['origin']['dY']}">
</xacro:box_inertia>

<xacro:mesh_loop meshes="${meshes}" materials="${materials}" visual="${visual}" collision="${collision}" />
</link>
</xacro:macro>

<!-- Recursive macro to iterate over meshes -->
<xacro:macro name="mesh_loop" params="meshes:=^ materials:=^ visual collision">
<xacro:if value="${meshes}">
<xacro:property name="mesh" value="${meshes.pop(0)}"/>
<xacro:property name="material" value="${materials.pop(0)}"/>

<visual>
<origin rpy="${visual['origin']['dr']} ${visual['origin']['dp']} ${visual['origin']['dY']}"
xyz="${visual['origin']['dx']} ${visual['origin']['dy']} ${visual['origin']['dz']}"/>
<geometry>
<mesh filename="file://$(find ar4_description)/meshes/${mesh}.stl"/>
</geometry>
<material name="${material}"/>
</visual>

<collision>
<origin rpy="${collision['origin']['dr']} ${collision['origin']['dp']} ${collision['origin']['dY']}"
xyz="${collision['origin']['dx']} ${collision['origin']['dy']} ${collision['origin']['dz']}"/>
<geometry>
<mesh filename="file://$(find ar4_description)/meshes/${mesh}.stl"/>
</geometry>
</collision>

<!-- Recursive call to process the remaining list -->
<xacro:mesh_loop meshes="${meshes}" materials="${materials}" visual="${visual}" collision="${collision}" />
</xacro:if>
</xacro:macro>



<!-- ===================== Box inertia xacro ================================== -->
<!-- params -->
Expand Down
18 changes: 18 additions & 0 deletions ar4_description/urdf/include/materials.xacro
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<?xml version="1.0"?>
<robot>
<material name="black">
<color rgba="0.0 0.0 0.0 1.0"/>
</material>

<material name="blue">
<color rgba="0.020 0.032 0.171 1.0"/>
</material>

<material name="white">
<color rgba="0.631 0.665 0.831 1.0"/>
</material>

<material name="grey">
<color rgba="0.5 0.5 0.5 1.0"/>
</material>
</robot>
43 changes: 43 additions & 0 deletions ar4_isaac/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# 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_isaac)

find_package(ament_cmake REQUIRED)

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

ament_package()
29 changes: 29 additions & 0 deletions ar4_isaac/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 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.
40 changes: 40 additions & 0 deletions ar4_isaac/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
# Description
An Isaac simulation of the AR4 Package.

## Prerequirements

Running the `nvidia` isaac simulation requires:

- Minimum specs (See: [Isaac Sim System Requirements](https://docs.omniverse.nvidia.com/isaacsim/latest/installation/requirements.html#system-requirements)
- [Installing the NVIDIA Container Toolkit](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html)

## Run the simulation container

```
docker/run.sh -s ar4_isaac
```

## Build the packages

Build the packages

```
source /opt/ros/humble/setup.bash
colcon build
```

Source the built packages

```
source install/setup.bash
```

## Launch the simulation
```
ros2 launch ar4_isaac ar4_in_empty_world.launch.py
```
![AR4 in Isaac Sim](docs/pics/isaac_sim.png)

## More:

- [Update the model](docs/UPDATE_MODEL.md)
Loading
Loading