bounded_time_indexed_problem.h
Go to the documentation of this file.
1 //
2 // Copyright (c) 2019, University of Edinburgh
3 // All rights reserved.
4 //
5 // Redistribution and use in source and binary forms, with or without
6 // modification, are permitted provided that the following conditions are met:
7 //
8 // * Redistributions of source code must retain the above copyright notice,
9 // this list of conditions and the following disclaimer.
10 // * Redistributions in binary form must reproduce the above copyright
11 // notice, this list of conditions and the following disclaimer in the
12 // documentation and/or other materials provided with the distribution.
13 // * Neither the name of nor the names of its contributors may be used to
14 // endorse or promote products derived from this software without specific
15 // prior written permission.
16 //
17 // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
18 // AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 // IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 // ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
21 // LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
22 // CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
23 // SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
24 // INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
25 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
26 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
27 // POSSIBILITY OF SUCH DAMAGE.
28 //
29 
30 #ifndef EXOTICA_CORE_BOUNDED_TIME_INDEXED_PROBLEM_H_
31 #define EXOTICA_CORE_BOUNDED_TIME_INDEXED_PROBLEM_H_
32 
33 #include <exotica_core/bounded_time_indexed_problem_initializer.h>
35 
36 namespace exotica
37 {
39 class BoundedTimeIndexedProblem : public AbstractTimeIndexedProblem, public Instantiable<BoundedTimeIndexedProblemInitializer>
40 {
41 public:
43 
44  BoundedTimeIndexedProblem() = default;
45  virtual ~BoundedTimeIndexedProblem() = default;
46 
48  void Instantiate(const BoundedTimeIndexedProblemInitializer& init) override;
49 
51  void PreUpdate() override;
52 
56  void Update(Eigen::VectorXdRefConst x, int t) override;
57 
58  // Checks bound constraints
59  bool IsValid() override;
60 
61  // Delete general constraints
62  void SetGoalEQ(const std::string& task_name, Eigen::VectorXdRefConst goal, int t = 0) = delete;
63  Eigen::VectorXd GetGoalEQ(const std::string& task_name, int t = 0) = delete;
64  void SetRhoEQ(const std::string& task_name, const double rho, int t = 0) = delete;
65  double GetRhoEQ(const std::string& task_name, int t = 0) = delete;
66  void SetGoalNEQ(const std::string& task_name, Eigen::VectorXdRefConst goal, int t = 0) = delete;
67  Eigen::VectorXd GetGoalNEQ(const std::string& task_name, int t = 0) = delete;
68  void SetRhoNEQ(const std::string& task_name, const double rho, int t = 0) = delete;
69  double GetRhoNEQ(const std::string& task_name, int t = 0) = delete;
70  Eigen::VectorXd GetEquality() const = delete;
71  Eigen::VectorXd GetInequality() const = delete;
72  Eigen::SparseMatrix<double> GetEqualityJacobian() const = delete;
73  Eigen::SparseMatrix<double> GetInequalityJacobian() const = delete;
74  std::vector<Eigen::Triplet<double>> GetEqualityJacobianTriplets() const = delete;
76  Eigen::VectorXd GetEquality(int t) const = delete;
77  Eigen::MatrixXd GetEqualityJacobian(int t) const = delete;
78  Eigen::VectorXd GetInequality(int t) const = delete;
79  Eigen::MatrixXd GetInequalityJacobian(int t) const = delete;
80  std::vector<Eigen::Triplet<double>> GetInequalityJacobianTriplets() const = delete;
82  int get_joint_velocity_constraint_dimension() const = delete;
83  Eigen::VectorXd GetJointVelocityConstraint() const = delete;
84  Eigen::MatrixXd GetJointVelocityConstraintBounds() const = delete;
85  std::vector<Eigen::Triplet<double>> GetJointVelocityConstraintJacobianTriplets() const = delete;
86  Eigen::VectorXd GetJointVelocityLimits() const = delete;
87  void SetJointVelocityLimits(const Eigen::VectorXd& qdot_max_in) = delete;
88 
89 private:
90  void ReinitializeVariables() override;
91 };
92 typedef std::shared_ptr<exotica::BoundedTimeIndexedProblem> BoundedTimeIndexedProblemPtr;
93 } // namespace exotica
94 
95 #endif // EXOTICA_CORE_BOUNDED_TIME_INDEXED_PROBLEM_H_
void Update(Eigen::VectorXdRefConst x_trajectory_in)
Updates the entire problem from a given trajectory (e.g., used in an optimization solver) ...
Eigen::VectorXd GetGoalEQ(const std::string &task_name, int t=0)=delete
std::vector< Eigen::Triplet< double > > GetEqualityJacobianTriplets() const =delete
std::vector< Eigen::Triplet< double > > GetInequalityJacobianTriplets() const =delete
Eigen::SparseMatrix< double > GetEqualityJacobian() const =delete
virtual ~BoundedTimeIndexedProblem()=default
std::vector< Eigen::Triplet< double > > GetJointVelocityConstraintJacobianTriplets() const =delete
bool IsValid() override
Evaluates whether the problem is valid.
Eigen::SparseMatrix< double > GetInequalityJacobian() const =delete
std::shared_ptr< exotica::BoundedTimeIndexedProblem > BoundedTimeIndexedProblemPtr
void SetGoalNEQ(const std::string &task_name, Eigen::VectorXdRefConst goal, int t=0)=delete
void SetRhoEQ(const std::string &task_name, const double rho, int t=0)=delete
Eigen::VectorXd GetJointVelocityLimits() const =delete
void Update(Eigen::VectorXdRefConst x, int t) override
Updates an individual timestep from a given state vector.
std::vector< Eigen::VectorXd > x
Current internal problem state.
Eigen::VectorXd GetEquality() const =delete
void SetGoalEQ(const std::string &task_name, Eigen::VectorXdRefConst goal, int t=0)=delete
void PreUpdate() override
Updates internal variables before solving, e.g., after setting new values for Rho.
void SetRhoNEQ(const std::string &task_name, const double rho, int t=0)=delete
const Eigen::Ref< const Eigen::VectorXd > & VectorXdRefConst
Convenience wrapper for storing references to sub-matrices/vectors.
Definition: conversions.h:52
int get_active_nonlinear_equality_constraints_dimension() const =delete
Eigen::VectorXd GetGoalNEQ(const std::string &task_name, int t=0)=delete
void Instantiate(const BoundedTimeIndexedProblemInitializer &init) override
Instantiates the problem from an Initializer.
Eigen::MatrixXd GetJointVelocityConstraintBounds() const =delete
Eigen::VectorXd GetInequality() const =delete
Bound constrained time-indexed problem.
void SetJointVelocityLimits(const Eigen::VectorXd &qdot_max_in)=delete
Eigen::VectorXd GetJointVelocityConstraint() const =delete
int get_joint_velocity_constraint_dimension() const =delete
int get_active_nonlinear_inequality_constraints_dimension() const =delete
double GetRhoNEQ(const std::string &task_name, int t=0)=delete
double GetRhoEQ(const std::string &task_name, int t=0)=delete


exotica_core
Author(s): Yiming Yang, Michael Camilleri
autogenerated on Sat Apr 10 2021 02:34:49