Struct dynpick_force_torque_sensor::DynpickSensor[][src]

pub struct DynpickSensor { /* fields omitted */ }

Dynpick 6-axis force-torque sensor.

Implementations

impl DynpickSensor[src]

pub fn last_wrench(&self) -> Wrench[src]

Returns the latest wrench that is stored in this instance without communicaing the sensor.

Use Self::update instead to obtain a new wrench from the sensor.

Returns

Ok(sensor) if successfully connected, Err(reason) if failed.

pub fn sensitivity(&self) -> Sensitivity[src]

Returns the sensitivity of this sensor.

pub fn update(&mut self) -> Result<Wrench, Error>[src]

Communicating to the sensor, updates the latest wrench.

Returns

Ok(wrench) if succeeds, Err(reason) if failed.

pub fn zeroed_next(&mut self) -> Result<(), Error>[src]

If this method succeeds, the next wrench acquired by Self::update will be zeroed.
This methos is useful for zero-point calibration.

Examples

use dynpick_force_torque_sensor::{DynpickSensorBuilder, Triplet};

let mut sensor = DynpickSensorBuilder::open("/dev/ttyUSB0")
    .and_then(|b| b.set_sensitivity_by_builtin_data())
    .and_then(|b| b.build())
    .unwrap();

sensor.zeroed_next().unwrap();

let wrench = sensor.update().unwrap();

assert_eq!(wrench.force, Triplet::new(0.0, 0.0, 0.0));
assert_eq!(wrench.torque, Triplet::new(0.0, 0.0, 0.0));

pub fn receive_product_info(&mut self) -> Result<String, Error>[src]

Reads the product info from the sensor.

Returns

Ok(product_info) if succeeds, Err(reason) if failed.

pub fn inner_port(&self) -> &Box<dyn SerialPort>[src]

Returns the reference to the serial port for the sensor.

Auto Trait Implementations

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, 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.