Skip to content

missing

📘 RBQ ROS2 SDK 소개

RBQ ROS2 SDK 메뉴얼에 오신 것을 환영합니다.

  • 이 가이드는 ROS2를 통해 RBQ 로봇을 시뮬레이션과 실제 하드웨어에서 제어하고 시각화하는 방법을 빠르게 시작할 수 있도록 도와줍니다.

이 SDK가 제공하는 기능

이 SDK는 다음과 같은 주요 기능을 제공합니다:

  • 로봇 제어: 자세 제어, 보행 전환, 위치 기반 내비게이션 실행
  • 센서 피드백 스트리밍: IMU, 발 접촉, 배터리 상태 등 지속적인 데이터 제공
  • 비전 데이터 스트리밍: 전방, 후방, 하방 및 좌우 카메라 데이터를 제공하여 인지 및 내비게이션 지원
  • RViz2 시각화: 로봇 상태 및 LiDAR 등 센서를 실시간으로 시각화

💻 시스템 요구사항

구성 요소필요 환경
운영체제
ROS 2 배포판
Python 버전

📝 아래의 모든 CLI 명령어는 메인 디렉토리에서 실행하는 것을 기준으로 합니다.



🛠️ 환경 설정

  • 이 패키지는 Ubuntu 22.04ROS 2 Humble에서 테스트되었습니다. 설치는 다음 명령어로 진행합니다.

    bash
    bash scripts/install/ros.bash
  • ROS Humble 환경 불러오기:

    bash
    source /opt/ros/humble/setup.bash
  • rosdep 초기화 및 의존성 업데이트:

    bash
    sudo rosdep init && rosdep update

📦 설치

  • ros2 디렉토리로 이동 후 ROS 의존성 설치

    bash
    cd ros2
    rosdep install --from-paths src -y --ignore-src
  • rbq_ros2 패키지 빌드

    bash
    colcon build --symlink-install

▶️ 노드 실행

  • rbq_driver 실행
    • 시뮬레이션 환경에서는 -s 인자 추가
bash
source ros2/install/local_setup.bash
ros2 run rbq_driver rbq_driver

RBQ 드라이버는 ROS 2에서 RBQ 제어에 필요한 모든 토픽을 포함하고 있습니다

rbq_driver 실행 시 시작되는 노드들:

  • 로봇 상태 (Robot state) publisher
  • 센서 피드백 퍼블리셔 (IMU, 배터리, 발 접촉)
  • 비전 데이터 퍼블리셔 (전방, 후방, 좌우, 하방 카메라)
  • 상위 제어 명령 (High-level command) subscriber
  • rbq_description 실행
    bash
    source ros2/install/local_setup.bash
    ros2 launch rbq_description description.launch.py

🧪 활성 토픽 확인

bash
source ros2/install/local_setup.bash
ros2 topic list

로봇 상태값

🦿 1. 보행 토픽 (Gait State)

Gait state는 로봇의 현재 보행 모드나 자세 모드를 의미합니다. 이 상태 전환은 상위 제어, 센서 조건, 내부 로직에 의해 발생합니다.


missing

사용 가능한 Gait 상태 :

State ID상태설명
-2Fall Mode예기치 않게 균형을 잃었을 때 진입하는 모드
-1Control Off모든 구동기가 비활성화됨
0Sitting낮은 자세, 바닥에 앉아 있는 상태
1Standing기본 자세, 보행 준비 상태
2Walk Mode트롯 보행 모드
4Stairs Mode카메라 센서를 이용한 계단 적응 보행 모드
5Wave Mode워크 보행 모드
6Run Mode고속 보행 모드 (지원되는 경우)

두 번째 열에 있는 Command 토픽은 로봇이 해당 Gait State에 있을 때만 사용할 수 있습니다.
반대로, Common Command 토픽Power Control 토픽은 보행 상태와 관계없이 항상 사용할 수 있습니다.

보행 상태(Gait state)Command topicsCommon Command topicsPower control topics
Control Offrbq/autoStartrbq/cmd_highLevel

rbq/emergency

rbq/staticLock
rbq/staticReady
rbq/staticGround

rbq/switchGamepadPort
rbq/powerLeg
rbq/powerVisionPC
rbq/powerUsbHub
rbq/powerLidar
rbq/powerExt52v
Sitting Moderbq/stand
rbq/calibrateImu
Standing Mode rbq/sit                       rbq/stairs
rbq/walk                    rbq/wave
rbq/run
rbq/cmd_navigateTo
rbq/comEstimationCompensation
Walk Mode
(when robot stand by)
rbq/sit                       rbq/stairs
rbq/walk                    rbq/wave
rbq/run
Stairs Mode
(when robot stand by)
rbq/stand
rbq/walk
Run Moderbq/stand
rbq/walk
Wave Mode
(when robot stand by)
rbq/stand
rbq/walk
rbq/cmd_navigateTo
Fall Moderbq/RecoveryFlex

📡 2. 로우 레벨 토픽 (Low-level State)

로봇의 내부 상태(자세, 센서 읽기값, 시스템 상태)를 실시간으로 제공하는 토픽들입니다.

