Skip to main content

PulseRun

Struct PulseRun 

Source
pub struct PulseRun<'a> {
    pub state: Vec<f64>,
    pub hold: Vec<f64>,
    pub torque: Vec<f64>,
    pub substeps: u32,
    /* private fields */
}
Expand description

A run that starts at rest, gets one smooth torque pulse and then only the holding torques.

Fields§

§state: Vec<f64>§hold: Vec<f64>§torque: Vec<f64>

The torques of the last step.

§substeps: u32

Implementations§

Source§

impl<'a> PulseRun<'a>

Source

pub fn new(m: &'a dyn Machine, dt: f64, acc_fraction: f64, pulse_s: f64) -> Self

The pulse is sin^2 shaped, pulse_s long, and asks for acc_fraction of each axis’s acceleration limit at its peak.

Source

pub fn tool_pos(&self) -> Vec<f64>

Source

pub fn run(&mut self, seconds: f64, each: impl FnMut(&Self))

Auto Trait Implementations§

§

impl<'a> !RefUnwindSafe for PulseRun<'a>

§

impl<'a> !Send for PulseRun<'a>

§

impl<'a> !Sync for PulseRun<'a>

§

impl<'a> !UnwindSafe for PulseRun<'a>

§

impl<'a> Freeze for PulseRun<'a>

§

impl<'a> Unpin for PulseRun<'a>

§

impl<'a> UnsafeUnpin for PulseRun<'a>

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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