[][src]Struct k::joint::Mimic

pub struct Mimic<T: RealField> {
    pub multiplier: T,
    pub origin: T,
}

Information for copying joint state of other joint

For example, Mimic is used to calculate the position of the gripper(R) from gripper(L). In that case, the code like below will be used.

let mimic_for_gripper_r = k::joint::Mimic::new(-1.0, 0.0);

output position (mimic_position() is calculated by joint positions = joint[name] * multiplier + origin

Fields

multiplier: Torigin: T

Methods

impl<T> Mimic<T> where
    T: RealField
[src]

pub fn new(multiplier: T, origin: T) -> Self[src]

Create new instance of Mimic

Examples

let m = k::joint::Mimic::<f64>::new(1.0, 0.5);

pub fn mimic_position(&self, from_position: T) -> T[src]

Calculate the mimic joint position

Examples

let m = k::joint::Mimic::<f64>::new(1.0, 0.5);
assert_eq!(m.mimic_position(0.2), 0.7); // 0.2 * 1.0 + 0.5
let m = k::joint::Mimic::<f64>::new(-2.0, -0.4);
assert_eq!(m.mimic_position(0.2), -0.8); // 0.2 * -2.0 - 0.4

Trait Implementations

impl<T: Clone + RealField> Clone for Mimic<T>[src]

impl<T: Debug + RealField> Debug for Mimic<T>[src]

impl<'a, T> From<&'a Mimic> for Mimic<T> where
    T: RealField
[src]

Auto Trait Implementations

impl<T> RefUnwindSafe for Mimic<T> where
    T: RefUnwindSafe

impl<T> Send for Mimic<T>

impl<T> Sync for Mimic<T>

impl<T> Unpin for Mimic<T> where
    T: Unpin

impl<T> UnwindSafe for Mimic<T> where
    T: UnwindSafe

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.