pub struct RacingGateLap3D {
pub gates: Vec<RacingGatePlane3D>,
pub closed: bool,
pub progress_weight: f64,
pub lateral_weight: f64,
pub pass_bonus: f64,
pub miss_penalty: f64,
pub terminal_gate_weight: f64,
pub crossing_tolerance: f64,
}Expand description
A sequence of gates forming an open course or a closed racing lap.
Holds the reference-free gate-progress objective weights, mirroring
crate::mppi::MppiGateRace2D but over 3-D gate planes.
Fields§
§gates: Vec<RacingGatePlane3D>§closed: boolWhen true, after the last gate the race wraps back to the first gate.
progress_weight: f64§lateral_weight: f64§pass_bonus: f64§miss_penalty: f64§terminal_gate_weight: f64§crossing_tolerance: f64Implementations§
Source§impl RacingGateLap3D
impl RacingGateLap3D
Sourcepub fn open(gates: Vec<RacingGatePlane3D>) -> RoboticsResult<Self>
pub fn open(gates: Vec<RacingGatePlane3D>) -> RoboticsResult<Self>
Open course: the race ends after the last gate is passed.
Sourcepub fn closed_loop(gates: Vec<RacingGatePlane3D>) -> RoboticsResult<Self>
pub fn closed_loop(gates: Vec<RacingGatePlane3D>) -> RoboticsResult<Self>
Closed lap: after the last gate the race wraps back to the first gate.
pub fn gate_count(&self) -> usize
Sourcepub fn gate_for_pass_count(&self, passed: usize) -> &RacingGatePlane3D
pub fn gate_for_pass_count(&self, passed: usize) -> &RacingGatePlane3D
Gate the race is chasing given how many gates have already been passed.
For a closed lap this wraps modulo the gate count; for an open course it saturates at the last gate.
Sourcepub fn centerline_length(&self) -> f64
pub fn centerline_length(&self) -> f64
Length of the polyline through the gate centers; closed laps add the return leg from the last gate back to the first.
Trait Implementations§
Source§impl Clone for RacingGateLap3D
impl Clone for RacingGateLap3D
Source§fn clone(&self) -> RacingGateLap3D
fn clone(&self) -> RacingGateLap3D
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for RacingGateLap3D
impl Debug for RacingGateLap3D
Source§impl PartialEq for RacingGateLap3D
impl PartialEq for RacingGateLap3D
Source§fn eq(&self, other: &RacingGateLap3D) -> bool
fn eq(&self, other: &RacingGateLap3D) -> bool
Tests for
self and other values to be equal, and is used by ==.impl StructuralPartialEq for RacingGateLap3D
Auto Trait Implementations§
impl Freeze for RacingGateLap3D
impl RefUnwindSafe for RacingGateLap3D
impl Send for RacingGateLap3D
impl Sync for RacingGateLap3D
impl Unpin for RacingGateLap3D
impl UnsafeUnpin for RacingGateLap3D
impl UnwindSafe for RacingGateLap3D
Blanket Implementations§
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
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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 more§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self from the equivalent element of its
superset. Read more§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self is actually part of its subset T (and can be converted to it).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.