pub struct ChargeBudget {
pub weight: f64,
pub reserve: f64,
}Expand description
Powertrain-aware MPPI controller.
Unlike MotorMppiController, which rolls candidate commands out through
the ideal motor model, this controller rolls them out through the full
PowertrainParams::step — so its samples already feel the motor lag and
the battery-limited thrust ceiling. Commands above the (causal) ceiling are
clamped inside the rollout, so over-commanding earns no gate progress while
still paying the rotor-effort penalty; the controller is therefore pushed to
plan within the authority the battery can actually deliver, and it sees the
pack drain over the horizon rather than assuming infinite charge.
A charge-budget term for the powertrain-aware controller.
Once a rollout step’s state of charge falls below reserve, the rollout cost
gains weight * (reserve - soc) * load, where load is the electrical draw.
Because the penalty scales with load it gives the rollout an actionable
gradient — throttle back when low — that a slow-moving state-of-charge term
cannot. weight = 0 recovers the plain aware controller.
Fields§
§weight: f64Penalty scale on below-reserve current draw; clamped to >= 0.
reserve: f64State-of-charge floor to protect, in [0, 1].
Implementations§
Trait Implementations§
Source§impl Clone for ChargeBudget
impl Clone for ChargeBudget
Source§fn clone(&self) -> ChargeBudget
fn clone(&self) -> ChargeBudget
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ChargeBudget
impl Debug for ChargeBudget
Source§impl PartialEq for ChargeBudget
impl PartialEq for ChargeBudget
Source§fn eq(&self, other: &ChargeBudget) -> bool
fn eq(&self, other: &ChargeBudget) -> bool
self and other values to be equal, and is used by ==.impl Copy for ChargeBudget
impl StructuralPartialEq for ChargeBudget
Auto Trait Implementations§
impl Freeze for ChargeBudget
impl RefUnwindSafe for ChargeBudget
impl Send for ChargeBudget
impl Sync for ChargeBudget
impl Unpin for ChargeBudget
impl UnsafeUnpin for ChargeBudget
impl UnwindSafe for ChargeBudget
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
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>
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 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>
self from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.