Skip to main content

PositionModeConfig

Struct PositionModeConfig 

Source
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: usize

Debounce 阈值:连续 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

Source§

fn clone(&self) -> PositionModeConfig

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PositionModeConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for PositionModeConfig

Source§

fn default() -> PositionModeConfig

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more