inverse-dynamics-formulation-base.hpp
Go to the documentation of this file.
1 //
2 // Copyright (c) 2017 CNRS
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_base_hpp__
19 #define __invdyn_inverse_dynamics_formulation_base_hpp__
20 
21 #include "tsid/deprecated.hh"
22 #include "tsid/math/fwd.hpp"
30 
31 #include <string>
32 
33 namespace tsid {
34 
35 struct TaskLevel {
36  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
37 
39  std::shared_ptr<math::ConstraintBase> constraint;
40  unsigned int priority;
41 
42  TaskLevel(tasks::TaskBase& task, unsigned int priority);
43 };
44 
46  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
47 
49  std::shared_ptr<math::ConstraintBase> constraint;
50  unsigned int priority;
51 
53 };
54 
56  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
57 
59 
61 };
62 
67  public:
68  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
69 
83 
85  bool verbose = false);
86 
87  virtual ~InverseDynamicsFormulationBase() = default;
88 
89  virtual Data& data() = 0;
90 
91  virtual unsigned int nVar() const = 0;
92  virtual unsigned int nEq() const = 0;
93  virtual unsigned int nIn() const = 0;
94 
95  virtual bool addMotionTask(TaskMotion& task, double weight,
96  unsigned int priorityLevel,
97  double transition_duration = 0.0) = 0;
98 
99  virtual bool addForceTask(TaskContactForce& task, double weight,
100  unsigned int priorityLevel,
101  double transition_duration = 0.0) = 0;
102 
103  virtual bool addActuationTask(TaskActuation& task, double weight,
104  unsigned int priorityLevel,
105  double transition_duration = 0.0) = 0;
106 
107  virtual bool updateTaskWeight(const std::string& task_name,
108  double weight) = 0;
109 
121  virtual bool addRigidContact(ContactBase& contact,
122  double force_regularization_weight,
123  double motion_weight = 1.0,
124  unsigned int motion_priority_level = 0) = 0;
125 
126  TSID_DEPRECATED virtual bool addRigidContact(ContactBase& contact);
127 
137  virtual bool updateRigidContactWeights(const std::string& contact_name,
138  double force_regularization_weight,
139  double motion_weight = -1.0) = 0;
140 
141  virtual bool addMeasuredForce(MeasuredForceBase& measuredForce) = 0;
142 
143  virtual bool removeTask(const std::string& taskName,
144  double transition_duration = 0.0) = 0;
145 
146  virtual bool removeRigidContact(const std::string& contactName,
147  double transition_duration = 0.0) = 0;
148 
149  virtual bool removeMeasuredForce(const std::string& measuredForceName) = 0;
150 
151  virtual const HQPData& computeProblemData(double time, ConstRefVector q,
152  ConstRefVector v) = 0;
153 
154  virtual const Vector& getActuatorForces(const HQPOutput& sol) = 0;
155  virtual const Vector& getAccelerations(const HQPOutput& sol) = 0;
156  virtual const Vector& getContactForces(const HQPOutput& sol) = 0;
157  virtual bool getContactForces(const std::string& name, const HQPOutput& sol,
158  RefVector f) = 0;
159 
160  protected:
161  std::string m_name;
163  bool m_verbose;
164 };
165 
166 } // namespace tsid
167 
168 #endif // ifndef __invdyn_inverse_dynamics_formulation_base_hpp__
tsid::TaskLevelForce::task
EIGEN_MAKE_ALIGNED_OPERATOR_NEW tasks::TaskContactForce & task
Definition: inverse-dynamics-formulation-base.hpp:48
tsid::MeasuredForceLevel
Definition: inverse-dynamics-formulation-base.hpp:55
demo_quadruped.v
v
Definition: demo_quadruped.py:80
tsid::InverseDynamicsFormulationBase::getContactForces
virtual const Vector & getContactForces(const HQPOutput &sol)=0
tsid::InverseDynamicsFormulationBase::addMotionTask
virtual bool addMotionTask(TaskMotion &task, double weight, unsigned int priorityLevel, double transition_duration=0.0)=0
tsid::tasks::TaskBase
Base template of a Task. Each class is defined according to a constant model of a robot.
Definition: task-base.hpp:34
tsid::InverseDynamicsFormulationBase::Vector
math::Vector Vector
Definition: inverse-dynamics-formulation-base.hpp:71
tsid::contacts::ContactBase
Base template of a Contact.
Definition: contact-base.hpp:31
tsid::InverseDynamicsFormulationBase::TaskContactForce
tasks::TaskContactForce TaskContactForce
Definition: inverse-dynamics-formulation-base.hpp:75
tsid::InverseDynamicsFormulationBase::m_name
std::string m_name
Definition: inverse-dynamics-formulation-base.hpp:161
tsid::TaskLevelForce
Definition: inverse-dynamics-formulation-base.hpp:45
tsid::TaskLevel
Definition: inverse-dynamics-formulation-base.hpp:35
pinocchio::DataTpl
tsid::InverseDynamicsFormulationBase::InverseDynamicsFormulationBase
InverseDynamicsFormulationBase(const std::string &name, RobotWrapper &robot, bool verbose=false)
Definition: inverse-dynamics-formulation-base.cpp:29
tsid::InverseDynamicsFormulationBase::TaskActuation
tasks::TaskActuation TaskActuation
Definition: inverse-dynamics-formulation-base.hpp:76
tsid::InverseDynamicsFormulationBase::Data
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef pinocchio::Data Data
Definition: inverse-dynamics-formulation-base.hpp:70
task-motion.hpp
tsid::InverseDynamicsFormulationBase::updateTaskWeight
virtual bool updateTaskWeight(const std::string &task_name, double weight)=0
tsid::InverseDynamicsFormulationBase::removeMeasuredForce
virtual bool removeMeasuredForce(const std::string &measuredForceName)=0
tsid::InverseDynamicsFormulationBase::getActuatorForces
virtual const Vector & getActuatorForces(const HQPOutput &sol)=0
tsid::tasks::TaskContactForce
Definition: task-contact-force.hpp:28
tsid::TaskLevel::constraint
std::shared_ptr< math::ConstraintBase > constraint
Definition: inverse-dynamics-formulation-base.hpp:39
tsid::TaskLevel::TaskLevel
TaskLevel(tasks::TaskBase &task, unsigned int priority)
Definition: inverse-dynamics-formulation-base.cpp:22
demo_quadruped.robot
robot
Definition: demo_quadruped.py:51
tsid::InverseDynamicsFormulationBase::ContactBase
contacts::ContactBase ContactBase
Definition: inverse-dynamics-formulation-base.hpp:79
tsid::InverseDynamicsFormulationBase::nEq
virtual unsigned int nEq() const =0
tsid::contacts::MeasuredForceBase
Definition: measured-force-base.hpp:28
tsid::InverseDynamicsFormulationBase::TaskMotion
tasks::TaskMotion TaskMotion
Definition: inverse-dynamics-formulation-base.hpp:74
tsid::InverseDynamicsFormulationBase::addMeasuredForce
virtual bool addMeasuredForce(MeasuredForceBase &measuredForce)=0
tsid::InverseDynamicsFormulationBase
Wrapper for a robot based on pinocchio.
Definition: inverse-dynamics-formulation-base.hpp:66
tsid::InverseDynamicsFormulationBase::~InverseDynamicsFormulationBase
virtual ~InverseDynamicsFormulationBase()=default
tsid::InverseDynamicsFormulationBase::MeasuredForceBase
contacts::MeasuredForceBase MeasuredForceBase
Definition: inverse-dynamics-formulation-base.hpp:78
tsid::InverseDynamicsFormulationBase::RobotWrapper
robots::RobotWrapper RobotWrapper
Definition: inverse-dynamics-formulation-base.hpp:82
test_Contact.contact
contact
Definition: test_Contact.py:37
demo_quadruped.q
q
Definition: demo_quadruped.py:74
tsid::math::RefVector
Eigen::Ref< Vector > RefVector
Definition: math/fwd.hpp:47
tsid::InverseDynamicsFormulationBase::computeProblemData
virtual const HQPData & computeProblemData(double time, ConstRefVector q, ConstRefVector v)=0
tsid::solvers::HQPOutput
Definition: solver-HQP-output.hpp:29
tsid::InverseDynamicsFormulationBase::RefVector
math::RefVector RefVector
Definition: inverse-dynamics-formulation-base.hpp:72
tsid::InverseDynamicsFormulationBase::addForceTask
virtual bool addForceTask(TaskContactForce &task, double weight, unsigned int priorityLevel, double transition_duration=0.0)=0
robot-wrapper.hpp
tsid::InverseDynamicsFormulationBase::getAccelerations
virtual const Vector & getAccelerations(const HQPOutput &sol)=0
tsid::InverseDynamicsFormulationBase::nVar
virtual unsigned int nVar() const =0
fwd.hpp
tsid::InverseDynamicsFormulationBase::m_verbose
bool m_verbose
Definition: inverse-dynamics-formulation-base.hpp:163
tsid::InverseDynamicsFormulationBase::removeRigidContact
virtual bool removeRigidContact(const std::string &contactName, double transition_duration=0.0)=0
tsid::InverseDynamicsFormulationBase::data
virtual Data & data()=0
setup.name
name
Definition: setup.in.py:179
solver-HQP-base.hpp
tsid::tasks::TaskMotion
Definition: task-motion.hpp:26
tsid::math::ConstRefVector
const typedef Eigen::Ref< const Vector > ConstRefVector
Definition: math/fwd.hpp:48
tsid::MeasuredForceLevel::measuredForce
EIGEN_MAKE_ALIGNED_OPERATOR_NEW contacts::MeasuredForceBase & measuredForce
Definition: inverse-dynamics-formulation-base.hpp:58
tsid::math::Vector
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition: math/fwd.hpp:35
tsid::InverseDynamicsFormulationBase::HQPData
solvers::HQPData HQPData
Definition: inverse-dynamics-formulation-base.hpp:80
tsid::TaskLevelForce::constraint
std::shared_ptr< math::ConstraintBase > constraint
Definition: inverse-dynamics-formulation-base.hpp:49
demo_quadruped.time
time
Definition: demo_quadruped.py:213
tsid::InverseDynamicsFormulationBase::m_robot
RobotWrapper m_robot
Definition: inverse-dynamics-formulation-base.hpp:162
tsid::InverseDynamicsFormulationBase::TaskBase
tasks::TaskBase TaskBase
Definition: inverse-dynamics-formulation-base.hpp:77
measured-force-base.hpp
tsid
Definition: bindings/python/constraint/constraint-bound.cpp:21
task-contact-force.hpp
tsid::tasks::TaskActuation
Definition: task-actuation.hpp:25
tsid::TaskLevelForce::TaskLevelForce
TaskLevelForce(tasks::TaskContactForce &task, unsigned int priority)
Definition: inverse-dynamics-formulation-base.cpp:25
tsid::robots::RobotWrapper
Wrapper for a robot based on pinocchio.
Definition: robots/robot-wrapper.hpp:37
tsid::MeasuredForceLevel::MeasuredForceLevel
MeasuredForceLevel(contacts::MeasuredForceBase &measuredForce)
Definition: inverse-dynamics-formulation-base.cpp:33
tsid::TaskLevel::task
EIGEN_MAKE_ALIGNED_OPERATOR_NEW tasks::TaskBase & task
Definition: inverse-dynamics-formulation-base.hpp:38
tsid::TaskLevelForce::priority
unsigned int priority
Definition: inverse-dynamics-formulation-base.hpp:50
tsid::InverseDynamicsFormulationBase::addRigidContact
virtual bool addRigidContact(ContactBase &contact, double force_regularization_weight, double motion_weight=1.0, unsigned int motion_priority_level=0)=0
Add a rigid contact constraint to the model, introducing the associated reaction forces as problem va...
tsid::InverseDynamicsFormulationBase::ConstRefVector
math::ConstRefVector ConstRefVector
Definition: inverse-dynamics-formulation-base.hpp:73
tsid::InverseDynamicsFormulationBase::removeTask
virtual bool removeTask(const std::string &taskName, double transition_duration=0.0)=0
task-actuation.hpp
tsid::InverseDynamicsFormulationBase::nIn
virtual unsigned int nIn() const =0
contact-base.hpp
tsid::solvers::HQPData
pinocchio::container::aligned_vector< ConstraintLevel > HQPData
Definition: solvers/fwd.hpp:99
tsid::InverseDynamicsFormulationBase::updateRigidContactWeights
virtual bool updateRigidContactWeights(const std::string &contact_name, double force_regularization_weight, double motion_weight=-1.0)=0
Update the weights associated to the specified contact.
tsid::InverseDynamicsFormulationBase::addActuationTask
virtual bool addActuationTask(TaskActuation &task, double weight, unsigned int priorityLevel, double transition_duration=0.0)=0
tsid::TaskLevel::priority
unsigned int priority
Definition: inverse-dynamics-formulation-base.hpp:40
tsid::InverseDynamicsFormulationBase::HQPOutput
solvers::HQPOutput HQPOutput
Definition: inverse-dynamics-formulation-base.hpp:81


tsid
Author(s): Andrea Del Prete, Justin Carpentier
autogenerated on Thu Apr 3 2025 02:47:15