Struct bcar::BCar[][src]

pub struct BCar {
    pub pose: Pose,
    pub size: Size,
    pub motion: Motion,
}

Bicycle car object.

Examples

let bc = bcar::BCar::default();
assert_eq!(bc, bcar::BCar::new(
    bcar::Pose::default(),
    bcar::Size::default(),
    bcar::Motion::default(),
));

let bc = bcar::BCar::new_xyh(1.0, 2.0, 3.0);
assert_eq!(bc.pose, bcar::Pose::new(1.0, 2.0, 3.0));
let default_size = bcar::Size::default();
assert_eq!(bc.size, default_size);
assert_eq!(bc.motion, bcar::Motion::default());

Fields

pose: Posesize: Sizemotion: Motion

Implementations

impl BCar[src]

pub fn new(pose: Pose, size: Size, motion: Motion) -> BCar

Notable traits for BCar

impl Iterator for BCar type Item = BCar;
[src]

pub fn new_xyh(x: f64, y: f64, h: f64) -> BCar

Notable traits for BCar

impl Iterator for BCar type Item = BCar;
[src]

Return new BCar.

Arguments

  • x -- Horizontal coordinate of rear axle center.
  • y -- Vertical coordinate of rear axle center.
  • h -- The heading of the car in the interval [-pi, +pi] radians.

Examples

let bc = bcar::BCar::new_xyh(1.0, 2.0, 3.0);
let bc_pose = bc.pose;
assert_eq!(1.0, bc_pose.x);
assert_eq!(2.0, bc_pose.y);
assert_eq!(3.0, bc_pose.h);

pub fn default() -> BCar

Notable traits for BCar

impl Iterator for BCar type Item = BCar;
[src]

Return default BCar.

Examples

let bc = bcar::BCar::default();
let p = bcar::Pose::default();
let s = bcar::Size::default();
let m = bcar::Motion::default();
assert_eq!(bc, bcar::BCar::new(p, s, m));

pub fn size(&self) -> Size[src]

Return BCar size.

pub fn set_size(&mut self, s: Size)[src]

Set BCar dimensions.

Arguments

  • s -- New size of the car.

Examples

let size = bcar::Size::new(10.0, 2.0, 3.0, 4.0, 5.0);
let mut bc = bcar::BCar::new_xyh(1.0, 2.0, 3.0);
bc.set_size(size);
assert_eq!(bc.size, size);

pub fn pose(&self) -> Pose[src]

Return BCar pose.

pub fn set_pose(&mut self, p: Pose)[src]

Set BCar pose.

Arguments

  • p -- New pose of the car.

Examples

let pose = bcar::Pose::new(1.0, 4.0, 9.0);
let mut bc = bcar::BCar::new_xyh(1.0, 2.0, 3.0);
bc.set_pose(pose);
assert_eq!(bc.pose, pose);

pub fn motion(&self) -> Motion[src]

Return BCar motion.

pub fn set_motion(&mut self, m: Motion)[src]

Set BCar motion.

Arguments

  • m -- New motion of the car.

Examples

let m = bcar::Motion::new(10.0, 0.1);
let mut bc = bcar::BCar::new_xyh(1.0, 2.0, 3.0);
bc.set_motion(m);
assert_eq!(bc.motion, m);

pub fn drivable(&self, pose: Pose) -> bool[src]

Return if it's possible to drive to the pose trivially.

Trivially in this context means to reach the pose with combination of line-arc-line segments, where arc is less than pi / 2.

Arguments

  • pose -- Pose to drive to.

pub fn mtr(&self) -> f64[src]

Compute minimum turning radius (MTR).

pub fn ccl(&self) -> Point[src]

Compute MTR circle center on the left side of the car.

pub fn ccr(&self) -> Point[src]

Compute MTR circle center on the right side of the car.

pub fn cf(&self) -> Point[src]

Return car frame's center front.

pub fn lf(&self) -> Point[src]

Return car frame's left front corner.

pub fn la(&self) -> Point[src]

Return car frame's coordinate for rear axle on left.

pub fn lr(&self) -> Point[src]

Return car frame's left rear corner.

pub fn rr(&self) -> Point[src]

Return car frame's right rear corner.

pub fn ra(&self) -> Point[src]

Return car frame's coordinate for rear axle on right.

pub fn rf(&self) -> Point[src]

Return car frame's right front corner.

Trait Implementations

impl Clone for BCar[src]

impl Copy for BCar[src]

impl Debug for BCar[src]

impl Iterator for BCar[src]

type Item = BCar

The type of the elements being iterated over.

fn next(&mut self) -> Option<Self::Item>[src]

Return BCar new state.

Examples

let mut bc = bcar::BCar::default();
bc.set_motion(bcar::Motion::new(1.0, 0.0));
bc.next();
assert_eq!(bc, bcar::BCar::new(
    bcar::Pose::new(1.0, 0.0, 0.0),
    bcar::Size::default(),
    bcar::Motion::new(1.0, 0.0),
));

impl PartialEq<BCar> for BCar[src]

impl StructuralPartialEq for BCar[src]

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<I> IntoIterator for I where
    I: Iterator
[src]

type Item = <I as Iterator>::Item

The type of the elements being iterated over.

type IntoIter = I

Which kind of iterator are we turning this into?

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.