17template <
typename T>
struct ForwardDynamics {
26 VectorRef xout,
const std::optional<ConstVectorRef> &gap,
29 VectorXs dx0buf(model.
ndx2);
33 [&](
const ConstVectorRef &xnext, VectorRef out) {
34 model.evaluate(x, u, xnext, data);
39 [&](
const ConstVectorRef &xnext, MatrixRef Jout) {
40 model.computeJacobians(x, u, xnext, data);
47 const ConstVectorRef &x,
const ConstVectorRef &u,
49 const std::optional<ConstVectorRef> &gap,
51 model.forward(x, u, data);
63template <
typename T,
template <
typename>
class M,
64 typename D =
typename M<T>::Data>
72 detail::ForwardDynamics<T>::run(model, x, u, data, xout, gap, opts);
void forwardDynamics(const M< T > &model, const typename math_types< T >::ConstVectorRef &x, const typename math_types< T >::ConstVectorRef &u, D &data, const typename math_types< T >::VectorRef xout, const std::optional< typename math_types< T >::ConstVectorRef > &gap=std::nullopt, ForwardDynamicsOptions< T > opts={})
Evaluates the forward map for a discrete dynamics model, implicit or explicit.
MatrixRef Jy_
Jacobian with respect to .
VectorXs value_
Function value.
Dynamics model: describes system dynamics through an implicit relation .
const Manifold & space_next() const
State space for the output of this dynamics model.
const int ndx2
Next state space dimension.
Specific data struct for explicit dynamics ExplicitDynamicsModelTpl.
Explicit forward dynamics model .
void integrate(const ConstVectorRef &x, const ConstVectorRef &v, VectorRef out) const
Manifold integration operation .
static bool run(const Manifold &space, Fun &&fun, JacFun &&jac_fun, const ConstVectorRef &xinit, VectorRef xout, VectorRef f0, VectorRef dx, MatrixRef Jf0, Scalar eps=1e-6, std::size_t max_iters=1000, Options options=Options{})
Typedefs for math (Eigen vectors, matrices) depending on scalar type.