pub struct Topp3ProblemBuilder<'a> {
pub constraints: &'a mut Constraints,
pub idx_s_start: usize,
pub a_linearization: &'a [f64],
pub a_boundary: (f64, f64),
pub b_boundary: (f64, f64),
pub num_stationary_max: (usize, usize),
pub a_linearization_floor: f64,
}Expand description
Builder for Topp3Problem, including optional in-build linearization.
§Side effect notice
build_with_linearization() updates cached affine linearization data inside Constraints.
Raw jerk constraints remain unchanged.
Fields§
§constraints: &'a mut ConstraintsMutable constraint storage used to build linearized TOPP3 problem data.
idx_s_start: usizeStart station index of the optimization interval.
a_linearization: &'a [f64]Reference profile a[k] used to linearize third-order constraints.
a_boundary: (f64, f64)Boundary values of a=(a_start, a_final).
b_boundary: (f64, f64)Boundary values of b=(b_start, b_final).
num_stationary_max: (usize, usize)User-input upper bound of stationary intervals at (start, end).
a_linearization_floor: f64Denominator floor for stable evaluation of 1/sqrt(a_linearization) near a=0.
Effective usage in linearization is:
$$
\frac{1}{\sqrt{\max(a_{lin}, a_{floor})}}.
$$
Discrete code form:
1.0 / max(a_linearization, a_linearization_floor).sqrt().
More details are available in the Topp3Problem documentation.
Implementations§
Source§impl<'a> Topp3ProblemBuilder<'a>
impl<'a> Topp3ProblemBuilder<'a>
Sourcepub fn new<M: RobotBasic>(
robot: &'a mut Robot<M>,
idx_s_start: usize,
a_linearization: &'a [f64],
a_boundary: (f64, f64),
b_boundary: (f64, f64),
) -> Self
pub fn new<M: RobotBasic>( robot: &'a mut Robot<M>, idx_s_start: usize, a_linearization: &'a [f64], a_boundary: (f64, f64), b_boundary: (f64, f64), ) -> Self
Create a TOPP3 builder with required fields.
Defaults:
num_stationary_max = (1, 1)a_linearization_floor = 1E-10
Sourcepub fn with_constraint(
constraints: &'a mut Constraints,
idx_s_start: usize,
a_linearization: &'a [f64],
a_boundary: (f64, f64),
b_boundary: (f64, f64),
) -> Self
pub fn with_constraint( constraints: &'a mut Constraints, idx_s_start: usize, a_linearization: &'a [f64], a_boundary: (f64, f64), b_boundary: (f64, f64), ) -> Self
Create a TOPP3 builder with required fields.
Defaults:
num_stationary_max = (1, 1)a_linearization_floor = 1E-10
Sourcepub fn with_num_stationary_max(self, num_stationary_max: usize) -> Self
pub fn with_num_stationary_max(self, num_stationary_max: usize) -> Self
Set symmetric stationary upper bound: num_stationary_max=(n,n).
See module-level Stationary-boundary modeling note for guidance.
Sourcepub fn with_num_stationary_max_pair(
self,
num_stationary_max: (usize, usize),
) -> Self
pub fn with_num_stationary_max_pair( self, num_stationary_max: (usize, usize), ) -> Self
Set asymmetric stationary upper bound: num_stationary_max=(start,end).
See module-level Stationary-boundary modeling note for guidance.
Sourcepub fn with_a_linearization_floor(self, floor: f64) -> Self
pub fn with_a_linearization_floor(self, floor: f64) -> Self
Set denominator floor used in linearization.
Sourcepub fn build_with_linearization(self) -> Result<Topp3Problem<'a>, CoppError>
pub fn build_with_linearization(self) -> Result<Topp3Problem<'a>, CoppError>
Build a TOPP3 problem and linearize third-order constraints in one step.
This validates boundaries/interval/floor first, then writes linearized jerk buffers.
Auto Trait Implementations§
impl<'a> Freeze for Topp3ProblemBuilder<'a>
impl<'a> RefUnwindSafe for Topp3ProblemBuilder<'a>
impl<'a> Send for Topp3ProblemBuilder<'a>
impl<'a> Sync for Topp3ProblemBuilder<'a>
impl<'a> Unpin for Topp3ProblemBuilder<'a>
impl<'a> !UnwindSafe for Topp3ProblemBuilder<'a>
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> 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<T> Pointable for T
impl<T> Pointable for T
§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.