소프트웨어 설정
SDK 설치, CAN 드라이버 설정, ROS2 컨트롤러 구성, O6용 LeRobot 통합, Python API 예제 및 주요 문제 해결 문제. 새로운 Ubuntu 설치부터 움직이는 팔까지.
섹션으로 이동:
SDK 설치
LinkerBot O6 SDK는 팔의 CAN 버스 인터페이스에 대한 Python 바인딩을 제공합니다. 이는 RoboticsCenter 플랫폼 패키지에 포함되어 있습니다.
가상 환경 만들기(권장)
python3 -m venv ~/.venvs/linkerbot-o6
source ~/.venvs/linkerbot-o6/bin/activate
SDK 설치
pip install roboticscenter
설치 확인
python3 -c "from linkerbot import LinkerBotO6; print('SDK ready')"
소스에서 설치(선택 사항)
git clone https://github.com/linkerbot/linkerbot_sdk.git
cd linkerbot_sdk
pip install -e .
CAN 드라이버 설정
LinkerBot O6은 OpenArm 101과 동일한 SocketCAN 아키텍처를 사용합니다. OpenArm용 CAN을 설정한 경우 이 프로세스는 동일합니다. CAN 버스 드라이버는 Linux 커널에 내장되어 있습니다.
커널 모듈 로드
sudo modprobe can
sudo modprobe can_raw
sudo modprobe slcan # for USB CAN adapters (CANable)
CAN 인터페이스 불러오기
# Find the USB serial device
ls /dev/ttyACM*
# Bring up CAN interface at 1 Mbps
sudo slcand -o -c -s8 /dev/ttyACM0 can0
sudo ip link set up can0
인터페이스가 작동 중인지 확인
ip link show can0
# Expected: can0: <NOARP,UP,LOWER_UP> mtu 16 ...
CAN 통신 테스트
sudo apt install can-utils -y
candump can0
# Power on the O6 and look for motor heartbeat packets
재부팅 후에도 지속되도록 설정
시스템 서비스 생성 또는 추가 /etc/rc.local. 참조 SocketCAN 설정 가이드 — 절차는 O6과 동일합니다.
ROS2 컨트롤러 설정
그만큼 linkerbot_ros2 패키지는 O6에 대한 전체 ros2_control 하드웨어 인터페이스를 제공합니다. 팔 없이 테스트하기 위한 가짜 하드웨어 모드가 포함되어 있습니다.
ROS2 험블 설치
sudo apt update && sudo apt install software-properties-common curl -y
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | \
sudo apt-key add -
sudo sh -c 'echo "deb http://packages.ros.org/ros2/ubuntu jammy main" \
> /etc/apt/sources.list.d/ros2.list'
sudo apt update
sudo apt install ros-humble-desktop ros-humble-ros2-control \
ros-humble-ros2-controllers ros-humble-joint-state-publisher-gui -y
linkerbot_ros2 복제 및 빌드
mkdir -p ~/o6_ws/src && cd ~/o6_ws/src
git clone https://github.com/linkerbot/linkerbot_ros2.git
cd ~/o6_ws
source /opt/ros/humble/setup.bash
colcon build --symlink-install
가짜 하드웨어 모드로 실행(암 필요 없음)
source ~/o6_ws/install/setup.bash
ros2 launch linkerbot_ros2 o6.launch.py use_fake_hardware:=true
실제 하드웨어로 출시
ros2 launch linkerbot_ros2 o6.launch.py \
use_fake_hardware:=false \
can_interface:=can0
관절 상태 확인
ros2 topic echo /joint_states
O6을 위한 르로봇 통합
LeRobot은 LinkerBot O6을 기본적으로 지원합니다. 로봇 유형을 구성하고 기록 및 훈련을 위한 표준 LeRobot 워크플로를 따르세요.
르로봇 설치
pip install lerobot
O6 로봇 구성
# ~/.lerobot/robots/linkerbot_o6.yaml
robot_type: linkerbot_o6
can_interface: can0
num_joints: 6
camera_names:
- wrist_cam
- overhead_cam
데이터 세트 기록
python -m lerobot.scripts.control_robot \
--robot.type=linkerbot_o6 \
--control.type=record \
--control.fps=30 \
--control.repo_id=your-username/o6-pick-place \
--control.num_episodes=50 \
--control.single_task="Pick up the red cube"
HuggingFace 허브에 업로드
huggingface-cli login
python -m lerobot.scripts.push_dataset_to_hub \
--repo_id=your-username/o6-pick-place
참조 데이터 수집 페이지 품질 검사를 포함한 전체 작업 흐름을 위해.
Python API 예
LinkerBot Python SDK는 ROS2 없이도 직접 공동 제어를 제공합니다. OpenArm SDK와 동일한 패턴입니다.
기본 관절 제어
from linkerbot import LinkerBotO6
# Connect to the arm
arm = LinkerBotO6(can_interface="can0")
arm.connect()
arm.enable_all()
# Move joint 1 to 45 degrees (0.785 rad)
arm.set_position(joint_id=1, position=0.785, kp=50, kd=1)
# Read current state
state = arm.get_state()
print(f"Positions (rad): {state.positions}")
print(f"Velocities (rad/s): {state.velocities}")
print(f"Torques (Nm): {state.torques}")
# Safe shutdown
arm.disable_all()
arm.disconnect()
제어 루프의 모든 조인트 읽기
import time
from linkerbot import LinkerBotO6
arm = LinkerBotO6(can_interface="can0", control_rate_hz=500)
arm.connect()
arm.enable_all()
for _ in range(500): # 1 second at 500 Hz
state = arm.get_state()
print(state.positions)
time.sleep(1 / 500)
arm.disable_all()
arm.disconnect()
궤적 실행
from linkerbot import LinkerBotO6, JointTrajectory
import numpy as np
arm = LinkerBotO6(can_interface="can0")
arm.connect()
arm.enable_all()
# Define a waypoint trajectory
waypoints = [
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
[0.5, -0.3, 0.8, 0.0, 0.4, 0.0],
[0.0, 0.0, 0.0, 0.0, 0.0, 0.0],
]
durations = [2.0, 2.0, 2.0] # seconds per segment
traj = JointTrajectory(waypoints=waypoints, durations=durations)
arm.execute_trajectory(traj)
arm.disable_all()
arm.disconnect()
상위 3가지 일반적인 문제
no such device can0
SocketCAN 인터페이스가 작동되지 않습니다. 거의 항상 USB CAN 어댑터가 연결되지 않았거나 커널 모듈이 로드되지 않았기 때문입니다.
고치다:
# 1. Verify USB adapter is detected
lsusb | grep -i "can\|serial"
# 2. Load the kernel modules
sudo modprobe can && sudo modprobe can_raw && sudo modprobe slcan
# 3. Bring up the interface
sudo slcand -o -c -s8 /dev/ttyACM0 can0
sudo ip link set up can0
# 4. Verify
ip link show can0
arm.enable_all()
모터가 명령을 수신하지 못합니다. 가장 일반적으로 잘못된 CAN ID, CAN 버스 오류 프레임 또는 전원 공급 장치 전압 부족으로 인해 발생합니다.
고치다:
# 1. Check for CAN error frames
candump can0 | grep -i "error"
# 2. Check power supply — O6 requires 24V @ 150W minimum
# 3. Scan for motors and verify IDs
python3 -c "from linkerbot import LinkerBotO6; a=LinkerBotO6('can0'); a.scan_motors()"
# 4. Power cycle the arm and retry
robot not found
LeRobot이 O6 로봇 구성을 찾을 수 없거나 LeRobot이 시작될 때 CAN 인터페이스가 작동하지 않습니다.
고치다:
# 1. Verify CAN interface is up before starting LeRobot
ip link show can0
# 2. Verify config file path and format
cat ~/.lerobot/robots/linkerbot_o6.yaml
# 3. Test direct SDK connection first
python3 -c "
from linkerbot import LinkerBotO6
a = LinkerBotO6(can_interface='can0')
a.connect()
print('Connected:', a.get_state())
a.disconnect()"
# 4. Then retry LeRobot
python -m lerobot.scripts.control_robot \
--robot.type=linkerbot_o6 \
--control.type=teleoperate