- 3.0.2 rigid body dynamics module.
SecondOrderActuatorDynamics.h
Go to the documentation of this file.
1 /**********************************************************************************************************************
2 This file is part of the Control Toolbox (https://github.com/ethz-adrl/control-toolbox), copyright by ETH Zurich.
3 Licensed under the BSD-2 license (see LICENSE file in main directory)
4 **********************************************************************************************************************/
5 
6 #pragma once
7 
8 #include "ActuatorDynamics.h"
9 
10 namespace ct {
11 namespace rbd {
12 
18 template <size_t NJOINTS, typename SCALAR = double>
19 class SecondOrderActuatorDynamics : public ActuatorDynamics<2 * NJOINTS, NJOINTS, SCALAR>
20 {
21 public:
22  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
23 
25 
27  SecondOrderActuatorDynamics(double w_n, double zeta);
28 
30  SecondOrderActuatorDynamics(double w_n, double zeta, double g_dc);
31 
33  SecondOrderActuatorDynamics(std::vector<double> w_n, std::vector<double> zeta);
34 
36  SecondOrderActuatorDynamics(std::vector<double> w_n, std::vector<double> zeta, std::vector<double> g_dc);
37 
40 
42  virtual SecondOrderActuatorDynamics<NJOINTS, SCALAR>* clone() const override;
43 
44  virtual void computeActuatorDynamics(const JointState<NJOINTS, SCALAR>& robotJointState,
46  const SCALAR& t,
48  ct::core::StateVector<2 * NJOINTS, SCALAR>& derivative) override;
49 
51  const JointState<NJOINTS, SCALAR>& robotJointState,
52  const typename BASE::act_state_vector_t& actState) override;
53 
55  const JointState<NJOINTS, SCALAR>& refRobotJointState,
56  const core::ControlVector<NJOINTS, SCALAR>& refControl) override;
57 
58 private:
59  std::vector<ct::core::tpl::SecondOrderSystem<SCALAR>> oscillators_;
60 };
61 
62 } // namespace rbd
63 } // namespace ct
joint state and joint velocity
Definition: JointState.h:21
virtual core::ControlVector< NJOINTS, SCALAR > computeControlOutput(const JointState< NJOINTS, SCALAR > &robotJointState, const typename BASE::act_state_vector_t &actState) override
Definition: SecondOrderActuatorDynamics-impl.h:86
virtual ct::core::StateVector< 2 *NJOINTS, SCALAR > computeStateFromOutput(const JointState< NJOINTS, SCALAR > &refRobotJointState, const core::ControlVector< NJOINTS, SCALAR > &refControl) override
reconstruct actuator state from a desired control output and robot joint state (e.g. for initialization)
Definition: SecondOrderActuatorDynamics-impl.h:95
SecondOrderActuatorDynamics(double w_n, double zeta)
constructor assuming unit amplification
Definition: SecondOrderActuatorDynamics-impl.h:12
virtual SecondOrderActuatorDynamics< NJOINTS, SCALAR > * clone() const override
deep cloning
Definition: SecondOrderActuatorDynamics-impl.h:55
virtual void computeActuatorDynamics(const JointState< NJOINTS, SCALAR > &robotJointState, const ct::core::StateVector< 2 *NJOINTS, SCALAR > &state, const SCALAR &t, const ct::core::ControlVector< NJOINTS, SCALAR > &control, ct::core::StateVector< 2 *NJOINTS, SCALAR > &derivative) override
Definition: SecondOrderActuatorDynamics-impl.h:61
CppAD::AD< CppAD::cg::CG< double > > SCALAR
Definition: SecondOrderActuatorDynamics.h:19
Definition: ActuatorDynamics.h:25
virtual ~SecondOrderActuatorDynamics()
destructor
Definition: SecondOrderActuatorDynamics-impl.h:50
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ActuatorDynamics< 2 *NJOINTS, NJOINTS, SCALAR > BASE
Definition: SecondOrderActuatorDynamics.h:24