- 3.0.2 models module.
HyALinearizedForward.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 <ct/core/core.h>
9 
10 namespace ct {
11 namespace models {
12 namespace HyA {
13 
14 class HyALinearizedForward : public ct::core::LinearSystem<12, 6, double>
15 {
16 public:
18 
23 
24  HyALinearizedForward(const ct::core::SYSTEM_TYPE& type = ct::core::SYSTEM_TYPE::GENERAL)
25  : ct::core::LinearSystem<12, 6>(type)
26  {
27  initialize();
28  }
29 
30  HyALinearizedForward(const HyALinearizedForward& other) { initialize(); }
31  virtual ~HyALinearizedForward(){};
32 
33  virtual HyALinearizedForward* clone() const override { return new HyALinearizedForward; }
34  virtual const state_matrix_t& getDerivativeState(const state_vector_t& x,
35  const control_vector_t& u,
36  const double t = double(0.0)) override;
37 
38  virtual const state_control_matrix_t& getDerivativeControl(const state_vector_t& x,
39  const control_vector_t& u,
40  const double t = double(0.0)) override;
41 
42 private:
43  void initialize()
44  {
45  dFdx_.setZero();
46  dFdu_.setZero();
47  vX_.fill(0.0);
48  vU_.fill(0.0);
49  }
50 
51  state_matrix_t dFdx_;
52  state_control_matrix_t dFdu_;
53  std::array<double, 392> vX_;
54  std::array<double, 69> vU_;
55 };
56 }
57 }
58 }
HyALinearizedForward(const HyALinearizedForward &other)
Definition: HyALinearizedForward.h:30
ct::core::ControlVector< control_dim > u
virtual const state_matrix_t & getDerivativeState(const state_vector_t &x, const control_vector_t &u, const double t=double(0.0)) override
Definition: HyALinearizedForward-impl.h:14
ct::core::LinearSystem< 12, 6, double > Base
Definition: HyALinearizedForward.h:17
Definition: HyALinearizedForward.h:14
clear all close all load ct GNMSLog0 mat reformat t
Base::state_control_matrix_t state_control_matrix_t
Definition: HyALinearizedForward.h:22
HyALinearizedForward(const ct::core::SYSTEM_TYPE &type=ct::core::SYSTEM_TYPE::GENERAL)
Definition: HyALinearizedForward.h:24
Base::state_matrix_t state_matrix_t
Definition: HyALinearizedForward.h:21
virtual const state_control_matrix_t & getDerivativeControl(const state_vector_t &x, const control_vector_t &u, const double t=double(0.0)) override
Definition: HyALinearizedForward-impl.h:2968
virtual ~HyALinearizedForward()
Definition: HyALinearizedForward.h:31
StateVector< 12, double > state_vector_t
ct::core::StateVector< state_dim > x
virtual HyALinearizedForward * clone() const override
Definition: HyALinearizedForward.h:33
StateMatrix< 12, double > state_matrix_t
StateControlMatrix< 12, 6, double > state_control_matrix_t
Base::control_vector_t control_vector_t
Definition: HyALinearizedForward.h:20
ControlVector< 6, double > control_vector_t
Base::state_vector_t state_vector_t
Definition: HyALinearizedForward.h:19