Quick answer: to set up the AgileX PiPER Python SDK on Ubuntu, install the CAN utilities, activate the PiPER interface as can0 at 1,000,000 bit/s, install AgileX's current pyAgxArm package in a virtual environment, identify the controller firmware, and confirm that Python receives six joint angles.
This guide takes you from a powered standard PiPER arm to the first read-only feedback message. It does not enable the motors or send a motion command, so you can validate the hardware and driver layers before adding ROS 2, MoveIt, teleoperation, or robot-learning software.
- Choose
pyAgxArmor maintain an existingpiper_sdkproject. - Prepare Ubuntu, Python, the AgileX CAN module, and a virtual environment.
- Bring up SocketCAN and verify
can0at 1 Mbps. - Read the firmware version, select the matching
PiperFWconstant, and read six joint angles. - Use the troubleshooting matrix to isolate Ubuntu, CAN, Python, firmware, and feedback failures.
Which AgileX PiPER Python SDK Should You Use?
Two official AgileX repositories appear in PiPER searches. They use different imports and cannot be combined line by line.
| SDK | Typical import | Best use | Rule for this guide |
|---|---|---|---|
| pyAgxArm |
AgxArmFactory, ArmModel, PiperFW
|
Current unified AgileX Python SDK for PiPER, NERO, and supported end effectors | Used throughout this article |
| piper_sdk | C_PiperInterface |
Existing projects and older PiPER examples that already use this API | Do not paste its methods into a pyAgxArm script |
The older piper_sdk repository now points readers to pyAgxArm. For a new project, the unified SDK is the clearer starting point. If an example begins with C_PiperInterface, follow that repository's documentation instead of mixing APIs.
PiPER SDK Compatibility and Requirements
| Component | Requirement used here | Why it matters |
|---|---|---|
| Robot | Standard AgileX PiPER, not PiPER-H, PiPER-L, or PiPER-X | The factory model and kinematic configuration must match the arm |
| Ubuntu | 18.04, 20.04, 22.04, or 24.04 | These releases are listed by AgileX for pyAgxArm |
| Python | Python 3.6 or newer; a virtual environment is recommended | Prevents package and interpreter mismatches |
| Python CAN library | python-can>3.3.4 |
Required by the official SDK documentation |
| CAN hardware | CAN module supplied or supported by AgileX | The official CAN manual does not support arbitrary substitutes for this workflow |
| Linux interface |
socketcan, normally can0
|
This is the network interface opened by the Python driver |
| PiPER CAN bitrate | 1,000,000 bit/s | A wrong bitrate prevents valid feedback decoding |
can_left and can_right require USB-port mapping and should be configured after the single-arm checkpoint passes.How the PiPER SDK Connection Works
The Python package does not talk to the arm through a generic serial port. On Ubuntu, the AgileX USB-CAN module appears as a SocketCAN network device. The driver opens that interface and decodes incoming PiPER CAN frames into Python objects.
PiPER joint feedback travels through the AgileX USB-CAN module and Ubuntu SocketCAN before pyAgxArm converts it into six joint angles.
Step 1: Prepare Ubuntu and Create a Python Environment
Install the Ubuntu tools used to detect and configure the CAN interface:
sudo apt update
sudo apt install -y can-utils ethtool iproute2 python3-pip python3-venv
Create a dedicated environment so installation and execution use the same Python interpreter:
python3 -m venv ~/piper-venv
source ~/piper-venv/bin/activate
python -m pip install --upgrade pip
After activation, both commands should point inside ~/piper-venv:
which python
python -m pip --version
python and pip resolve to the same virtual environment.Ubuntu 24.04 and externally-managed-environment
Ubuntu 24.04 may reject direct installation into the system Python with an externally-managed-environment error. The virtual-environment workflow above is the preferred fix. Keep the environment activated whenever you install the SDK or run the PiPER scripts.
Step 2: Detect and Activate the PiPER CAN Interface
Clone the current SDK repository and enter its Ubuntu helper-script directory:
git clone https://github.com/agilexrobotics/pyAgxArm.git
cd pyAgxArm/scripts/ubuntu
bash find_all_can_port.sh
With only the PiPER CAN adapter connected, activate it as can0:
bash can_activate.sh can0 1000000
You can also use the direct SocketCAN command documented by AgileX:
sudo ip link set can0 up type can bitrate 1000000
Verify the interface instead of assuming the command succeeded:
ip -details link show can0
A working PiPER SocketCAN layer shows can0 in the UP state with a bitrate of 1,000,000.
can0, an UP state, and bitrate 1000000. Repair this layer before installing or debugging Python code.Step 3: Install pyAgxArm
With piper-venv active, install the dependency and the current SDK directly from AgileX:
python -m pip install "python-can>3.3.4"
python -m pip install "git+https://github.com/agilexrobotics/pyAgxArm.git"
Confirm the version and import path:
python -m pip show pyAgxArm python-can
python -c "import pyAgxArm; print(pyAgxArm.__file__)"
pyAgxArm path without ModuleNotFoundError.Step 4: Read the PiPER Firmware Version
PiPER firmware generations use different driver constants. First create a short read-only session with PiperFW.DEFAULT, request the controller information, and disconnect.
Save the following as piper_check_firmware.py:
from pyAgxArm import AgxArmFactory, ArmModel, PiperFW, create_agx_arm_config
config = create_agx_arm_config(
robot=ArmModel.PIPER,
firmeware_version=PiperFW.DEFAULT,
interface="socketcan",
channel="can0",
bitrate=1000000,
)
arm = AgxArmFactory.create_arm(config)
try:
arm.connect()
firmware = arm.get_firmware(timeout=2.0)
if firmware is None:
raise TimeoutError("PiPER returned no firmware information")
print(firmware)
print("software_version:", firmware.get("software_version"))
finally:
arm.disconnect()
Run it from the active virtual environment:
python piper_check_firmware.py
The official API intentionally spells the configuration keyword firmeware_version. Keep that spelling in code. The returned dictionary uses the correctly spelled key software_version.
| Reported PiPER software version | pyAgxArm constant |
|---|---|
| S-V1.8-9 or later | PiperFW.V189 |
| S-V1.8-8 | PiperFW.V188 |
| S-V1.8-3 through S-V1.8-7 | PiperFW.V183 |
| S-V1.8-2 or earlier | PiperFW.DEFAULT |
software_version string and select the corresponding constant. Do not guess the firmware family when the query returns nothing.Step 5: Read PiPER Joint Angles in Python
Replace PiperFW.V189 below if your firmware belongs to another row. Save the script as piper_read_joint_angles.py:
import time
from pyAgxArm import AgxArmFactory, ArmModel, PiperFW, create_agx_arm_config
config = create_agx_arm_config(
robot=ArmModel.PIPER,
firmeware_version=PiperFW.V189, # Match your reported firmware
interface="socketcan",
channel="can0",
bitrate=1000000,
)
arm = AgxArmFactory.create_arm(config)
try:
arm.connect()
deadline = time.monotonic() + 5.0
feedback = None
while time.monotonic() < deadline:
if arm.has_comm_error():
raise ConnectionError(str(arm.get_comm_error()))
feedback = arm.get_joint_angles()
if feedback is not None:
break
time.sleep(0.05)
if feedback is None:
raise TimeoutError("No joint-angle feedback within 5 seconds")
if len(feedback.msg) != 6:
raise ValueError("Expected six PiPER joint angles")
print("Joint angles (rad):", feedback.msg)
print("SDK timestamp:", feedback.timestamp)
print("Message-rate statistic (Hz):", feedback.hz)
finally:
arm.disconnect()
python piper_read_joint_angles.py
The first successful Python checkpoint is a six-value joint-angle message. Arm movement is not required.
What counts as a successful PiPER SDK setup?
-
get_joint_angles()returns a value instead ofNone. -
feedback.msgcontains six floating-point angles in radians, ordered joint 1 through joint 6. - The process reaches
disconnect()on both success and failure. -
feedback.hzis treated as observed telemetry, not a guaranteed fixed control rate.
AgileX PiPER SDK Troubleshooting Matrix
| Symptom or error | Likely layer | Safe next check |
|---|---|---|
externally-managed-environment |
Ubuntu 24.04 Python packaging | Create and activate ~/piper-venv; install with python -m pip inside it |
ModuleNotFoundError: pyAgxArm |
Python environment mismatch | Compare which python with python -m pip --version; reinstall in the interpreter used to run the script |
Cannot find device "can0" |
USB-CAN detection or naming | Check power and cabling; rerun find_all_can_port.sh with only the arm adapter connected |
RTNETLINK answers: Device or resource busy |
Existing CAN configuration | Bring the interface down before reconfiguring it |
can0 exists but is DOWN |
SocketCAN activation | Reactivate at the documented 1 Mbps bitrate and verify with ip -details link show can0
|
Network is down |
Python opened an inactive CAN device | Exit Python, bring can0 UP, then rerun the script |
has_comm_error() is true |
CAN communication | Print get_comm_error(); recheck power, supported adapter, cables, state, and bitrate |
get_firmware() returns None
|
No valid controller reply | Confirm traffic and CAN configuration; do not select a firmware enum by guesswork |
get_joint_angles() stays None
|
Incoming feedback or firmware mapping | Recheck the exact software_version and rebuild the driver with the documented PiperFW value |
Example imports C_PiperInterface
|
SDK mismatch | Use the complete piper_sdk example or the complete pyAgxArm example, never a hybrid |
To reset an incorrectly configured interface:
sudo ip link set can0 down
sudo ip link set can0 up type can bitrate 1000000
ip -details link show can0
To check whether frames are present without writing a motion command:
timeout 3 candump can0
What to Build After the Python SDK Works
Once the read-only checkpoint is repeatable, preserve it as a hardware diagnostic and add one layer at a time:
- ROS or ROS 2 integration: validate joint states, transforms, URDF selection, and controller interfaces.
- MoveIt and motion planning: verify collision geometry, joint limits, mounting orientation, payload, and low-speed test plans.
- Teleoperation and demonstration data: check time synchronization, camera identity, CAN-device naming, and emergency stopping.
- LeRobot or VLA policies: treat community integrations as project evidence rather than automatic compatibility guarantees.
Continue with the AgileX PiPER Isaac Lab teleoperation and HDF5 guide when the project needs simulation-to-teleoperation data. For demonstrations and embodiment datasets, see how to collect robot demonstration data with AgileX PiKA. If you are still selecting the hardware architecture, use the mobile manipulator vs robot arm decision guide.
AgileX PiPER Python SDK FAQ
Which Python SDK should I use for AgileX PiPER?
Use pyAgxArm for a new project unless an existing codebase already depends on piper_sdk. Keep the imports and method names from one SDK throughout the program.
What CAN bitrate does AgileX PiPER use?
The standard PiPER SocketCAN workflow documented here uses 1,000,000 bit/s. Verify the active interface with ip -details link show can0.
Does the PiPER Python SDK require ROS?
No. pyAgxArm can communicate with the arm directly through CAN. ROS or ROS 2 is a separate middleware layer that can be added after the low-level feedback test succeeds.
How do I install pyAgxArm on Ubuntu 24.04?
Create a Python virtual environment, activate it, and install python-can and pyAgxArm with python -m pip. This avoids the system Python's externally managed environment restriction.
Why does Ubuntu not detect can0?
Common causes include arm power, cabling, an unsupported or unrecognized CAN adapter, a changed interface name, or an adapter already configured under another name. Run the official detection script with only the PiPER adapter connected.
Why does get_joint_angles() return None?
First confirm that can0 is UP at 1 Mbps and that frames are present. Then query software_version and recreate the driver with the corresponding PiperFW constant.
Can I use an arbitrary USB-to-CAN adapter?
The official pyAgxArm CAN manual supports the CAN module supplied with the robotic arm and does not support arbitrary substitutes for its documented workflow.
AgileX PiPER Hardware Reference
AgileX PiPER 6-DOF Robotic Arm
The OpenELAB standard PiPER configuration lists a 1.5 kg rated payload, 626 mm reach, and ±0.1 mm repeatability for ROS, Python, education, and manipulation research.
View Product