토픽데이터 구조설명
RobotStateint8 gait_state
bool joints_comm_checked
bool joints_calibrated
bool joints_control_started
bool comm_connected
sensor_msgs/Imu imu_state
sensor_msgs/JointState joint_states
rbq_msgs/BatteryState battery_state
rbq_msgs/FootState[] foot_states
geometry_msgs/VelocityStamped body_velocity_rt_world
geometry_msgs/PoseStamped body_pose_rt_world
이 메시지는 로봇 상태 정보를 포함하며 50Hz로 발행됩니다. ‘BatteryState’와 ‘FootState’ 메시지는 RBQ에 대해 정의되어 있습니다. 그 외 메시지들은 표준 ROS 메시지 타입으로 정의되어 있습니다.
# GaitState
int8 STATE_FALL = -2
int8 STATE_OFF = -1
int8 STATE_SIT = 0
int8 STATE_STAND = 1
int8 STATE_WALK = 2
int8 STATE_AIM = 3
int8 STATE_STAIRS = 4
int8 STATE_WAVE = 5
int8 STATE_RUN = 6
BatteryStatestring identifier
float64 charge_percentage
builtin_interfaces/Duration estimated_runtime
float64 current
float64 voltage
float64[] temperatures
uint8 status
# Status
uint8 STATUS_UNKNOWN = 0
uint8 STATUS_MISSING = 1
uint8 STATUS_CHARGING = 2
uint8 STATUS_DISCHARGING = 3
uint8 STATUS_BOOTING = 4
FootStategeometry_msgs/Point foot_position_rt_body
geometry_msgs/Point foot_velocity_rt_body
uint8 contact
로컬 바디 프레임 기준의 발 위치와 속도입니다. 바디 프레임의 원점은 로봇 몸체의 중심에 있으며, 앞쪽 방향은 +x, 왼쪽 방향은 +y, 위쪽 방향은 +z로 정의됩니다.
# Contact
uint8 CONTACT_UNKNOWN = 0
uint8 CONTACT_MADE = 1
uint8 CONTACT_LOST = 2
Leg num 0 : Right-Hind leg (RH)
Leg num 1 : Left-Hind Leg (LH)
Leg num 2 : Right-Front Leg (RF)
Leg num 3 : Left-Front Leg (LF)

상태(State) 메시지는 다음과 같이 정의됩니다:

  • RobotState
bash
# GaitState
int8 STATE_FALL = -2
int8 STATE_OFF = -1
int8 STATE_SIT = 0
int8 STATE_STAND = 1
int8 STATE_WALK = 2
int8 STATE_AIM = 3
int8 STATE_STAIRS = 4
int8 STATE_WAVE = 5
int8 STATE_RUN = 6

std_msgs/Header header
int8 gait_state
bool joints_comm_checked
bool joints_calibrated
bool joints_control_started
bool comm_connected
sensor_msgs/Imu imu_state
sensor_msgs/JointState joint_states
rbq_msgs/BatteryState battery_state
rbq_msgs/FootState[] foot_states
geometry_msgs/VelocityStamped body_velocity_rt_world
geometry_msgs/PoseStamped body_pose_rt_world
  • BatteryState
bash
# Status
uint8 STATUS_UNKNOWN = 0
uint8 STATUS_MISSING = 1
uint8 STATUS_CHARGING = 2
uint8 STATUS_DISCHARGING = 3
uint8 STATUS_BOOTING = 4

std_msgs/Header header
string identifier
float64 charge_percentage
float64 current
float64 voltage
float64[] temperatures
uint8 status
  • FootState
bash
# 접촉
uint8 CONTACT_UNKNOWN = 0
uint8 CONTACT_MADE = 1
uint8 CONTACT_LOST = 2

geometry_msgs/Point foot_position_rt_body
geometry_msgs/Point foot_velocity_rt_body
uint8 contact
  • FootStates
bash
std_msgs/Header header
rbq_msgs/FootState[] foot_states

로봇 제어

🎮 3. 제어 토픽

RBQ 로봇에 상위 제어 명령을 보내는 토픽 목록입니다. 모든 명령은 ROS 2 표준 메시지 타입 또는 rbq_msgs 정의를 따릅니다.

Command 토픽은 다음과 같이 정의됩니다 :

토픽설명
autoStart조인트 위치를 초기화하고 조인트 제어를 시작합니다. AutoStart 과정은 ‘InitState’ 토픽을 통해 확인할 수 있습니다. 순서: CAN 확인 → 원점 찾기(Find Home) → 제어 시작 플래그가 활성화됨
DampingMode로봇이 다리 관절에 감쇠(damping)를 적용하여 스스로 낮아지도록 합니다.
EmergencyOff로봇의 다리 관절 전원을 강제로 차단합니다. 이 동작은 로봇에 충격을 줄 수 있습니다.
Fall_Recovery‘Fall_Recovery’ 토픽은 로봇이 Fall 모드일 때만 받아들여집니다. 이 명령은 특정 관절 동작을 통해 로봇을 Sitting 모드로 복귀시키도록 합니다.
rbq/cmd_highLevel
{
float64 roll
float64 pitch
float64 yaw
float64 vel_x
float64 vel_y
float64 omega_z
float64 delta_body_h
float64 delta_foot_h
}
HighLevelCMD 토픽은 로봇의 현재 보행 상태(Gait State)에 따라 상위 제어 명령을 내릴 수 있도록 합니다.

