pub struct PositionModeConfig {
pub timeout: Duration,
pub debounce_threshold: usize,
pub poll_interval: Duration,
pub speed_percent: u8,
pub install_position: InstallPosition,
pub motion_type: MotionType,
pub send_strategy: SendStrategy,
}Expand description
位置模式配置(带 Debounce 参数)
术语说明:虽然名为 “PositionMode”,但实际支持多种运动规划模式 (关节空间、笛卡尔空间、直线、圆弧等),与 MIT 混合控制模式相对。
Fields§
§timeout: Duration使能超时
debounce_threshold: usizeDebounce 阈值:连续 N 次读到 Enabled 才认为成功
poll_interval: Duration轮询间隔
speed_percent: u8运动速度百分比(0-100)
用于设置 0x151 指令的 Byte 2(speed_percent)。 默认值为 50,表示 50% 的运动速度。 设置为 0 会导致机械臂不运动。
install_position: InstallPosition安装位置
用于设置 0x151 指令的 Byte 5(installation_pos)。
默认值为 InstallPosition::Invalid (0x00),表示无效值(不设置安装位置)。
根据官方 Python SDK,安装位置选项:
InstallPosition::Invalid(0x00): 无效值(默认)InstallPosition::Horizontal(0x01): 水平正装InstallPosition::SideLeft(0x02): 侧装左InstallPosition::SideRight(0x03): 侧装右
注意:此参数基于 V1.5-2 版本后支持,注意接线朝后。
motion_type: MotionType运动类型(新增)
默认为 Joint(关节空间运动),保持向后兼容。
重要:必须根据 motion_type 使用对应的控制方法:
Joint: 使用command_joint_positions()或motion_commander().send_position_command()Cartesian/Linear: 使用command_cartesian_pose()Circular: 使用move_circular()方法ContinuousPositionVelocity: 待实现
send_strategy: SendStrategy发送策略(新增)
默认为 SendStrategy::Auto,根据命令类型自动选择:
- 位置命令:使用 Reliable(队列模式,不丢失)
- MIT 力控命令:使用 Realtime(邮箱模式,零延迟)
配置建议:
- 轨迹控制:保持
Auto或显式设置为Reliable - 高频力控:仅在 MIT 模式下设置为
Realtime
Trait Implementations§
Source§impl Clone for PositionModeConfig
impl Clone for PositionModeConfig
Source§fn clone(&self) -> PositionModeConfig
fn clone(&self) -> PositionModeConfig
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 PositionModeConfig
impl Debug for PositionModeConfig
Source§impl Default for PositionModeConfig
impl Default for PositionModeConfig
Source§fn default() -> PositionModeConfig
fn default() -> PositionModeConfig
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PositionModeConfig
impl RefUnwindSafe for PositionModeConfig
impl Send for PositionModeConfig
impl Sync for PositionModeConfig
impl Unpin for PositionModeConfig
impl UnwindSafe for PositionModeConfig
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