This repository contains the complete ROS 2 control system for the AgileX Piper robotic arm, check the official repositiry: https://github.com/agilexrobotics/piper_ros/tree/humble
Also this repository include:
- Joint-level control over CAN
- Cartesian control (numerical IK / analytical IK)
- Joystick teleoperation (GameSir / Xbox / Logitech)
- Additional tools such as depth camera processing and game controller utilities
- URDF/Xacro robot description integration
Tested on:
- NVIDIA Jetson Orin / Xavier NX
- ROS 2 Humble
- Linux with CAN support (
can0)
piper_ros/
├── src/
│ ├── piper/ # Main robot control
│ │ ├── control_manager
│ │ ├── delta_manager
│ │ ├── piper_single_ctrl
│ │ ├── joystick_controller.py
│ │ ├── piper_conrol_gamesir.py
│ │ ├── game_controller_manager.py
│ │ └── scripts/depth_camera.py
│ │
│ ├── piper_teleoperation/ # NEW: Joystick teleoperation
│ │ ├── launch/joy_controller.launch.py
│ │ ├── scripts/joystick_controller_node.py
│ │ ├── scripts/ant.py
│ │ ├── CMakeLists.txt
│ │ └── package.xml
│ │
│ ├── object_recognition/ # (Not yet documented)
│ │
│ ├── piper_description/ # URDF + Xacro + RViz files
│ │
│ └── piper_kinematics/ # Cartesian IK controller
│ └── cartesian_controller
│
└── README.md
You can dowloand the dependencies from the official repository mention before or install the dependecies and requerimentes following this commands
- ROS 2 Humble
- python3-can
- can-utils
- libopencv-dev
- ros-humble-joy
- ros-humble-ros2-control
- ros-humble-ros2-controllers
- ros-humble-vision-msgs
- numpy
- scipy
- opencv-python
- python-can
bash dependencies.sh
pip3 install -r requirements.txtFirst find all the can ports connected to the jetson and activate
bash find_all_can_port.sh
bash can_activate.sh can_piper 1000000 "1-2.4:1.0" # it can changeRun the 2 following launches files
# First run this line, rviz will be open, but there will be some errors, it'll be solve with the next line
ros2 launch piper piper_connect.launch.py can_port:=can_piper
# Run this line, it charge all the urdfs of the robot
ros2 launch piper controller_general.launch.py
To control with the gamepad, first install the dependencies, then connect the gamepad and run the next code.
ros2 run game_controller_manager.pyThere are 2 modes of control the arm with the game pad
You can move the arm in x and z coordinates
You can move all the joints of the arm
Loads the URDF (GUI disabled) and starts the joint-based controller.
Run:
ros2 launch piper piper_single_ctrl.launch.py| Parameter | Default | Description |
|---|---|---|
can_port |
can0 |
CAN bus interface |
auto_enable |
true |
Auto-enable motors |
gripper_exist |
true |
Enable gripper |
gripper_val_mutiple |
2 |
PWM scaling multiplier |
Starts:
control_managerdelta_managercartesian_controller
Run:
ros2 launch piper_kinematics cartesian_controller.launch.py| Parameter | Default |
|---|---|
use_analytic_ik |
false |
dh_type |
modified |
max_iterations |
80 |
position_tolerance |
1e-3 |
orientation_tolerance |
1e-2 |
damping_factor |
0.1 |
publish_rate |
30.0 |
Package: piper_teleoperation
ros2 launch piper_teleoperation joy_controller.launch.pyjoystick_controller_node.py– reads joystick and publishes commandspiper_conrol_gamesir.py– GameSir button mappinggame_controller_manager.py– gamepad state handlingant.py– helper utility
Supported controllers:
- GameSir T4 / T4 Mini
- Xbox Controller
- Logitech F710
depth_camera.py processes depth images or point clouds.
Run:
ros2 run piper depth_cameraMove a single joint:
ros2 topic pub /joint_ctrl_single std_msgs/Float64MultiArray "{data: [0.5, 0, 0, 0, 0, 0]}"Send Cartesian velocity:
ros2 topic pub /cartesian_delta geometry_msgs/msg/Twist "{linear: {x:0.1, y:0, z:0}}"- Document
object_recognition/ - MoveIt 2 integration guide
- Gripper calibration tutorial
- Example: teleoperation + vision pipeline
Developed as part of ROBOTUM for AgileX Piper robotic arm research.