Standing Mode
Standing 모드에서 ZYX 오일러 각(roll, pitch, yaw)에 따라 로봇의 몸체 자세를 조정합니다. 매개변수 body_H는 로봇 몸체의 높이를 지정합니다.
- 범위
Roll : -25 ~ 25 deg
Pitch : -20 ~ 20deg
Yaw : -25 ~ 25deg
Delta_body_height : -0.15 ~ 0.05 m

토픽설명
rbq/cmd_highLevel
{
float64 roll
float64 pitch
float64 yaw
float64 vel_x
float64 vel_y
float64 omega_z
float64 delta_body_h
float64 foot_h
}
Walk Mode
트롯 보행 상태에서 로봇의 로컬 좌표계 기준 이동 속도를 설정합니다. Vx, Vy는 각각 전진 속도와 측방향 속도를 의미하며, Wz는 회전 속도를 의미합니다. 트롯 보행 동안 delta_body_H는 기본 몸체 높이에서의 몸체 높이를 설정하는 데 사용되고, foot_H는 발 높이를 설정하며, pitch는 몸체의 피치 각도를 설정하는 데 사용됩니다.
범위
Vx : - 1.0 ~ 1.2 m/s
Vy : - 0.4 ~ 0.4 m/s
Wz: -75 ~ 75 des/s
Delta_Body_H : -0.15 ~ +0.05 m (default : 0.45)
pitch: -15 ~ 15 deg
Delta_foot_H : -0.06 ~ + 0.04 m (default : 0.14)

Stairs Mode
계단(Stairs) 모드에서 로컬 프레임 기준으로 로봇의 전진, 측방향, 회전 속도를 지정합니다.
범위
Vx : -0.5 ~ 0.5 m/s
Vy : - 0.2 ~ 0.2 m/s
Wz: -15 ~ 15 deg/s

토픽설명
rbq/cmd_highLevel
{
float64 roll
float64 pitch
float64 yaw
float64 vel_x
float64 vel_y
float64 omega_z
float64 delta_body_h
float64 delta_foot_h
}
Run Mode
Run 모드에서 로컬 프레임 기준으로 로봇의 전진, 측방향, 회전 속도를 지정합니다.
범위
Vx : - 1m/s ~ 1.8 m/s
Vy : - 0.6 m/s ~ 0.6 m/s
Wz: - 75 deg/s ~ 75 deg/s

Wave Mode
Wave 모드에서 로컬 프레임 기준으로 로봇의 전진, 측방향, 회전 속도를 지정합니다.
범위
Vx : - 0.3 m/s ~ 0.3 m/s
Vy : - 0.2 m/s ~ 0.2 m/s
Wz: -20deg/s ~ 20deg/s
rbq/cmd_navigateTo
{
Geometry_msgs::Pose
uint8 mode
}
이 명령은 선택된 ‘approach_mode’에 따라, 현재 로봇 로컬 프레임에서 ‘Pose’ 타입으로 정의된 위치로 로봇을 이동시킵니다.

Approach Mode
0 : 목표 지점까지 회전 → 직선 보행 → 목표 자세(yaw)로 회전
1 : 목표 자세(yaw)로 회전 → 목표 지점까지 대각선 보행
2 : 목표 지점까지 대각선 보행 → 목표 자세(yaw)로 회전
3 : 목표 자세(yaw)로 회전하면서 동시에 목표 지점까지 대각선 보행
4 : 모드 3과 동일하나, 보행 시 다리를 넓게 사용

High-Level Command의 메시지는 다음과 같이 정의됩니다:

  • HighLevelCommand
bash
std_msgs/Header header
string identifier
float64 roll
float64 pitch
float64 yaw
float64 vel_x
float64 vel_y
float64 omega_z
float64 delta_body_h
float64 delta_foot_h

토픽 예제

/rbq/setPanTiltZoom

setPanTiltZoom 명령의 메시지는 Float32MultiArray로 정의되며,
구성 요소는 pan, tilt, zoom입니다.

💡 example:

bash
ros2 topic pub --once /rbq/setPanTiltZoom std_msgs/msg/Float32MultiArray "{data: [0.0, 0.0, 1.0]}"

🖼️ RViz 시각화

GUI와 함께 RViz2 실행

RViz의 왼쪽 GUI를 통해 로봇을 동시에 시각화하고 명령을 전송할 수 있습니다.


📘 도움

이 저장소를 사용하는 동안 문제가 발생하면, 자유롭게 issue를 등록해 주세요.


🤝 기여

자유롭게 기여해 주세요!


👥 기여자

이 프로젝트는 Rainbow-Robotics에서 제공합니다.

Rainbow-Robotics 기여자:

  • Gurbann

  • Jinwon Seo

This user manual is intended for RBQ users.