pub struct JointControl12 {
pub j1_deg: i32,
pub j2_deg: i32,
}Expand description
机械臂臂部关节控制指令12 (0x155)
用于控制 J1 和 J2 关节的目标角度。
单位:0.001°(原始值),可通过 new() 方法从物理量(度)创建。
Fields§
§j1_deg: i32§j2_deg: i32Implementations§
Source§impl JointControl12
impl JointControl12
Sourcepub fn new(j1: f64, j2: f64) -> JointControl12
pub fn new(j1: f64, j2: f64) -> JointControl12
从物理量(度)创建关节控制指令
注意:使用 round() 进行四舍五入,与 Python SDK 保持一致。
Python SDK 使用 round(pos_deg * 1e3) 进行转换。
Sourcepub fn to_frame(self) -> PiperFrame
pub fn to_frame(self) -> PiperFrame
转换为 CAN 帧
Trait Implementations§
Source§impl Clone for JointControl12
impl Clone for JointControl12
Source§fn clone(&self) -> JointControl12
fn clone(&self) -> JointControl12
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 JointControl12
impl Debug for JointControl12
Source§impl Default for JointControl12
impl Default for JointControl12
Source§fn default() -> JointControl12
fn default() -> JointControl12
Returns the “default value” for a type. Read more
impl Copy for JointControl12
Auto Trait Implementations§
impl Freeze for JointControl12
impl RefUnwindSafe for JointControl12
impl Send for JointControl12
impl Sync for JointControl12
impl Unpin for JointControl12
impl UnwindSafe for JointControl12
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