- 3.0.2 optimal control module.
ConstraintsContainerDms.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 
7 #pragma once
8 
9 #include <Eigen/Dense>
10 
14 
21 
22 
23 namespace ct {
24 namespace optcon {
25 
34 template <size_t STATE_DIM, size_t CONTROL_DIM, typename SCALAR = double>
36 {
37 public:
38  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
39 
41 
42  typedef typename DIMENSIONS::state_vector_t state_vector_t;
43  typedef typename DIMENSIONS::control_vector_t control_vector_t;
44 
45  typedef typename DIMENSIONS::state_matrix_t state_matrix_t;
46  typedef typename DIMENSIONS::control_matrix_t control_matrix_t;
47  typedef typename DIMENSIONS::state_control_matrix_t state_control_matrix_t;
48  typedef typename DIMENSIONS::state_matrix_array_t state_matrix_array_t;
49  typedef typename DIMENSIONS::state_control_matrix_array_t state_control_matrix_array_t;
50 
63  std::shared_ptr<tpl::TimeGrid<SCALAR>> timeGrid,
64  std::vector<std::shared_ptr<ShotContainer<STATE_DIM, CONTROL_DIM, SCALAR>>> shotContainers,
65  std::shared_ptr<ConstraintDiscretizer<STATE_DIM, CONTROL_DIM, SCALAR>> discretizedConstraints,
66  const state_vector_t& x0,
67  const DmsSettings settings);
68 
72  ~ConstraintsContainerDms() override = default;
73 
74  void prepareEvaluation() override;
75 
76  void prepareJacobianEvaluation() override;
77 
83  void changeInitialConstraint(const state_vector_t& x0);
84 
85 private:
86  const DmsSettings settings_;
87 
88  std::shared_ptr<InitStateConstraint<STATE_DIM, CONTROL_DIM, SCALAR>> c_init_;
89  std::vector<std::shared_ptr<ShotContainer<STATE_DIM, CONTROL_DIM, SCALAR>>> shotContainers_;
90 };
91 
93 
94 } // namespace optcon
95 } // namespace ct
DIMENSIONS::control_matrix_t control_matrix_t
Definition: ConstraintsContainerDms.h:46
void changeInitialConstraint(const state_vector_t &x0)
Updates the initial constraint.
Definition: ConstraintsContainerDms.h:59
void prepareEvaluation() override
Gets called before the constraint evaluation. This method should contain all the calculations needed ...
Definition: ConstraintsContainerDms.h:39
DIMENSIONS::state_matrix_array_t state_matrix_array_t
Definition: ConstraintsContainerDms.h:48
This class is a wrapper around the NLP Optvector. It wraps the Vectors from the NLP solvers into stat...
Definition: OptVectorDms.h:37
DIMENSIONS::state_vector_t state_vector_t
Definition: ConstraintsContainerDms.h:42
DIMENSIONS::state_control_matrix_t state_control_matrix_t
Definition: ConstraintsContainerDms.h:47
This class performs the state and the sensitivity integration on a shot.
Definition: ShotContainer.h:32
An abstract base class which serves as a container for all the discrete constraints used in the NLP...
Definition: DiscreteConstraintContainerBase.h:23
void prepareJacobianEvaluation() override
Gets called before the constraint jacobian evaluation. This method should contain all the calculation...
Definition: ConstraintsContainerDms.h:49
Defines basic types used in the DMS algorithm.
Definition: DmsDimensions.h:18
Definition: TimeGrid.h:27
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef DmsDimensions< STATE_DIM, CONTROL_DIM, SCALAR > DIMENSIONS
Definition: ConstraintsContainerDms.h:40
Container class for the constraints used in DMS.
Definition: ConstraintsContainerDms.h:35
Defines the DMS settings.
Definition: DmsSettings.h:23
The class takes continuous constraints defined with the constraint toolbox and discretizes them over ...
Definition: ConstraintDiscretizer.h:30
DIMENSIONS::control_vector_t control_vector_t
Definition: ConstraintsContainerDms.h:43
DIMENSIONS::state_control_matrix_array_t state_control_matrix_array_t
Definition: ConstraintsContainerDms.h:49
StateVector< state_dim > x0
Definition: ConstrainedNLOCTest.cpp:14
~ConstraintsContainerDms() override=default
Destructor.
ConstraintsContainerDms(std::shared_ptr< OptVectorDms< STATE_DIM, CONTROL_DIM, SCALAR >> w, std::shared_ptr< tpl::TimeGrid< SCALAR >> timeGrid, std::vector< std::shared_ptr< ShotContainer< STATE_DIM, CONTROL_DIM, SCALAR >>> shotContainers, std::shared_ptr< ConstraintDiscretizer< STATE_DIM, CONTROL_DIM, SCALAR >> discretizedConstraints, const state_vector_t &x0, const DmsSettings settings)
Custom constructor.
Definition: ConstraintsContainerDms.h:8
DIMENSIONS::state_matrix_t state_matrix_t
Definition: ConstraintsContainerDms.h:45