This repository contains simulation models, and corresponding motion planning and controlling demos of the robotic manipulator xArm6 from UFACTORY. There are five modules:
- aruco_calibration
- perception_etflab
- real_bringup
- sim_bringup
- RPMPLv2 (https://github.com/roboticsETF/RPMPLv2.git)
The development and test environment are tested on Ubuntu 22.04 + ROS2 Humble.
Choose a location for a target workspace, e.g.:
cd ~/
and then clone the repository:
git clone https://github.com/roboticsETF/xarm6-etf-lab.git
cd ~/xarm6-etf-lab # Not required if you are cloning through IDE (e.g., VS Code)
make submodules
cd ~/xarm6-etf-lab/src/external_modules/xarm_ros2
git submodule sync
git submodule update --init --remote
cd ~/xarm6-etf-lab/src/external_modules/gazebo_ros2_control
git submodule sync
git submodule update --init --remote
Optionally, if you want to change the robot initial configuration (all joint angles are set to zero by default), open the file ~/xarm6-etf-lab/src/external_modules/gazebo_ros2_control/gazebo_ros2_control/src/gazebo_system.cpp
, and find the function GazeboSystem::registerJoints
. Then, find the following code line:
initial_position = get_initial_value(joint_info.state_interfaces[i]);
Instead of that line, add the following code:
if (j == 3)
initial_position = M_PI;
else if (j == 4)
initial_position = M_PI_2;
else
initial_position = get_initial_value(joint_info.state_interfaces[i]);
Similarly, you can set any desired angle for the j
-th joint.
cd ~/xarm6-etf-lab
rosdep update
make dependencies
make build
source source_dirs.bash
First, type:
cd ~/xarm6-etf-lab
Then, launch the robot using one of the following three options:
First option (RViz2 + Gazebo):
ros2 launch sim_bringup xarm6_etflab.launch.py
# or just type:
make sim
Second option (MoveIt2 + RViz2 + Gazebo):
ros2 launch sim_bringup xarm6_moveit_gazebo.launch.py
Third option (MoveIt2 + RViz2):
ros2 launch xarm_moveit_config xarm6_moveit_realmove.launch.py robot_ip:=192.168.1.236 [add_gripper:=true]
# In the new tab type:
cd ~/xarm6-etf-lab
# In C++
ros2 run sim_bringup test_move_xarm6
# In Python
ros2 run sim_bringup test_move_xarm6.py
# In the new tab type:
cd ~/xarm6-etf-lab
ros2 run sim_bringup test_planners
# In the new tab type:
cd ~/xarm6-etf-lab
ros2 run sim_bringup test_task_planning
# In the new tab type:
cd ~/xarm6-etf-lab
ros2 run sim_bringup test_real_time_planning
First, launch the cameras:
cd ~/xarm6-etf-lab
ros2 launch real_bringup realsense_etflab.launch.py
# or just type:
make cameras
First, launch the robot:
cd ~/xarm6-etf-lab
ros2 launch real_bringup real_xarm6_etflab.launch.py
# or just type:
make real
# In the new tab type:
cd ~/xarm6-etf-lab
# In C++
ros2 run real_bringup test_move_xarm6
# In Python
ros2 run real_bringup test_move_xarm6.py
# In the new tab type:
cd ~/xarm6-etf-lab
ros2 run real_bringup test_bottle_and_glass
# In the new tab type:
cd ~/xarm6-etf-lab
ros2 run real_bringup test_pick_and_place
# In the new tab type:
cd ~/xarm6-etf-lab
ros2 run real_bringup test_pick_and_place_using_cameras
# In the new tab type:
cd ~/xarm6-etf-lab
ros2 run real_bringup test_planners
# In the new tab type:
cd ~/xarm6-etf-lab
ros2 run real_bringup test_task_planning
# In the new tab type:
cd ~/xarm6-etf-lab
ros2 run real_bringup test_real_time_planning