Struct bcar::EntryPlanner[][src]

pub struct EntryPlanner { /* fields omitted */ }

Implementations

impl EntryPlanner[src]

pub fn new(slot: PSlot, car_size: Size) -> EntryPlanner[src]

pub fn parked(&self, car: BCar) -> bool[src]

Return if the car is inside the slot.

Examples

let c = bcar::BCar::default();
let s = bcar::PSlot::default();
let p = bcar::EntryPlanner::new(s, c.size);
let mut c = c;
c.pose.x = 1.1;
c.pose.y = -1.1;
let p = bcar::EntryPlanner::new(s, c.size);
assert!(p.parked(c));

pub fn unparked(&self, car: BCar) -> bool[src]

Return if the front of the car is outside, so able to leave the slot.

Use this method when going out of the parking slot and want to check if the car is finally out.

Examples

let c = bcar::BCar::default();
let s = bcar::PSlot::default();
let p = bcar::EntryPlanner::new(s, c.size);
let mut c = c;
c.pose.x = 1.1;
c.pose.y = -1.1;
let p = bcar::EntryPlanner::new(s, c.size);
assert!(!p.unparked(c));

pub fn collide(&self, c: BCar) -> Option<Point>[src]

Return if car c collide with the parking slot self.slot.

Check each frame line of the car with each frame line of the slot.

pub fn drive_out_of_slot(&self, c: &mut BCar) -> (u8, Vec<BCar>)[src]

Drive the car c out ouf self.slot and return True if success.

pub fn drive_in_the_slot(&self, c: &mut BCar) -> (u8, Vec<BCar>)[src]

Drive the car c in the self.slot.

pub fn guess_goal_by_reversed(&self) -> BCar

Notable traits for BCar

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

Return goal of left rear in parking slot.

Use 1e-3 offset to avoid init collision.

pub fn find_goals_by_bfs(&self) -> Vec<BCar>[src]

Use 1e-3 offset to avoid init collision.

pub fn find_entries_by_bfs(&self) -> PoseRange[src]

Trait Implementations

impl Clone for EntryPlanner[src]

impl Copy for EntryPlanner[src]

impl Debug for EntryPlanner[src]

impl PartialEq<EntryPlanner> for EntryPlanner[src]

impl StructuralPartialEq for EntryPlanner[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<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.