|
| 1 | +namespace rby1; |
| 2 | + |
| 3 | +// ------------------------------------------------- |
| 4 | +// RB-Y1 RobotState (gRPC 스트림 한 시점 스냅샷) |
| 5 | +// rby1 service 의 on_state 콜백이 zenoh 로 publish, |
| 6 | +// common 이 구독해 state_core 캐시/연결상태 판정에 사용. |
| 7 | +// 필드명은 rb_sdk.schema.rby1_schema.RobotStateTD 와 1:1 대응. |
| 8 | +// ------------------------------------------------- |
| 9 | + |
| 10 | +// 단일 관절 상태 (RobotStateTD.joint_states[*]) |
| 11 | +table JointState { |
| 12 | + index: int; // 관절 인덱스 (0-based) |
| 13 | + name: string; // 관절 이름 (urdf link, 있을 때만) |
| 14 | + |
| 15 | + is_ready: bool; |
| 16 | + fet_state: string; // FETState enum name |
| 17 | + run_state: string; // RunState enum name (예: "ControlOn") |
| 18 | + init_state: string; // InitializationState enum name |
| 19 | + motor_type: int; |
| 20 | + motor_state: int; |
| 21 | + power_on: bool; |
| 22 | + |
| 23 | + position: float; // [rad] |
| 24 | + velocity: float; // [rad/s] |
| 25 | + current: float; // [A] |
| 26 | + torque: float; // [Nm] |
| 27 | + temperature: float; // [°C] |
| 28 | +} |
| 29 | + |
| 30 | +// 제어 매니저 상태 (RobotStateTD.control_manager / ControlManagerStateTD) |
| 31 | +table ControlManagerState { |
| 32 | + state: string; // ControlManagerState.State enum name |
| 33 | + control_state: string; // ControlState enum name |
| 34 | + enabled_joint_idx: [int]; |
| 35 | + time_scale: float; |
| 36 | + unlimited_mode_enabled: bool; |
| 37 | +} |
| 38 | + |
| 39 | +// 전체 RobotState 스냅샷 |
| 40 | +table RobotState { |
| 41 | + robot_model: string; // 예: "RBY1-A" |
| 42 | + timestamp_usec: ulong; // 단조증가 타임스탬프 [usec] |
| 43 | + |
| 44 | + // rby1 on_state 가 미리 계산하는 집계 플래그 (연결상태 판정용) |
| 45 | + is_power_on: bool; // 모든 관절 power_on |
| 46 | + is_servo_on: bool; // 모든 관절 run_state == "ControlOn" |
| 47 | + |
| 48 | + joint_states: [JointState]; |
| 49 | + control_manager: ControlManagerState; |
| 50 | +} |
| 51 | + |
| 52 | +root_type RobotState; |
0 commit comments