pub struct Car<ServoPwm, MAIN1, MAIN2, MAPWM, DS, DE, OLED>where
    ServoPwm: PwmPin,
    DS: DistanceSensor<DE>,
{ steering: Steering<ServoPwm>, motor: Motor<MAIN1, MAIN2, MAPWM>, front_distance_sensor: Option<DS>, display: Option<Display>, led_status_obstacle: OLED, current_state: CarState, latest_front_distance_in_mm: Option<u16>, last_front_distance_update: Option<TimerInstantU32<1_000_000>>, _distance_sensor_error: PhantomData<DE>, }
Expand description

Represents the robot car.

Fields

steering: Steering<ServoPwm>motor: Motor<MAIN1, MAIN2, MAPWM>front_distance_sensor: Option<DS>display: Option<Display>led_status_obstacle: OLEDcurrent_state: CarStatelatest_front_distance_in_mm: Option<u16>last_front_distance_update: Option<TimerInstantU32<1_000_000>>_distance_sensor_error: PhantomData<DE>

Needed to be able to specify the DE type parameter

Implementations

Return the current speed of the motor (in percentage). Note that driving forward returns a positive number while driving backwards returns a negative number and a stopped car returns 0.

Halt in case the car is currently driving forward, otherwise do nothing. This is used in the collision avoidance to ensure that it’s still possible to drive backwards.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Casts the value.
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Casts the value.
Casts the value.
Casts the value.

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Casts the value.
Casts the value.
Should always be Self
Casts the value.
Casts the value.
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Casts the value.
Casts the value.
Casts the value.
Casts the value.