pub struct RobotSpec { /* private fields */ }Implementations§
Source§impl RobotSpec
impl RobotSpec
pub fn new( acceleration: impl Into<Acceleration>, deceleration: impl Into<Acceleration>, wheel_diameter: Milimeters, wheelbase_diameter: Milimeters, max_speed: impl Into<Speed>, ) -> Self
Sourcepub fn acceleration(&self) -> DegreesPerSecondPerSecond
pub fn acceleration(&self) -> DegreesPerSecondPerSecond
The acceleration rate used for movement In degrees per second per second
Sourcepub fn deceleration(&self) -> DegreesPerSecondPerSecond
pub fn deceleration(&self) -> DegreesPerSecondPerSecond
The deceleration rate used for movement In degrees per second per second
Sourcepub fn wheel_circumference(&self) -> Milimeters
pub fn wheel_circumference(&self) -> Milimeters
The circumference of the main wheels on the robot In millimeters
Sourcepub fn wheel_diameter(&self) -> Milimeters
pub fn wheel_diameter(&self) -> Milimeters
The diameter of the main wheels on the robot In millimeters
Sourcepub fn wheelbase_circumference(&self) -> Milimeters
pub fn wheelbase_circumference(&self) -> Milimeters
The turning circumference of the robot’s wheelbase In millimeters
Sourcepub fn wheelbase_diameter(&self) -> Milimeters
pub fn wheelbase_diameter(&self) -> Milimeters
The distance between the robot’s 2 wheels In millimeters
Sourcepub fn max_speed(&self) -> DegreesPerSecond
pub fn max_speed(&self) -> DegreesPerSecond
The max supported driving speed In degrees per second
Sourcepub fn get_distance_for_turn(&self, Heading: Heading) -> Degrees
pub fn get_distance_for_turn(&self, Heading: Heading) -> Degrees
Calculated the amount of degrees a wheel would need to turn to cause the robot to turn
angle degrees
Assumes the robot has a heading of 0
The actual heading should be subtracted from angle
Sourcepub fn get_approx_angle(
&self,
left: impl Into<Distance>,
right: impl Into<Distance>,
) -> Heading
pub fn get_approx_angle( &self, left: impl Into<Distance>, right: impl Into<Distance>, ) -> Heading
Calculated the direction the robot should be facing based on the wheel angles
Sourcepub fn deg_to_mm(&self, Degrees: Degrees) -> Milimeters
pub fn deg_to_mm(&self, Degrees: Degrees) -> Milimeters
Converts wheel degrees to millimeters
Sourcepub fn mm_to_deg(&self, Milimeters: Milimeters) -> Degrees
pub fn mm_to_deg(&self, Milimeters: Milimeters) -> Degrees
Converts millimeters to wheel degrees
Trait Implementations§
Auto Trait Implementations§
impl Freeze for RobotSpec
impl RefUnwindSafe for RobotSpec
impl Send for RobotSpec
impl Sync for RobotSpec
impl Unpin for RobotSpec
impl UnwindSafe for RobotSpec
Blanket Implementations§
Source§impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
impl<Src, Scheme> ApproxFrom<Src, Scheme> for Srcwhere
Scheme: ApproxScheme,
Source§fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
fn approx_from(src: Src) -> Result<Src, <Src as ApproxFrom<Src, Scheme>>::Err>
Source§impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
impl<Dst, Src, Scheme> ApproxInto<Dst, Scheme> for Srcwhere
Dst: ApproxFrom<Src, Scheme>,
Scheme: ApproxScheme,
Source§type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
type Err = <Dst as ApproxFrom<Src, Scheme>>::Err
Source§fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
fn approx_into(self) -> Result<Dst, <Src as ApproxInto<Dst, Scheme>>::Err>
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T, Dst> ConvAsUtil<Dst> for T
impl<T, Dst> ConvAsUtil<Dst> for T
Source§impl<T> ConvUtil for T
impl<T> ConvUtil for T
Source§fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
fn approx_as<Dst>(self) -> Result<Dst, Self::Err>where
Self: Sized + ApproxInto<Dst>,
Source§fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
fn approx_as_by<Dst, Scheme>(self) -> Result<Dst, Self::Err>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.