Integrating your FAIRINO cobot with Moveit2

Integrating your FAIRINO cobot with Moveit2

Overview

This tutorial focuses on the steps required to integrate your FAIRINO collaborative robot with MoveIt2, enabling advanced motion planning, collision avoidance, and safe robot interaction within complex environments.

By following this guide, you will learn how to:

- Integrate the robot for MoveIt2
- Launch and visualize the robot using RViz2
- Enable obstacle-aware path planning

This setup provides a flexible framework for developing safe and intelligent robotic applications using ROS2 and MoveIt2.




The Fairino MoveIt 2 integration utilizes a decoupled, four-tier pipeline to translate high-level Cartesian targets into safe, real-time physical robot motion.




The core computational heavy lifting, including inverse kinematics (IK), dynamic collision avoidance, and trajectory planning—is managed entirely by MoveIt. Once a safe path is calculated, MoveIt dispatches the structured trajectory way-points to the designated ROS 2 Arm Controller (JointTrajectoryController). 

This controller is responsible for deterministically sequencing and interpolating these way-points into a high-frequency, real-time command stream. These continuous commands are then fed directly into the Fairino Hardware Interface, which translates and executes the joint profiles natively across the physical Fairino Cobot.

Prerequisites

Before starting this tutorial, make sure you have successfully completed the Getting Started with the Fairino MoveIt2 Plugin tutorial.

You can still follow this guide without completing the previous tutorial, but you will need to manually clone the Fairino ROS2 repository using the following command:


Prepare Configuration Files

Before starting this section, you can either copy the source files into a separate workspace or continue using the existing plugin workspace. If you want to preserve the original tutorial setup.

Navigate to the ROS2 plugin repository corresponding to your Fairino cobot model.

In the same directory, make a new folder, this will be the workspace holding the new configuration to integrate moveit with the actual cobot.

Notes
cd ~/path/to/plugin/frcobot_ros2
cd ../
mkdir -p configured-fr-ws/src





Now you can move into the configured-fr-ws/src subfolder and then copy the fairino5_v6_moveit2_config,fairino_description, fairino_hardware_v3_9_5, fairino_msgs  file from the original plugin into the src subfolder 

Notes
# Go to the frcobot_ros2 repository
cd ~/path/to/plugin/frcobot_ros2
Notes
# Copy the MoveIt config package into your configured workspace src folder
cp -r fairino5_v6_moveit2_config ../configured-fr-ws/src/
cp -r fairino_description ../configured-fr-ws/src/
cp -r fairino_hardware_v3_9_5 ../configured-fr-ws/src/
cp -r fairino_msgs ../configured-fr-ws/src/

Overwrite configuration

In this step, we overwrite the default configuration to enable the integration between the Fairino hardware interface and MoveIt2, allowing direct control of the cobot through MoveIt2.

fairino5_v6_robot.ros2_control.xacro Modification

Navigate to the following directory:
Notes
cd /path/to/ros-plugins/configured-fr-ws/src/fairino5_v6_moveit2_config/config

Open the following file:
Notes
fairino5_v6_robot.ros2_control.xacro

Locate the following line:
Notes
<plugin>mock_components/GenericSystem</plugin>

Replace it with:
Notes
<plugin>fairino_hardware/FairinoHardwareInterface</plugin>



fairino5_v6_robot.urdf.xacro Modification

In this step, we modify the `fairino5_v6_robot.urdf.xacro` file to enable the Fairino hardware interface configuration.

Navigate to the following directory:
Notes
cd /path/to/ros-plugins/configured-fr-ws/src/fairino5_v6_moveit2_config/config

Open the following file:
Notes
fairino5_v6_robot.urdf.xacro

Locate the following line:
Notes
<xacro:fairino5_v6_robot_ros2_control name="FakeSystem" initial_positions_file="$(arg initial_positions_file)"/>

Replace it with:
Notes
<xacro:fairino5_v6_robot_ros2_control name="FairinoHardware" initial_positions_file="$(arg initial_positions_file)"/>

Build & Source the Workspace

After applying the previous modifications, the workspace can now be built using colcon.

First, make sure you are inside the workspace directory:
Notes
cd ~/path/to/configured-fr-ws

Build the workspace:
Notes
colcon build

Then source the workspace environment:
Notes
source install/setup.bash

Finally, export the Fairino library path:
Notes
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/path/to/ros-plugins/configured-fr-ws/src/fairino_hardware_v3_9_5/libfairino/lib/

Info
You will need to source the workspace and export the library path every time before running the demo.  
If preferred, these commands can be added to your `.bashrc` file to automate the process.


Add dynamic library to shared libraries


Move the library to shared libraries folder, this will allow you to avoid exporting the library path every time you want to run MoveIt2.
Notes
cd ~/ros-plugins/frg_gripp_int_ws/install/fairino_hardware_v3_9_5/lib/

Copy the .so files to the system library folder
Notes
sudo cp libfairino.so.2 /usr/local/lib/

Change the name of the libarary to so.2, moveit looks for this name
Notes
sudo ln -s /usr/local/lib/libfairino.so.2.3.5 /usr/local/lib/libfairino.so.2
Info
This step is required to prevent MoveIt2 from failing to initialize communication commands with the cobot, otherwise it might utilize the wrong library.

Run MoveIt2

Open a new terminal, navigate to the configured-fr-ws workspace, and run the following commands:
Notes
cd ~/path/to/configured-fr-ws
source install/setup.bash
ros2 launch fairino5_v6_moveit2_config demo.launch.py


    • Related Articles

    • Getting Started with the FAIRINO MoveIt2 Plugin

      Overview In this tutorial, we focus on the installation and setup of a basic MoveIt2 environment using the FR5 cobot model. By the end of this tutorial, you should have a basic understanding of MoveIt2, and how to launch a functional planning ...
    • Integrating the Gripper and Robot model within Moveit2 – Part 1: Merging the URDF

      Overview In this tutorial, we cover the first step of integrating a gripper with your cobot by merging the robot and gripper models into a single URDF/Xacro file. This unified description is required before generating the MoveIt2 configuration ...
    • Integrating FAIRINO Cobot with MEGMEET

      Overview Integrating a FAIRINO cobot with a MEGMEET welding system requires a robust communication bridge to synchronize robotic motion with critical welding parameters such as voltage, current, and arc ignition. This synchronization is essential to ...
    • Connecting an XJC Force/Torque Sensor to Fairino Cobot

      This article will cover the steps needed to connect your XJC force/torque sensor to the end of a Fairino Cobot arm Hardware required: - 1 XJC force sensor - 1 Fairino Cobot - 1 computer with ethernet connection to Control box/button box OR 1 teach ...
    • How to update Fairino Robot Software

      Step 1) - Navigate to the Fairino documentation page here - Use the version select button in the bottom right to select the target software version you wish to migrate to (please note the compatibility table below): Current Version Maximum Upgradable ...