返回LinkerBot O6 Path

硬件设置

设置SocketCAN并验证联合状态读取.从零开始设置完整的CAN巴士.

5个单位中的1个 · 硬件设置 · ~1.5小时

接上手臂,连接电源和CAN,在Linux上配置SocketCAN,验证现场共享状态读取.到最后,你将得到确认的工作硬件连接.

在启动之前将手臂固定在上. O6 在任何关节运动之前必须固定在安装板上或紧贴在工作台上.

步骤1:机械安装

  1. 通过提供的4×M6螺栓将O6基连接到安装板上.
  2. 动的动器会在您的关节反数据中引起振动.
  3. 折叠手臂到运输/家庭位置:所有关节在0°. 在启动之前手动地折叠手臂.

步骤2:电源连接

  1. 连接供应电源到臂的DC输入插座 (24V,15A).
  2. 首先不要启动完整的 CAN 公共汽车线.

步骤3:可巴士电缆

连接USB到CAN适配器在计算机和手臂的CAN端口之间.手臂上的连接器是标准的DE-9 (DB9)CAN连接器.

如果您已经为OpenArm配置了SocketCAN,请跳转到步骤4并检查T4正确出现.

步骤 4: 配置SocketCAN

电动手臂,然后配置您的Linux机器上的 CAN接口:

# Load kernel modules (required once per boot, or add to /etc/modules)
sudo modprobe can
sudo modprobe can_raw
sudo modprobe slcan

# Find the USB-CAN adapter device (usually /dev/ttyUSB0 or /dev/ttyACM0)
ls /dev/ttyUSB* /dev/ttyACM*

# Bring up the CAN interface at 1 Mbit/s
sudo slcand -o -c -s8 /dev/ttyUSB0 can0
sudo ip link set up can0

# Verify the interface is up
ip link show can0

如果接口不上,请检查手臂是否开启,并且识别USB适配器.

启动时可自动启动 (可选)

# Create a systemd service
sudo tee /etc/systemd/system/can0.service <<'EOF'
[Unit]
Description=CAN bus interface can0
After=network.target

[Service]
ExecStartPre=/sbin/modprobe can
ExecStartPre=/sbin/modprobe can_raw
ExecStartPre=/sbin/modprobe slcan
ExecStart=/usr/bin/slcand -o -c -s8 /dev/ttyUSB0 can0
ExecStartPost=/usr/sbin/ip link set up can0
RemainAfterExit=yes

[Install]
WantedBy=multi-user.target
EOF

sudo systemctl daemon-reload
sudo systemctl enable can0
sudo systemctl start can0

步骤5:检查联合状态阅读

安装LinkerBot SDK并确认联合远程测量正在流:

pip install roboticscenter

python3 - <<'EOF'
from roboticscenter.o6 import O6Robot

robot = O6Robot(can_interface="can0")
robot.connect()

state = robot.get_state()
print("Joint positions (rad):", state.joint_positions)
print("Joint velocities (rad/s):", state.joint_velocities)
print("Joint torques (Nm):", state.joint_torques)

robot.disconnect()
EOF

预期输出:每场6个浮点值,如果手臂处于原始位置,则都接近0.0. 如果您看到所有零点没有变化,请检查您的CAN线程.如果您得到了T6,运行T7并确认接口是T8.

第六步: 移动到家位置

发送命令将所有关节移动到零 (家庭) 位置,速度缓慢,以确认动机响应:

from roboticscenter.o6 import O6Robot
import time

robot = O6Robot(can_interface="can0")
robot.connect()

print("Moving to home position at 20% speed...")
robot.move_to_home(speed_fraction=0.2)
time.sleep(5)

state = robot.get_state()
print("Final joint positions:", state.joint_positions)
# All values should be near 0.0

robot.disable_torque()
robot.disconnect()
print("Done — joints are gravity-compensated")

单元1完成,当...

T9报告接口为UP.联合状态读取返回六个非零位置.臂响应主位置命令,关节被确认移动.CAN接口 survives a reboot (可选但建议).

[← 回到路径概述]