Preliminary testing and control scripts for I2RT YAM robot arms.
conda create -n yam_arms python=3.11 -y
conda activate yam_arms
pip install -e robots_realtime/dependencies/i2rtBring up the CAN interface before running any arm commands:
sudo ip link set can0 up type can bitrate 1000000To verify:
ip link show can0
# Should show state UPIf the adapter is unresponsive, reset it:
sudo bash robots_realtime/dependencies/i2rt/scripts/reset_all_can.shpython robots_realtime/dependencies/i2rt/test_arm.py --channel can0 --read-onlyContinuously prints all 7 joint positions (6 arm + 1 gripper). Ctrl+C to exit.
python robots_realtime/dependencies/i2rt/test_arm.py --channel can0Interactive step-by-step test that walks through each joint:
- Shoulder pan (joint 0, +/-0.3 rad)
- Shoulder pitch (joint 1, +0.3 rad)
- Elbow (joint 2, +0.3 rad)
- Wrist joints (joints 3-5, +/-0.3 rad each)
- Gripper (close then open)
Each step waits for Enter before moving. Ctrl+C to abort at any time.
Arm goes compliant so you can move it by hand:
python robots_realtime/dependencies/i2rt/i2rt/robots/motor_chain_robot.py --channel can0Opens and closes the gripper repeatedly:
python robots_realtime/dependencies/i2rt/i2rt/robots/motor_chain_robot.py --channel can0 --operation_mode test_gripperLocks the arm at its current pose:
python robots_realtime/dependencies/i2rt/i2rt/robots/motor_chain_robot.py --channel can0 --operation_mode stay_current_qposfrom i2rt.robots.get_robot import get_yam_robot
import numpy as np
robot = get_yam_robot(channel="can0")
# Read joint positions (7D: 6 arm joints + 1 gripper)
pos = robot.get_joint_pos()
# Command a target position
robot.command_joint_pos(np.array([0.0, 0.5, 1.0, 0.0, 0.0, 0.0, 0.8]))
# Smooth move to a target over 2 seconds
robot.move_joints(np.array([0.0, 0.5, 1.0, 0.0, 0.0, 0.0, 0.8]), time_interval_s=2.0)
# Gripper: index 6, range 0.0 (closed) to 0.8 (open)
# Cleanup
robot.close()| Type | Flag | Notes |
|---|---|---|
linear_4310 |
--gripper_type linear_4310 |
Default. Standard linear gripper |
linear_3507 |
--gripper_type linear_3507 |
Lightweight linear |
crank_4310 |
--gripper_type crank_4310 |
Zero-linkage crank |
no_gripper |
--gripper_type no_gripper |
Arm only, no gripper |
- "No such device": CAN interface is not up. Run
sudo ip link set can0 up type can bitrate 1000000. - "No module named 'i2rt'": Run
pip install -e robots_realtime/dependencies/i2rt. - Joint limit violation on startup: Arm may need recalibration. Move it to the zero position and power cycle.
- Motors unresponsive: Run
sudo bash robots_realtime/dependencies/i2rt/scripts/reset_all_can.shto reset the CAN adapter.