- 3.0.2 rigid body dynamics module.
SEADynamicsFirstOrder.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 
24 template <size_t NJOINTS, typename SCALAR = double>
25 class SEADynamicsFirstOrder : public ActuatorDynamics<NJOINTS, NJOINTS, SCALAR>
26 {
27 public:
28  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
29 
31 
33  SEADynamicsFirstOrder(double k_spring, double gear_ratio);
34 
36  virtual ~SEADynamicsFirstOrder();
37 
39  virtual SEADynamicsFirstOrder<NJOINTS, SCALAR>* clone() const override;
40 
41  virtual void computeActuatorDynamics(const JointState<NJOINTS, SCALAR>& robotJointState,
43  const SCALAR& t,
45  ct::core::StateVector<NJOINTS, SCALAR>& derivative) override;
46 
48  const JointState<NJOINTS, SCALAR>& robotJointState,
49  const typename BASE::act_state_vector_t& actState) override;
50 
52  const JointState<NJOINTS, SCALAR>& refRobotJointState,
53  const core::ControlVector<NJOINTS, SCALAR>& refControl) override;
54 
55 private:
56  SCALAR k_;
57  SCALAR r_;
58 };
59 
60 
61 } // namespace rbd
62 } // namespace ct
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef ActuatorDynamics< NJOINTS, NJOINTS, SCALAR > BASE
Definition: SEADynamicsFirstOrder.h:30
virtual void computeActuatorDynamics(const JointState< NJOINTS, SCALAR > &robotJointState, const ct::core::StateVector< NJOINTS, SCALAR > &state, const SCALAR &t, const ct::core::ControlVector< NJOINTS, SCALAR > &control, ct::core::StateVector< NJOINTS, SCALAR > &derivative) override
Definition: SEADynamicsFirstOrder-impl.h:29
joint state and joint velocity
Definition: JointState.h:21
virtual ~SEADynamicsFirstOrder()
destructor
Definition: SEADynamicsFirstOrder-impl.h:18
SEADynamicsFirstOrder(double k_spring, double gear_ratio)
constructor assuming unit amplification
Definition: SEADynamicsFirstOrder-impl.h:12
CppAD::AD< CppAD::cg::CG< double > > SCALAR
virtual SEADynamicsFirstOrder< NJOINTS, SCALAR > * clone() const override
deep cloning
Definition: SEADynamicsFirstOrder-impl.h:23
Definition: ActuatorDynamics.h:25
virtual core::ControlVector< NJOINTS, SCALAR > computeControlOutput(const JointState< NJOINTS, SCALAR > &robotJointState, const typename BASE::act_state_vector_t &actState) override
Definition: SEADynamicsFirstOrder-impl.h:40
virtual ct::core::StateVector< 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: SEADynamicsFirstOrder-impl.h:49
Definition: SEADynamicsFirstOrder.h:25