25 #ifndef SRC_NUMERICS_INCLUDE_CORBO_NUMERICS_DYNAMICS_EVAL_INTERFACE_H_
26 #define SRC_NUMERICS_INCLUDE_CORBO_NUMERICS_DYNAMICS_EVAL_INTERFACE_H_
33 #ifdef MESSAGE_SUPPORT
34 #include <corbo-communication/messages/numerics/dynamics_eval.pb.h>
54 class DynamicsEvalInterface
57 using Ptr = std::shared_ptr<DynamicsEvalInterface>;
58 using UPtr = std::unique_ptr<DynamicsEvalInterface>;
93 const SystemDynamicsInterface& system,
const Range& range, std::vector<Eigen::VectorXd>& states,
94 std::vector<Eigen::VectorXd>& controls) = 0;
96 virtual bool interpolate(
const std::vector<const Eigen::VectorXd*>&
x,
const std::vector<const Eigen::VectorXd*>& u,
double dt,
97 const SystemDynamicsInterface& system,
const Range& range, std::vector<Eigen::VectorXd>& states,
98 std::vector<Eigen::VectorXd>& controls)
100 if (
x.size() > 1 && u.size() > 1)
101 return interpolate(*
x[0], *u[0], *
x.back(), *u.back(), dt, system, range, states, controls);
102 else if (
x.size() > 1 && u.size() == 1)
103 return interpolate(*
x[0], *u[0], *
x.back(), *u[0], dt, system, range, states, controls);
108 #ifdef MESSAGE_SUPPORT
109 virtual void toMessage(corbo::messages::DynamicsEval& message)
const {}
112 virtual void fromMessage(
const corbo::messages::DynamicsEval& message, std::stringstream* issues =
nullptr) {}
117 #define FACTORY_REGISTER_DYNAMICS_EVAL(type) FACTORY_REGISTER_OBJECT_ID(type, DynamicsEvalInterface, 0)
121 #endif // SRC_NUMERICS_INCLUDE_CORBO_NUMERICS_DYNAMICS_EVAL_INTERFACE_H_