pub trait PathEvaluator2nd: Send + Sync {
// Required methods
fn dim(&self) -> usize;
fn evaluate_up_to_2nd(
&self,
s: &[f64],
q: &mut [f64],
dq: &mut [f64],
ddq: &mut [f64],
) -> Result<(), PathError>;
// Provided method
fn evaluate_q(&self, s: &[f64], q: &mut [f64]) -> Result<(), PathError> { ... }
}Expand description
User-provided path evaluator with explicit derivatives up to second order.
Implement this trait when path derivatives are already available from an
external model, library, or hand-written analytic formula. Unlike
Path::from_parametric, no automatic differentiation is performed: the
evaluator writes q, dq, and ddq directly into pre-allocated
column-major buffers.
Buffer layout is always dim x s.len() in column-major order:
buffer[row + col * dim] corresponds to path dimension row at sample
s[col]. Empty s slices are valid no-ops.
See Path::from_evaluator_2nd for a complete constructor example.
Required Methods§
Provided Methods§
Sourcefn evaluate_q(&self, s: &[f64], q: &mut [f64]) -> Result<(), PathError>
fn evaluate_q(&self, s: &[f64], q: &mut [f64]) -> Result<(), PathError>
Evaluate position only.
The default implementation calls PathEvaluator2nd::evaluate_up_to_2nd
with temporary derivative buffers. Override this method if computing
only q is substantially cheaper for the evaluator.