20 #ifndef _se3_non_linear_motor_model_hpp_ 21 #define _se3_non_linear_motor_model_hpp_ 24 #include "pinocchio/macros.hpp" 25 #include "pinocchio/actuators/actuator-model.hpp" 129 template<
typename Scalar_>
134 typedef Scalar_ Scalar_t;
135 typedef typename Eigen::Matrix<Scalar_, 12,1 > Parameters_t;
136 typedef typename Eigen::Matrix<Scalar_, 2,1> Observations_t;
137 typedef typename Eigen::Matrix<Scalar_, 6,1> S_t;
138 typedef typename Eigen::Matrix<Scalar_, 3,1> X_t;
139 typedef typename Eigen::Matrix<Scalar_, 3,1> dX_t;
140 typedef typename Eigen::Matrix<Scalar_, 1,1> U_t;
143 const Observations_t &
h()
const {
return h_;}
146 const Parameters_t &
c()
const {
return c_;}
149 const S_t &
S()
const {
return S_;}
151 enum InternalParameters
158 P_TERMINAL_INDUCTANCE
194 Observations_t &
h() {
return h_;}
201 c_[0] =
c_[P_TORQUE_CST]/
c_[P_ROTOR_INERTIA];
203 c_[1] = -
c_[P_SPEED_TORQUE_GRD]/
c_[P_ROTOR_INERTIA];
205 c_[2] = -1/
c_[P_ROTOR_INERTIA];
207 c_[3] = -
c_[P_ROTOR_RESISTOR]/
c_[P_TERMINAL_INDUCTANCE];
209 c_[4] = 1/
c_[P_TERMINAL_INDUCTANCE];
211 c_[5] = -
c_[P_BACK_EMF]/
c_[P_TERMINAL_INDUCTANCE];
231 template<
typename Scalar_>
235 typedef Eigen::Matrix<Scalar_,3,1,0> Vector3Scalar;
240 void calc(
typename ActuatorDCNonLinearMotorData<Scalar_>::dX_t & dstate,
241 typename ActuatorDCNonLinearMotorData<Scalar_>::X_t & state,
242 typename ActuatorDCNonLinearMotorData<Scalar_>::U_t & control,
248 dstate[0] = state[1];
250 dstate[1] = data.
c()[0] * state[2] + data.
c()[1] * state[1] +
253 dstate[2] = data.
c()[3] * state[2] + control[0] - data.
c()[7]* state[1];
265 aForce.
linear(Vector3Scalar::Zero(3,1));
266 aForce.
angular(Vector3Scalar(0.0,0.0,data.
h()[1]));
279 template <
typename Scalar_>
285 template <
typename Scalar_>
void torqueConst(Scalar_ c)
Torque constant (Nm/A) - .
const Parameters_t & c() const
Return parameters.
Parameters_t c_
Vector parameters.
Template implementing a non linear DC motor model.
void rotorInertia(Scalar_ c)
Rotor inertia (kg/m2) - .
void terminalInductance(Scalar_ c)
Terminal Inductance (Henry)
void updateFirstParameters()
Update the first three parameters of the actuators:
Concreate Class representing a force.
const Observations_t & h() const
Return observation vector.
void calc(typename ActuatorDCNonLinearMotorData< Scalar_ >::dX_t &dstate, typename ActuatorDCNonLinearMotorData< Scalar_ >::X_t &state, typename ActuatorDCNonLinearMotorData< Scalar_ >::U_t &control, Force &fext, ActuatorDCNonLinearMotorData< Scalar_ > &data)
const Vector6 & toVector() const
Return the force.
Template for handling data related to a non linear DC motor model.
ConstAngular_t angular() const
Return the angular part of the force vector.
void backEMF(Scalar_ c)
Back electro magnetic force constant It is the inverse of the speed torque gradient constant ( ) in ...
const S_t & S() const
Returns selection matrix.
void rotorResistor(Scalar_ c)
Rotor resistor (Ohm) - .
ConstLinear_t linear() const
Return the linear part of the force vector.
void speedTorqueGrad(Scalar_ c)
Speed torque gradient (rads^-1/Nm) .
Observations_t h_
Observation variables.