- 3.0.2 rigid body dynamics module.
FixBaseSystemBase.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 
9 
10 #include "RBDSystem.h"
11 
12 namespace ct {
13 namespace rbd {
14 
18 template <class RBDDynamics, size_t STATE_D, size_t CONTROL_D>
19 class FixBaseSystemBase : public RBDSystem<RBDDynamics, false>,
20  public core::ControlledSystem<STATE_D, CONTROL_D, typename RBDDynamics::SCALAR>
21 {
22 public:
23  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
24 
26  static const size_t N_EE = RBDDynamics::N_EE;
28  static const size_t NJOINTS = RBDDynamics::NJOINTS;
29 
30  using Dynamics = RBDDynamics;
31  using SCALAR = typename RBDDynamics::SCALAR;
34 
35  // typedefs state and controls
39 
42  : Base(), basePose_(basePose), dynamics_(RBDDynamics())
43  {
44  }
45 
49  FixBaseSystemBase(const FixBaseSystemBase& arg) : Base(arg), basePose_(arg.basePose_), dynamics_(RBDDynamics()) {}
51  virtual ~FixBaseSystemBase() = default;
52 
54  virtual RBDDynamics& dynamics() override { return dynamics_; }
56  virtual const RBDDynamics& dynamics() const override { return dynamics_; }
59  const SCALAR& t,
61  ct::core::StateVector<STATE_D, SCALAR>& derivative) override = 0;
62 
64  virtual FixBaseSystemBase<RBDDynamics, STATE_D, CONTROL_D>* clone() const override = 0;
65 
68  const JointAcceleration_t& jAcc = JointAcceleration_t(Eigen::Matrix<SCALAR, NJOINTS, 1>::Zero()))
69  {
71  dynamics_.FixBaseID(jState, jAcc, torque);
72  return torque;
73  }
74 
75 protected:
78 
80  RBDDynamics dynamics_;
81 };
82 
83 } // namespace rbd
84 } // namespace ct
FixBaseSystemBase(const RigidBodyPose_t &basePose=RigidBodyPose_t())
constructor
Definition: FixBaseSystemBase.h:41
Pose of a single rigid body.
Definition: RigidBodyPose.h:29
joint state and joint velocity
Definition: JointState.h:21
ct::core::ControlVector< NJOINTS > computeIDTorques(const JointState< NJOINTS, SCALAR > &jState, const JointAcceleration_t &jAcc=JointAcceleration_t(Eigen::Matrix< SCALAR, NJOINTS, 1 >::Zero()))
compute inverse dynamics torques
Definition: FixBaseSystemBase.h:67
virtual void computeControlledDynamics(const ct::core::StateVector< STATE_D, SCALAR > &state, const SCALAR &t, const ct::core::ControlVector< CONTROL_D, SCALAR > &controlIn, ct::core::StateVector< STATE_D, SCALAR > &derivative) override=0
compute the controlled dynamics of the fixed base robotic system
tpl::RigidBodyPose< SCALAR > basePose_
a "dummy" base pose which sets the robot&#39;s "fixed" position in the world
Definition: FixBaseSystemBase.h:77
Base class for fix-base robot systems.
Definition: FixBaseSystemBase.h:19
clear all close all load ct GNMSLog0 mat reformat t
joint acceleration
Definition: JointAcceleration.h:17
virtual const RBDDynamics & dynamics() const override
get dynamics (const)
Definition: FixBaseSystemBase.h:56
This is a common interface class for an RBDSystem.
Definition: RBDSystem.h:15
virtual FixBaseSystemBase< RBDDynamics, STATE_D, CONTROL_D > * clone() const override=0
deep cloning
JointAcceleration< NJOINTS, SCALAR > JointAcceleration_t
Definition: FixBaseSystemBase.h:38
static const size_t NJOINTS
number of joints
Definition: FixBaseSystemBase.h:28
static EIGEN_MAKE_ALIGNED_OPERATOR_NEW const size_t N_EE
number of end-effectors
Definition: FixBaseSystemBase.h:26
RBDDynamics dynamics_
rigid body dynamics container
Definition: FixBaseSystemBase.h:80
tpl::RigidBodyPose< SCALAR > RigidBodyPose_t
Definition: FixBaseSystemBase.h:33
typename RBDDynamics::SCALAR SCALAR
Definition: FixBaseSystemBase.h:31
virtual ~FixBaseSystemBase()=default
destructor
virtual RBDDynamics & dynamics() override
get dynamics
Definition: FixBaseSystemBase.h:54
FixBaseSystemBase(const FixBaseSystemBase &arg)
copy constructor
Definition: FixBaseSystemBase.h:49