- 3.0.2 rigid body dynamics module.
FloatingBaseNLOCContactModel.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 
10 
11 namespace ct {
12 namespace rbd {
13 
17 template <class RBDDynamics>
19 {
20 public:
21  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
22 
23  static const bool quatIntegration = false;
24  static const bool eeForcesAreControlInputs = false;
25 
30 
32 
39 
41 
42 
44  FloatingBaseNLOCContactModel(const std::string& costFunctionFile,
45  const std::string& settingsFile,
46  std::shared_ptr<FBSystem> system = std::shared_ptr<FBSystem>(new FBSystem),
47  std::shared_ptr<LinearizedSystem> linearizedSystem = nullptr);
48 
50  FloatingBaseNLOCContactModel(const std::string& costFunctionFile,
51  const typename NLOptConSolver::Settings_t& settings,
52  std::shared_ptr<FBSystem> system = std::shared_ptr<FBSystem>(new FBSystem),
53  std::shared_ptr<LinearizedSystem> linearizedSystem = nullptr);
54 
55  void initialize(const typename RBDDynamics::RBDState_t& x0,
56  const core::Time& tf,
57  StateVectorArray x_ref = StateVectorArray(),
58  FeedbackArray u0_fb = FeedbackArray(),
59  ControlVectorArray u0_ff = ControlVectorArray());
60 
61  void configure(const typename NLOptConSolver::Settings_t& settings);
62 
63  bool runIteration();
64 
65  const StateVectorArray& retrieveLastRollout();
66 
67  const StateVectorArray& getStateVectorArray();
68 
70 
71  const FeedbackArray& getFeedbackArray();
72 
73  const ControlVectorArray& getControlVectorArray();
74 
75  const typename NLOptConSolver::Settings_t& getSettings() const;
76 
77  void changeCostFunction(std::shared_ptr<CostFunction> costFunction);
78 
79  std::shared_ptr<NLOptConSolver> getSolver();
80 
81 private:
82  std::shared_ptr<FBSystem> system_;
83  std::shared_ptr<LinearizedSystem> linearizedSystem_;
84  std::shared_ptr<CostFunction> costFunction_;
85 
87 
88  std::shared_ptr<NLOptConSolver> solver_;
89 
90  size_t iteration_;
91 };
92 }
93 }
void initialize(const typename RBDDynamics::RBDState_t &x0, const core::Time &tf, StateVectorArray x_ref=StateVectorArray(), FeedbackArray u0_fb=FeedbackArray(), ControlVectorArray u0_ff=ControlVectorArray())
Definition: FloatingBaseNLOCContactModel-impl.h:40
const StateVectorArray & getStateVectorArray()
Definition: FloatingBaseNLOCContactModel-impl.h:77
ct::core::SystemLinearizer< FBSystem::STATE_DIM, FBSystem::CONTROL_DIM > SystemLinearizer
Definition: FloatingBaseNLOCContactModel.h:29
NLOC for floating base systems with an explicit contact model.
Definition: FloatingBaseNLOCContactModel.h:18
std::shared_ptr< NLOptConSolver > getSolver()
Definition: FloatingBaseNLOCContactModel-impl.h:117
core::StateVector< FBSystem::STATE_DIM > StateVector
Definition: FloatingBaseNLOCContactModel.h:33
const NLOptConSolver::Settings_t & getSettings() const
Definition: FloatingBaseNLOCContactModel-impl.h:104
A floating base rigid body system that uses forward dynamics. The input vector is assumed to consist ...
Definition: FloatingBaseFDSystem.h:21
void changeCostFunction(std::shared_ptr< CostFunction > costFunction)
Definition: FloatingBaseNLOCContactModel-impl.h:110
static const bool eeForcesAreControlInputs
Definition: FloatingBaseNLOCContactModel.h:24
const core::TimeArray & getTimeArray()
Definition: FloatingBaseNLOCContactModel-impl.h:83
FloatingBaseFDSystem< RBDDynamics, false, false > FBSystem
Definition: FloatingBaseNLOCContactModel.h:26
const StateVectorArray & retrieveLastRollout()
Definition: FloatingBaseNLOCContactModel-impl.h:70
static EIGEN_MAKE_ALIGNED_OPERATOR_NEW const bool quatIntegration
Definition: FloatingBaseNLOCContactModel.h:23
ct::optcon::NLOptConSolver< FBSystem::STATE_DIM, FBSystem::CONTROL_DIM > NLOptConSolver
Definition: FloatingBaseNLOCContactModel.h:31
ct::core::LinearSystem< FBSystem::STATE_DIM, FBSystem::CONTROL_DIM > LinearizedSystem
Definition: FloatingBaseNLOCContactModel.h:27
const ControlVectorArray & getControlVectorArray()
Definition: FloatingBaseNLOCContactModel-impl.h:97
core::ControlVectorArray< FBSystem::CONTROL_DIM > ControlVectorArray
Definition: FloatingBaseNLOCContactModel.h:37
FloatingBaseNLOCContactModel(const std::string &costFunctionFile, const std::string &settingsFile, std::shared_ptr< FBSystem > system=std::shared_ptr< FBSystem >(new FBSystem), std::shared_ptr< LinearizedSystem > linearizedSystem=nullptr)
constructor taking path to the settings file
Definition: FloatingBaseNLOCContactModel-impl.h:12
ct::optcon::CostFunctionAnalytical< FBSystem::STATE_DIM, FBSystem::CONTROL_DIM > CostFunction
Definition: FloatingBaseNLOCContactModel.h:40
void configure(const typename NLOptConSolver::Settings_t &settings)
Definition: FloatingBaseNLOCContactModel-impl.h:54
ct::rbd::RbdLinearizer< FBSystem > RBDLinearizer
Definition: FloatingBaseNLOCContactModel.h:28
core::FeedbackArray< FBSystem::STATE_DIM, FBSystem::CONTROL_DIM > FeedbackArray
Definition: FloatingBaseNLOCContactModel.h:38
bool runIteration()
Definition: FloatingBaseNLOCContactModel-impl.h:60
const FeedbackArray & getFeedbackArray()
Definition: FloatingBaseNLOCContactModel-impl.h:90
Definition: RbdLinearizer.h:36
core::ControlVector< FBSystem::CONTROL_DIM > ControlVector
Definition: FloatingBaseNLOCContactModel.h:34
core::FeedbackMatrix< FBSystem::STATE_DIM, FBSystem::CONTROL_DIM > FeedbackMatrix
Definition: FloatingBaseNLOCContactModel.h:35
double Time
core::StateVectorArray< FBSystem::STATE_DIM > StateVectorArray
Definition: FloatingBaseNLOCContactModel.h:36