- Create a workspace
mkdir -p ~/fanuc_ws/src
cd ~/fanuc_ws/src- Clone the repository
git clone https://github.com/aaqibmahamood/Fanuc-CRX-10iA-L-Collaborative-Robot---Trajectory-using-Moveit2.git- Build the workspace
cd ~/fanuc_ws
colcon build- Source the workspace
source install/setup.bash- Launch the simulation - Start Move Group
ros2 launch crx10ia_l__moveit_config move_group.launch.py- In a new terminal, launch RViz
source ~/fanuc_ws/install/setup.bash
ros2 launch crx10ia_l__moveit_config moveit_rviz.launch.py- In another terminal, run the trajectory
source ~/fanuc_ws/install/setup.bash
ros2 launch moveit2_scripts test_trajectory.launch.pyBefore proceeding with the installation, ensure your system meets the following requirements:
- Update System Packages
sudo apt update && sudo apt upgrade -y- Install ROS2 Humble Packages
sudo apt install -y \
ros-humble-desktop \
ros-humble-rviz \
ros-humble-control-msgs \
ros-humble-sensor-msgs- Source ROS2 Setup
source /opt/ros/humble/setup.bash- Install Dependencies
sudo apt install libmodbus-dev libjsoncpp-dev-
Extract Driver Files
- Unzip the installation file (install_humble_jammy.zip) to your Ubuntu PC
⚠️ CAUTION: Do not place in your colcon workspace
-
Set Required Permissions
chmod u+x {driver_location}/fanuc_ros2_driver/lib/f
chmod u+x {driver_location}/_local_setup_util_sh.py-
Add to ROS Path
If using packages only under /opt/ros/* without colcon workspace:
source install/local_setup.bash- 0. Quick Start
- 1. ROS Setup
- 2. Dependencies
- 3. Workspace Configuration
- 4. MoveIt2 Configuration
- 5. Trajectory Planning
- 6. Simulation
Tested on Ubuntu 22.04 LTS with ROS2 Humble.
- Update System
sudo apt update && sudo apt upgrade -y- Install ROS2 Humble Packages
sudo apt install -y \
ros-humble-desktop \
ros-humble-rviz \
ros-humble-control-msgs \
ros-humble-sensor-msgs- Source ROS2 Setup
source /opt/ros/humble/setup.bashsudo apt install libmodbus-dev libjsoncpp-devsudo apt update
sudo apt install -y ros-humble-moveit ros-humble-moveit-resources
sudo apt install -y python3-colcon-common-extensions build-essentialmkdir -p ~/fanuc_ws/src
cd ~/fanuc_ws
colcon build# Option 1: Copy local files
cp -r /path/to/crx_description ~/fanuc_ws/src/
# Option 2: Clone Repository
git clone https://github.com/aaqibmahamood/Fanuc-CRX-10iA-L-Collaborative-Robot---Trajectory-using-Moveit2.git
cd fanuc_ws
cd src
cd crx_descriptionsource /opt/ros/humble/setup.bash
ros2 launch moveit_setup_assistant setup_assistant.launch.py- Load URDF
- Browse and select
crx10ia_l.urdf.xacro
- Self-Collision Matrix
- Virtual Joints
- Planning Groups
- Group Name:
manipulator - Kinematics Plugin: KDLKinematicsPlugin
- Base Link:
base_link - Tip Link:
flange
- Robot Poses
- Add
homepose formanipulatorgroup
home.mp4
- End Effector
cd ~/fanuc_ws/src
ros2 pkg create moveit2_scripts --build-type ament_cmake \
--dependencies rclcpp moveit_ros_planning_interfacesrc/test_trajectory.cpp:
#include <rclcpp/rclcpp.hpp>
#include <moveit/move_group_interface/move_group_interface.h>
int main(int argc, char** argv) {
rclcpp::init(argc, argv);
auto node = rclcpp::Node::make_shared("test_trajectory");
moveit::planning_interface::MoveGroupInterface move_group(node, "manipulator");
// Plan to a target pose
geometry_msgs::msg::Pose target_pose;
target_pose.orientation.w = 1.0;
target_pose.position.x = 0.28;
target_pose.position.y = -0.2;
target_pose.position.z = 0.5;
move_group.setPoseTarget(target_pose);
auto success = (move_group.plan() == moveit::planning_interface::MoveItErrorCode::SUCCESS);
if (success) {
RCLCPP_INFO(node->get_logger(), "Planning successful. Executing...");
move_group.move();
} else {
RCLCPP_WARN(node->get_logger(), "Planning failed.");
}
rclcpp::shutdown();
return 0;
}launch/test_trajectory.launch.py:
from launch import LaunchDescription
from launch_ros.actions import Node
def generate_launch_description():
return LaunchDescription([
Node(
package='moveit2_scripts',
executable='test_trajectory',
output='screen',
)
])cd ~/fanuc_ws
colcon build --symlink-install
source install/setup.bash- Start Move Group - Terminal 1
ros2 launch crx10ia_l__moveit_config move_group.launch.py- Launch RViz - Terminal 2
source ~/fanuc_ws/install/setup.bash
ros2 launch crx10ia_l__moveit_config moveit_rviz.launch.pyPlan a trajectory to the home position.
- Execute Trajectory - Terminal 3
source ~/fanuc_ws/install/setup.bash
ros2 launch moveit2_scripts test_trajectory.launch.pytrajectory.mp4
- Ensure ROS2 Humble is correctly installed
- Verify all dependencies are met
- Check URDF and MoveIt configuration files
Contributions are welcome! 🤖
Your stars, forks, and PRs are appreciated!









