inverse-dynamics-formulation-acc-force.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2017 CNRS, NYU, MPI Tübingen, UNITN
3 //
4 // This file is part of tsid
5 // tsid is free software: you can redistribute it
6 // and/or modify it under the terms of the GNU Lesser General Public
7 // License as published by the Free Software Foundation, either version
8 // 3 of the License, or (at your option) any later version.
9 // tsid is distributed in the hope that it will be
10 // useful, but WITHOUT ANY WARRANTY; without even the implied warranty
11 // of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // General Lesser Public License for more details. You should have
13 // received a copy of the GNU Lesser General Public License along with
14 // tsid If not, see
15 // <http://www.gnu.org/licenses/>.
16 //
17 
18 #ifndef __invdyn_inverse_dynamics_formulation_acc_force_hpp__
19 #define __invdyn_inverse_dynamics_formulation_acc_force_hpp__
20 
21 #include <vector>
22 
26 
27 namespace tsid {
28 
30  public:
31  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
32 
33  double time_start;
34  double time_end;
35  double fMax_start;
36  double fMax_end;
37  std::shared_ptr<ContactLevel> contactLevel;
38 };
39 
42  public:
43  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
44 
55 
56  InverseDynamicsFormulationAccForce(const std::string& name,
57  RobotWrapper& robot, bool verbose = false);
58 
60 
61  Data& data();
62 
63  unsigned int nVar() const;
64  unsigned int nEq() const;
65  unsigned int nIn() const;
66 
67  bool addMotionTask(TaskMotion& task, double weight,
68  unsigned int priorityLevel,
69  double transition_duration = 0.0);
70 
71  bool addForceTask(TaskContactForce& task, double weight,
72  unsigned int priorityLevel,
73  double transition_duration = 0.0);
74 
75  bool addActuationTask(TaskActuation& task, double weight,
76  unsigned int priorityLevel,
77  double transition_duration = 0.0);
78 
79  bool updateTaskWeight(const std::string& task_name, double weight);
80 
81  bool addRigidContact(ContactBase& contact, double force_regularization_weight,
82  double motion_weight = 1.0,
83  unsigned int motion_priority_level = 0);
84 
85  TSID_DEPRECATED bool addRigidContact(ContactBase& contact);
86 
87  bool updateRigidContactWeights(const std::string& contact_name,
88  double force_regularization_weight,
89  double motion_weight = -1.0);
90 
91  bool addMeasuredForce(MeasuredForceBase& measuredForce);
92 
93  bool removeTask(const std::string& taskName,
94  double transition_duration = 0.0);
95 
96  bool removeRigidContact(const std::string& contactName,
97  double transition_duration = 0.0);
98 
99  bool removeMeasuredForce(const std::string& measuredForceName);
100 
101  const HQPData& computeProblemData(double time, ConstRefVector q,
102  ConstRefVector v);
103 
104  const Vector& getActuatorForces(const HQPOutput& sol);
105  const Vector& getAccelerations(const HQPOutput& sol);
106  const Vector& getContactForces(const HQPOutput& sol);
107  Vector getContactForces(const std::string& name, const HQPOutput& sol);
108  bool getContactForces(const std::string& name, const HQPOutput& sol,
109  RefVector f);
110 
111  public:
112  template <class TaskLevelPointer>
113  void addTask(TaskLevelPointer task, double weight,
114  unsigned int priorityLevel);
115 
116  void resizeHqpData();
117 
118  bool removeFromHqpData(const std::string& name);
119 
120  bool decodeSolution(const HQPOutput& sol);
121 
122  Data m_data;
124  std::vector<std::shared_ptr<TaskLevel>> m_taskMotions;
125  std::vector<std::shared_ptr<TaskLevelForce>> m_taskContactForces;
126  std::vector<std::shared_ptr<TaskLevel>> m_taskActuations;
127  std::vector<std::shared_ptr<ContactLevel>> m_contacts;
128  std::vector<std::shared_ptr<MeasuredForceLevel>> m_measuredForces;
129  double m_t;
130  unsigned int m_k;
131  unsigned int m_v;
132  unsigned int m_u;
133  unsigned int m_eq;
134  unsigned int m_in;
135  Matrix m_Jc;
136  std::shared_ptr<math::ConstraintEquality> m_baseDynamics;
137 
139  Vector m_dv;
140  Vector m_f;
141  Vector m_tau;
142 
143  Vector h_fext;
144 
145  std::vector<std::shared_ptr<ContactTransitionInfo>> m_contactTransitions;
146 };
147 } // namespace tsid
148 #endif // ifndef __invdyn_inverse_dynamics_formulation_acc_force_hpp__
Base template of a Task. Each class is defined according to a constant model of a robot...
Definition: task-base.hpp:34
Eigen::Matrix< Scalar, Eigen::Dynamic, Eigen::Dynamic > Matrix
Definition: math/fwd.hpp:36
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: math/fwd.hpp:35
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef pinocchio::Data Data
data
Definition: setup.in.py:48
std::vector< std::shared_ptr< ContactLevel > > m_contacts
Base template of a Contact.
std::shared_ptr< math::ConstraintEquality > m_baseDynamics
contact force Jacobian
unsigned int m_u
number of acceleration variables
unsigned int m_v
number of contact-force variables
const Eigen::Ref< const Vector > ConstRefVector
Definition: math/fwd.hpp:48
std::vector< std::shared_ptr< MeasuredForceLevel > > m_measuredForces
EIGEN_MAKE_ALIGNED_OPERATOR_NEW double time_start
Wrapper for a robot based on pinocchio.
std::shared_ptr< ContactLevel > contactLevel
max normal force at time time_end
double fMax_end
max normal force at time time_start
std::vector< std::shared_ptr< TaskLevelForce > > m_taskContactForces
std::vector< std::shared_ptr< TaskLevel > > m_taskActuations
std::vector< std::shared_ptr< TaskLevel > > m_taskMotions
std::vector< std::shared_ptr< ContactTransitionInfo > > m_contactTransitions
sum of external measured forces
Wrapper for a robot based on pinocchio.


tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Sun Jul 2 2023 02:21:51