1. Plug-in Introduction
Fairino MoveIt2 plug-in is a plug-in that provides support for motion control and path planning of Fairino robots. With the help of Fairino MoveIt2 plug-in can realize complex robot motion control, path planning, inverse kinematics solving and real-time collision detection, etc. It is suitable for a variety of robotic arm application scenarios, such as industrial, welding, manufacturing, automated loading and unloading, palletizing, medical and other scenarios.
2. Rapid Access
This chapter describes how to configure the APP running environment.
It is recommended to use it on Ubuntu22.04LTS (Jammy). After the system is installed, you can install ROS2. It is recommended to use ros2-humble. For the installation of ROS2, please refer to the tutorial: https://docs.ros.org/en/humble/index.html.
2.1. MoveIt2 Installation
2.1.1. Clone Fairino MoveIt2 Plugin
Clone the Fairino MoveIt2 plugin locally, and then cd to the target directory, where the main files include fairino_msgs Fairino robot data transfer data type function package; fairino_hardware Fairino robot fairino_hardware plugin function package;
fairino_robot/ fairino_description Fairino robot appearance and urdf file function package; fairino_robot/fairino3mt_v6_moveit2_config, fairino_robot/fairino3_v6_moveit2_config, fairino_robot/fairino5_v6_moveit2_config, fairino_robot/fairino10_v6_moveit2_config, fairino_robot/fairino16_v6_moveit2_config, fairino_robot /fairino20_v6_moveit2_config, fairino_robot/fairino30_v6_moveit2_config Fairino Robotics moveit2 Configuration Package, fairino_robot/fairino_mtc_demo Fairino mtc Sample Code Package.


2.1.2. Compile Feature Packs
Compile the fairino_msgs function package.
cd ros2_ws
colcon build --packages-select fairino_msgs
source install/setup.bash
Compile the fairino_hardware function package.
cd ros2_ws
colcon build --packages-select fairino_hardware
source install/setup.bash
Compile the fairino_description function package.
cd ros2_ws
colcon build --packages-select fairino_description
source install/setup.bash
Compile the Fairino robot moveit2 configuration package, using fairino5_v6_moveit2_config as an example.
cd ros2_ws
colcon build --packages-select fairino5_v6_moveit2_config
source install/setup.bash
Compile Fairino Robotics fairino_mtc_demo sample code package, if the code sample package does not appear in the official ros2_ws workspace, you can contact the after-sales service to get it.
cd ros2_ws
colcon build --packages-select fairino_mtc_demo
source install/setup.bash
2.2. Configuring the Moveit2 model of the Fairino robotic arm
If you do not want to use the official robot moveit2_config package, you can customize the robot moveit2_config package by configuring it with moveit_setup_assistant.
2.2.1. Creating A Workspace
Create the workspace and create the feature pack.
mkdir -p test_fa_ws/src
cd test_fa_w/src
mkdir fairino5_v6_robot_moveit_config
cd ..
cd ..
Compile the functional package and source.
colcon build
source install/setup.bash
Start moveit_setup_assistant for robot configuration.
ros2 launch moveit_setup_assistant setup_assistant.launch.py
2.2.2. Configuration Robot
Launching the configuration interface
Open the terminal in the test_fa_ws directory and select “Create New Moveit Configuration Package” in the configuration interface to create a new moveit configuration package.

Then select the description file of the robot, that is, the .urdf file, and then select Load Files, load the robot model, you can see the right side of the robot model loaded out.

Configuring Self-Collisions
Self-Collisions for the robot collision settings, click Generate Collision Matrix can automatically generate the joints collision matrix, which will cancel the collision between the two contacting connecting rods and the connecting rods that can never be contacted, so as to configure the robot joints collision matrix, thus avoiding the calculation of the collision between the two contacting surfaces, click Generate Collision Matrix is automatically generated by clicking Generate.

Configuring Virtual Joints
Virtual Joints is the virtual axes of the robot, when the robot is installed on the mobile platform, it is necessary to set the virtual axes for the robot, set the name of the virtual axes, the sub-links, the type of joints, etc.
when the mobile platform moves, the virtual axes will also synchronize with the movement of the robot to drive the robot to move, so as to realize the robot with the movement of the mobile platform function this time the robot will be placed directly on the world coordinate system, named virtual_joints.

Configuring Planning Groups
Planning Groups is the planning group of the robot, which will be the joints that need to be considered in the same kinematic calculation in the same planning group for unified forward and reverse kinematic calculations, such as placing a robot on an AGV cart, and then installing a fixture at the end of the robot, the test will be the four joints of the AGV cart in a planning group, the six joints of the robot in a planning group,

and one of the joints of the fixture in a planning group for kinematics calculations.
One joint of the fixture is in one planning group for kinematic calculation. Since this does not involve the fixture so only add the robot’s joints group, that is, the arm group, first of all add the arm group, the dynamics solver Kinematic Solver select kdl_kinematics_plugin/KDLKinematicsPlugin, and then the default planner Group Default Planner select TRRT, then click Add Joints to add joints for this planning group.
arm’s joints hold shift to make multiple selections, click ‘>’ to add, then click save

to save.
The defined planning group is shown below.

Configuring Robot Poses
Robot Poses is the robot preset poses, which defines some preset poses for each planning group, and a home pose for arm, which can be chosen at will.

Robot Poses can define preset poses for each planning group. When there are fixtures in the robot, you can add a fixture planning group in the Planning Groups section, and then set the preset poses for the fixtures when setting poses in Robot Poses.
Configuring End Effectors
End Effectors is the robot end actuator, the planning group of end actuator is hand, and then the default connected parent_link is panda_link8, since there is no end actuator this time, so this step can be skipped.
ros2_control URDF Modifications
ros2_control URDF Modifications is mainly used to set the joint data type of sending and feedback, you can choose the position, speed, torque three kinds of joint data type of sending and feedback are position control, and then directly Add interfaces to be able to.

Important
Note:
Selecting the joint data type needs to match the subsequent fairino_hardware plug-in, and select the joint data type for sending down and feedback according to the data transmitted by the fairino_hardware plug-in. Since the fairino_hardware plug-in controlling the motion of the actual robot this time uses the position data type, this time the Because the fairino_hardware plug-in that controls the motion of the actual robot uses the position data type, this time the joint data type chosen for sending and feedback are both position control.