What if you could bring your robotic ideas to life without the cost, complexity, or risk of working with real hardware? Open-source robotic simulators make that possible. They let you design, test, and perfect your software in a fully virtual environment, saving time and resources. Even better, you’re building code that’s ready for the real world, refined in simulation, and ready to run on the actual robot.
In this post, we’ll take you behind the scenes of how we adapted the Annin Robotics AR4 arm to work with ROS 2, Gazebo, and MoveIt. Whether you’re an educator, hobbyist, or roboticist, we hope our journey will inspire you to dive into the exciting world of simulation.
What is the AR4?
The Annin Robotics AR4 is a compact, six-degree-of-freedom industrial robot designed for desktop use. Affordable, open-source, and incredibly versatile, it’s found its way into hundreds of high schools, technical institutes, and university labs around the world. It’s also a favorite among hobbyists looking to experiment and learn.
Curious to know more about the AR4? You can explore it here.
Motivation: Why we took on this project
When we recently added an AR4 manipulator to our lab at Ekumen, we knew we wanted more than just the physical hardware — we wanted a way to experiment, develop, and even fail safely, all within a simulation.
However, we soon realized that out-of-the-box ROS 2 integration wasn’t available. That’s when we decided to take matters into our own hands. Not only would this make the AR4 more accessible to our team, but it would also open the door for others to explore and innovate with this incredible platform.
In the process, we also explored integrating the AR4 with Isaac Sim and MuJoCo, pushing the simulation possibilities even further.
We drew inspiration from community-driven projects like ar3_core — a ROS1 and MoveIt integration for the AR3 — and ar4_ros_driver, which provided the integration with the real hardware, and a helpful Gazebo + ROS 2 environment for comparison with our own.
This effort came together thanks to the collaboration of Ariel Lowy, Francisco Rossi, Francisco López Méndez, and Fabricio Emder, who each contributed to shaping the simulation, development, and integration work behind this project
How we did it
Our journey began by adapting the ar3_core repository for the AR4 and building a new environment from the ground up:
-
Setting up the Environment: We created a Docker image containing all the dependencies needed to work with ROS 2 and Gazebo, using docker-compose for an easy launch.
-
Refining the Robot Model: We adapted the URDF file from a3_core to take advantage of xacro macros, which made defining the arm’s links and inertias much more efficient.
-
Upgrading the Visuals: To make the simulation even more lifelike, for the visuals, we separated parts of the original mesh and assigned them individual colors in Gazebo by loading them recursively — a small detail that made a big difference in realism.
-
Enabling Joint Control: Using ros2_control and Gazebo’s seamless integration, we configured the joints to respond to real-time commands within the simulation.
-
Bringing it All Together with MoveIt: Finally, with the MoveIt Setup Assistant, we configured the robot for motion planning and control using Rviz2 — allowing us to plan, simulate, and move the AR4 with precision.
The end result? A fully simulated AR4 manipulator, ready for action.
What’s next?
If you’re eager to see the AR4 come to life in a simulated environment, dive into the full implementation — you’ll find everything you need, including setup instructions, in our GitHub repository.
This is just the beginning: we’re also working on expanding the AR4 simulation to Isaac Sim and MuJoCo. Stay tuned for more!