BoundedSpeedConstr.h
Go to the documentation of this file.
1 /*
2  * Copyright 2015-2022 CNRS-UM LIRMM, CNRS-AIST JRL
3  */
4 
5 #pragma once
6 
8 
9 #include <mc_rtc/void_ptr.h>
10 
11 namespace mc_solver
12 {
13 
19 {
20 public:
21  BoundedSpeedConstr(const mc_rbdyn::Robots & robots, unsigned int robotIndex, double dt);
22 
23  void addToSolverImpl(QPSolver & solver) override;
24 
25  void removeFromSolverImpl(QPSolver & solver) override;
26 
39  inline void addBoundedSpeed(QPSolver & solver,
40  const std::string & bodyName,
41  const Eigen::Vector3d & bodyPoint,
42  const Eigen::MatrixXd & dof,
43  const Eigen::VectorXd & speed)
44  {
45  addBoundedSpeed(solver, bodyName, bodyPoint, dof, speed, speed);
46  }
47 
62  void addBoundedSpeed(QPSolver & solver,
63  const std::string & bodyName,
64  const Eigen::Vector3d & bodyPoint,
65  const Eigen::MatrixXd & dof,
66  const Eigen::VectorXd & lowerSpeed,
67  const Eigen::VectorXd & upperSpeed);
68 
79  inline void addBoundedSpeed(QPSolver & solver,
80  const mc_rbdyn::RobotFrame & frame,
81  const Eigen::MatrixXd & dof,
82  const Eigen::VectorXd & speed)
83  {
84  addBoundedSpeed(solver, frame, dof, speed, speed);
85  }
86 
99  void addBoundedSpeed(QPSolver & solver,
100  const mc_rbdyn::RobotFrame & frame,
101  const Eigen::MatrixXd & dof,
102  const Eigen::VectorXd & lowerSpeed,
103  const Eigen::VectorXd & upperSpeed);
104 
106  bool removeBoundedSpeed(QPSolver & solver, const std::string & frameName);
107 
108  size_t nrBoundedSpeeds() const;
109 
110  void reset(QPSolver & solver);
111 
112 private:
121  mc_rtc::void_ptr constraint_;
122  unsigned int robotIndex;
123 };
124 
125 } // namespace mc_solver
mc_rbdyn::Robots
Definition: Robots.h:15
void_ptr.h
ConstraintSet.h
mc_solver::QPSolver
Definition: QPSolver.h:85
mc_solver::ConstraintSet
This class is a basis to wrap Constraint functions from Tasks. The aim of such wrappers should be two...
Definition: ConstraintSet.h:20
mc_solver::BoundedSpeedConstr::addBoundedSpeed
void addBoundedSpeed(QPSolver &solver, const mc_rbdyn::RobotFrame &frame, const Eigen::MatrixXd &dof, const Eigen::VectorXd &speed)
Definition: BoundedSpeedConstr.h:79
mc_rbdyn::RobotFrame
Definition: RobotFrame.h:21
mc_solver::BoundedSpeedConstr
Definition: BoundedSpeedConstr.h:18
mc_rtc::void_ptr
std::unique_ptr< void, void(*)(void *)> void_ptr
Definition: void_ptr.h:14
mc_solver
Definition: Contact.h:17
mc_solver::BoundedSpeedConstr::addBoundedSpeed
void addBoundedSpeed(QPSolver &solver, const std::string &bodyName, const Eigen::Vector3d &bodyPoint, const Eigen::MatrixXd &dof, const Eigen::VectorXd &speed)
Definition: BoundedSpeedConstr.h:39
MC_SOLVER_DLLAPI
#define MC_SOLVER_DLLAPI
Definition: api.h:50