pub struct RobotControlState {
pub hardware_timestamp_us: u64,
pub system_timestamp_us: u64,
pub control_mode: u8,
pub robot_status: u8,
pub move_mode: u8,
pub teach_status: u8,
pub motion_status: u8,
pub trajectory_point_index: u8,
pub fault_angle_limit_mask: u8,
pub fault_comm_error_mask: u8,
pub is_enabled: bool,
pub feedback_counter: u8,
}Expand description
机器人控制状态
更新频率:~200Hz CAN ID:0x2A1
Fields§
§hardware_timestamp_us: u64硬件时间戳(微秒)
system_timestamp_us: u64系统接收时间戳(微秒)
control_mode: u8控制模式
robot_status: u8机器人状态
move_mode: u8MOVE 模式
teach_status: u8示教状态
motion_status: u8运动状态
trajectory_point_index: u8轨迹点索引
fault_angle_limit_mask: u8故障码:角度超限位(位掩码,Bit 0-5 对应 J1-J6)
优化:使用位掩码而非 [bool; 6],节省内存并提高Cache Locality
fault_comm_error_mask: u8故障码:通信异常(位掩码,Bit 0-5 对应 J1-J6)
is_enabled: bool使能状态(从 robot_status 推导)
feedback_counter: u8反馈指令计数器(如果协议支持,用于检测链路卡死)
注意:如果协议中没有循环计数器,此字段为 0
Implementations§
Source§impl RobotControlState
impl RobotControlState
Sourcepub fn is_angle_limit(&self, joint_index: usize) -> bool
pub fn is_angle_limit(&self, joint_index: usize) -> bool
检查指定关节是否角度超限位
Sourcepub fn is_comm_error(&self, joint_index: usize) -> bool
pub fn is_comm_error(&self, joint_index: usize) -> bool
检查指定关节是否通信异常
Trait Implementations§
Source§impl Clone for RobotControlState
impl Clone for RobotControlState
Source§fn clone(&self) -> RobotControlState
fn clone(&self) -> RobotControlState
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RobotControlState
impl Debug for RobotControlState
Source§impl Default for RobotControlState
impl Default for RobotControlState
Source§fn default() -> RobotControlState
fn default() -> RobotControlState
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for RobotControlState
impl RefUnwindSafe for RobotControlState
impl Send for RobotControlState
impl Sync for RobotControlState
impl Unpin for RobotControlState
impl UnwindSafe for RobotControlState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more