Skip to main content

Track

Struct Track 

Source
pub struct Track {
    pub straight: f64,
    pub radius: f64,
    pub clothoid: f64,
    pub curve: f64,
    pub length: f64,
    pub width: f64,
    pub segments: Vec<f64>,
    /* private fields */
}
Expand description

The closed track’s centre line: straight 1 from the origin along +x, curve 1, straight 2 back along -x at the track’s width, curve 2; and its motor segments (each straight cut into modules, each curve one).

Fields§

§straight: f64§radius: f64§clothoid: f64§curve: f64

One curve’s length, pi R + clothoid.

§length: f64

The loop, 2 straight + 2 curve.

§width: f64

The distance between the straights (the curve’s “diameter” in Beckhoff’s catalogue).

§segments: Vec<f64>

Where each segment starts along the loop, rising from 0; the last ends at length.

Implementations§

Source§

impl Track

Source

pub fn new( straight: f64, module: f64, radius: f64, clothoid: f64, ) -> Result<Self, ConfigError>

Source

pub fn heading(&self, s: f64) -> f64

The heading at s, unwrapped (2 pi more per loop).

Source

pub fn curvature(&self, s: f64) -> f64

The curvature at s, 1/m, positive turning left.

Source

pub fn mean_curvature(&self, s: f64, w: f64) -> (f64, f64)

The curvature a body on rollers w apart follows at s, its mean over [s - w/2, s + w/2], and its rate along s.

Source

pub fn mean_heading(&self, s: f64, w: f64) -> f64

The heading of a body on rollers w apart at s, its mean over [s - w/2, s + w/2]: its rate along s is mean_curvature’s, the curvature the body follows.

Source

pub fn point(&self, s: f64) -> [f64; 2]

The centre line’s point at s (m, in the track’s plane).

Source

pub fn tangent(&self, s: f64) -> [f64; 2]

The centre line’s direction at s, d point / ds: a unit vector, along the curve’s chord between two of its table’s points, where point runs.

Source

pub fn segment(&self, j: usize) -> (f64, f64)

Segment j’s start and end along the loop.

Source

pub fn is_curve(&self, j: usize) -> bool

Whether segment j is a curve (one segment each), else a straight module.

Source

pub fn share(&self, s: f64, plate: f64, j: usize) -> f64

The share of a plate of length plate centred at s that lies over segment j.

Trait Implementations§

Source§

impl Clone for Track

Source§

fn clone(&self) -> Track

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Debug for Track

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl Freeze for Track

§

impl RefUnwindSafe for Track

§

impl Send for Track

§

impl Sync for Track

§

impl Unpin for Track

§

impl UnsafeUnpin for Track

§

impl UnwindSafe for Track

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