- 3.0.2 rigid body dynamics module.
FixBaseAccSystem.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 "FixBaseSystemBase.h"
9 
10 namespace ct {
11 namespace rbd {
12 
18 template <class RBDDynamics>
19 class FixBaseAccSystem : public FixBaseSystemBase<RBDDynamics, 2 * RBDDynamics::NJOINTS, RBDDynamics::NJOINTS>
20 {
21 public:
22  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
23 
25  using SCALAR = typename BASE::SCALAR;
30 
32  FixBaseAccSystem(const RigidBodyPose_t& basePose = RigidBodyPose_t()) : BASE(basePose) {}
34  FixBaseAccSystem(const FixBaseAccSystem& arg) : BASE(arg) {}
36  virtual ~FixBaseAccSystem() = default;
37 
40  const SCALAR& t,
41  const control_vector_t& controlIn,
42  state_vector_t& derivative) override
43  {
44  // transcribe joint velocities
45  derivative.template head<BASE::NJOINTS>() = state.template tail<BASE::NJOINTS>();
46  // transcribe joint accelerations
47  derivative.template tail<BASE::NJOINTS>() = controlIn.template head<BASE::NJOINTS>();
48  }
49 
51  virtual FixBaseAccSystem<RBDDynamics>* clone() const override { return new FixBaseAccSystem<RBDDynamics>(*this); }
52 };
53 
54 } // namespace rbd
55 } // namespace ct
A simple fix base robot system which is purely kinematic and actuated at ACCELERATION level...
Definition: FixBaseAccSystem.h:19
typename BASE::state_vector_t state_vector_t
Definition: FixBaseAccSystem.h:26
typename BASE::JointAcceleration_t JointAcceleration_t
Definition: FixBaseAccSystem.h:28
Base class for fix-base robot systems.
Definition: FixBaseSystemBase.h:19
FixBaseAccSystem(const RigidBodyPose_t &basePose=RigidBodyPose_t())
constructor
Definition: FixBaseAccSystem.h:32
virtual ~FixBaseAccSystem()=default
destructor
virtual FixBaseAccSystem< RBDDynamics > * clone() const override
deep cloning
Definition: FixBaseAccSystem.h:51
void computeControlledDynamics(const state_vector_t &state, const SCALAR &t, const control_vector_t &controlIn, state_vector_t &derivative) override
compute the controlled dynamics of the fixed base robotic system
Definition: FixBaseAccSystem.h:39
typename BASE::SCALAR SCALAR
Definition: FixBaseAccSystem.h:25
core::ControlVector< CONTROL_D, SCALAR > control_vector_t
Definition: FixBaseSystemBase.h:37
JointAcceleration< NJOINTS, SCALAR > JointAcceleration_t
Definition: FixBaseSystemBase.h:38
typename BASE::control_vector_t control_vector_t
Definition: FixBaseAccSystem.h:27
FixBaseAccSystem(const FixBaseAccSystem &arg)
copy constructor
Definition: FixBaseAccSystem.h:34
tpl::RigidBodyPose< SCALAR > RigidBodyPose_t
Definition: FixBaseSystemBase.h:33
typename RBDDynamics::SCALAR SCALAR
Definition: FixBaseSystemBase.h:31
ct::core::StateVector< STATE_D, SCALAR > state_vector_t
Definition: FixBaseSystemBase.h:36
typename BASE::RigidBodyPose_t RigidBodyPose_t
Definition: FixBaseAccSystem.h:29