tsid 1.9.0
Efficient Task Space Inverse Dynamics for Multi-body Systems based on Pinocchio
Loading...
Searching...
No Matches
task-joint-posVelAcc-bounds.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_task_joint_posVelAcc_bounds_hpp__
19#define __invdyn_task_joint_posVelAcc_bounds_hpp__
20
24#include <tsid/deprecated.hh>
25
33namespace tsid {
34namespace tasks {
35
37 public:
38 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
39
44 typedef pinocchio::Data Data;
45
46 TaskJointPosVelAccBounds(const std::string& name, RobotWrapper& robot,
47 double dt, bool verbose = true);
48
49 int dim() const override;
50
52 Data& data) override;
53
54 const ConstraintBase& getConstraint() const override;
55
56 void setTimeStep(double dt);
60 const Vector& getAccelerationBounds() const;
61 const Vector& getVelocityBounds() const;
62 const Vector& getPositionLowerBounds() const;
63 const Vector& getPositionUpperBounds() const;
64
65 void setVerbose(bool verbose);
66
67 void setImposeBounds(bool impose_position_bounds, bool impose_velocity_bounds,
68 bool impose_viability_bounds,
69 bool impose_acceleration_bounds);
70
75 void isStateViable(ConstRefVector q, ConstRefVector dq, bool verbose = true);
76
81 bool verbose = true);
82
94 bool verbose = true);
95
103 bool verbose = true);
104
105 TSID_DEPRECATED const Vector& mask() const; // deprecated
106 TSID_DEPRECATED void mask(const Vector& mask); // deprecated
107 virtual void setMask(math::ConstRefVector mask) override;
108
109 protected:
111 double m_dt;
113 int m_nv, m_na;
114
117
118 Vector m_qa; // actuated part of q
119 Vector m_dqa; // actuated part of dq
120
121 double m_eps; // tolerance used to check violations
122
123 Vector m_qMin; // joints position limits
124 Vector m_qMax; // joints position limits
125 Vector m_dqMax; // joints max velocity limits
126 Vector m_ddqMax; // joints max acceleration limits
127
128 Vector m_dqMinViab; // velocity lower limits from viability
129 Vector m_dqMaxViab; // velocity upper limits from viability
130
131 Vector m_ddqLBPos; // acceleration lower bound from position bounds
132 Vector m_ddqUBPos; // acceleration upper bound from position bounds
133 Vector m_ddqLBVia; // acceleration lower bound from viability bounds
134 Vector m_ddqUBVia; // acceleration upper bound from viability bounds
135 Vector m_ddqLBVel; // acceleration lower bound from velocity bounds
136 Vector m_ddqUBVel; // acceleration upper bound from velocity bounds
137 Vector m_ddqLBAcc; // acceleration lower bound from acceleration bounds
138 Vector m_ddqUBAcc; // acceleration upper bound from acceleration bounds
139
140 Vector m_ddqLB; // final acceleration bounds
141 Vector m_ddqUB; // final acceleration bounds
142
147
148 Vector m_viabViol; // 0 if the state is viable, error otherwise
149
150 // Used in computeAccLimitsFromPosLimits
157
158 // Used in computeAccLimitsFromViability
166 double m_two_a;
175
176 // Used in computeAccLimits
179};
180
181} // namespace tasks
182} // namespace tsid
183
184#endif // ifndef __invdyn_task_joint_bounds_hpp__
Abstract class representing a linear equality/inequality constraint. Equality constraints are represe...
Definition constraint-base.hpp:22
Definition constraint-bound.hpp:13
Definition constraint-inequality.hpp:13
robots::RobotWrapper RobotWrapper
Definition task-base.hpp:41
const ConstraintBase & getConstraint() const override
Definition task-joint-posVelAcc-bounds.cpp:184
Vector m_dqMinViab
Definition task-joint-posVelAcc-bounds.hpp:128
Vector m_ddqLBVel
Definition task-joint-posVelAcc-bounds.hpp:135
TaskJointPosVelAccBounds(const std::string &name, RobotWrapper &robot, double dt, bool verbose=true)
Definition task-joint-posVelAcc-bounds.cpp:22
void setVerbose(bool verbose)
Definition task-joint-posVelAcc-bounds.cpp:148
Vector m_q_plus_dt_dq
Definition task-joint-posVelAcc-bounds.hpp:165
Vector m_two_ddqMax
Definition task-joint-posVelAcc-bounds.hpp:162
Vector m_lb
Definition task-joint-posVelAcc-bounds.hpp:178
Vector m_ub
Definition task-joint-posVelAcc-bounds.hpp:177
TSID_DEPRECATED const Vector & mask() const
Definition task-joint-posVelAcc-bounds.cpp:96
bool m_impose_position_bounds
Definition task-joint-posVelAcc-bounds.hpp:143
Vector m_ddqLB
Definition task-joint-posVelAcc-bounds.hpp:140
Vector m_dqMax
Definition task-joint-posVelAcc-bounds.hpp:125
Vector m_dqa
Definition task-joint-posVelAcc-bounds.hpp:119
void computeAccLimits(ConstRefVector q, ConstRefVector dq, bool verbose=true)
Definition task-joint-posVelAcc-bounds.cpp:356
void setPositionBounds(ConstRefVector lower, ConstRefVector upper)
Definition task-joint-posVelAcc-bounds.cpp:150
bool m_impose_acceleration_bounds
Definition task-joint-posVelAcc-bounds.hpp:146
double m_two_a
Definition task-joint-posVelAcc-bounds.hpp:166
Vector m_ddqMax_q2
Definition task-joint-posVelAcc-bounds.hpp:154
Vector m_c_2
Definition task-joint-posVelAcc-bounds.hpp:173
Vector m_minus_dq_over_dt
Definition task-joint-posVelAcc-bounds.hpp:156
double m_eps
Definition task-joint-posVelAcc-bounds.hpp:121
const ConstraintBase & compute(double t, ConstRefVector q, ConstRefVector v, Data &data) override
Definition task-joint-posVelAcc-bounds.cpp:188
int m_nv
Definition task-joint-posVelAcc-bounds.hpp:113
void setTimeStep(double dt)
Definition task-joint-posVelAcc-bounds.cpp:143
Vector m_ddqLBPos
Definition task-joint-posVelAcc-bounds.hpp:131
bool m_verbose
Definition task-joint-posVelAcc-bounds.hpp:112
Vector m_delta_1
Definition task-joint-posVelAcc-bounds.hpp:172
math::ConstraintInequality ConstraintInequality
Definition task-joint-posVelAcc-bounds.hpp:42
Vector m_ddqMax
Definition task-joint-posVelAcc-bounds.hpp:126
int m_na
Definition task-joint-posVelAcc-bounds.hpp:113
Vector m_ddqLBVia
Definition task-joint-posVelAcc-bounds.hpp:133
pinocchio::Data Data
Definition task-joint-posVelAcc-bounds.hpp:44
double m_dt
Definition task-joint-posVelAcc-bounds.hpp:111
math::ConstraintBound ConstraintBound
Definition task-joint-posVelAcc-bounds.hpp:41
VectorXi m_activeAxes
Definition task-joint-posVelAcc-bounds.hpp:116
Vector m_dqMaxViab
Definition task-joint-posVelAcc-bounds.hpp:129
Vector m_ddqMax_q3
Definition task-joint-posVelAcc-bounds.hpp:152
Vector m_ddqMin_q2
Definition task-joint-posVelAcc-bounds.hpp:155
Vector m_ddqLBAcc
Definition task-joint-posVelAcc-bounds.hpp:137
Vector m_b_2
Definition task-joint-posVelAcc-bounds.hpp:168
Vector m_dt_ddqMax_dt
Definition task-joint-posVelAcc-bounds.hpp:163
Vector m_ddqUB
Definition task-joint-posVelAcc-bounds.hpp:141
Vector m_ddqUBPos
Definition task-joint-posVelAcc-bounds.hpp:132
void setVelocityBounds(ConstRefVector upper)
Definition task-joint-posVelAcc-bounds.cpp:166
bool m_impose_viability_bounds
Definition task-joint-posVelAcc-bounds.hpp:145
Vector m_dq_square
Definition task-joint-posVelAcc-bounds.hpp:164
int dim() const override
Return the dimension of the task. \info should be overloaded in the child class.
Definition task-joint-posVelAcc-bounds.cpp:125
void isStateViable(ConstRefVector q, ConstRefVector dq, bool verbose=true)
Definition task-joint-posVelAcc-bounds.cpp:212
Vector m_delta_2
Definition task-joint-posVelAcc-bounds.hpp:174
void setAccelerationBounds(ConstRefVector upper)
Definition task-joint-posVelAcc-bounds.cpp:175
Vector m_qMax
Definition task-joint-posVelAcc-bounds.hpp:124
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef math::Vector Vector
Definition task-joint-posVelAcc-bounds.hpp:40
void computeAccLimitsFromPosLimits(ConstRefVector q, ConstRefVector dq, bool verbose=true)
Definition task-joint-posVelAcc-bounds.cpp:266
Vector m_ddq_2
Definition task-joint-posVelAcc-bounds.hpp:170
double m_two_dt_sq
Definition task-joint-posVelAcc-bounds.hpp:151
Vector m_ddqUBAcc
Definition task-joint-posVelAcc-bounds.hpp:138
Vector m_qa
Definition task-joint-posVelAcc-bounds.hpp:118
Vector m_ddqUBVia
Definition task-joint-posVelAcc-bounds.hpp:134
double m_dt_square
Definition task-joint-posVelAcc-bounds.hpp:159
Vector m_dt_dq
Definition task-joint-posVelAcc-bounds.hpp:160
void computeAccLimitsFromViability(ConstRefVector q, ConstRefVector dq, bool verbose=true)
Definition task-joint-posVelAcc-bounds.cpp:310
const Vector & getVelocityBounds() const
Definition task-joint-posVelAcc-bounds.cpp:131
bool m_impose_velocity_bounds
Definition task-joint-posVelAcc-bounds.hpp:144
Vector m_mask
Definition task-joint-posVelAcc-bounds.hpp:115
Vector m_viabViol
Definition task-joint-posVelAcc-bounds.hpp:148
math::VectorXi VectorXi
Definition task-joint-posVelAcc-bounds.hpp:43
ConstraintInequality m_constraint
Definition task-joint-posVelAcc-bounds.hpp:110
Vector m_ddqMin_q3
Definition task-joint-posVelAcc-bounds.hpp:153
Vector m_dt_two_dq
Definition task-joint-posVelAcc-bounds.hpp:161
virtual void setMask(math::ConstRefVector mask) override
Definition task-joint-posVelAcc-bounds.cpp:104
Vector m_b_1
Definition task-joint-posVelAcc-bounds.hpp:167
void setImposeBounds(bool impose_position_bounds, bool impose_velocity_bounds, bool impose_viability_bounds, bool impose_acceleration_bounds)
Definition task-joint-posVelAcc-bounds.cpp:203
Vector m_ddqUBVel
Definition task-joint-posVelAcc-bounds.hpp:136
const Vector & getPositionUpperBounds() const
Definition task-joint-posVelAcc-bounds.cpp:139
const Vector & getAccelerationBounds() const
Definition task-joint-posVelAcc-bounds.cpp:127
Vector m_c_1
Definition task-joint-posVelAcc-bounds.hpp:171
const Vector & getPositionLowerBounds() const
Definition task-joint-posVelAcc-bounds.cpp:135
Vector m_qMin
Definition task-joint-posVelAcc-bounds.hpp:123
Vector m_ddq_1
Definition task-joint-posVelAcc-bounds.hpp:169
TaskMotion(const std::string &name, RobotWrapper &robot)
Definition task-motion.cpp:13
std::string name(const LieGroupGenericTpl< LieGroupCollection > &lg)
const Eigen::Ref< const Vector > ConstRefVector
Definition fwd.hpp:35
Eigen::VectorXi VectorXi
Definition fwd.hpp:24
Eigen::Matrix< Scalar, Eigen::Dynamic, 1 > Vector
Definition fwd.hpp:22
Definition fwd.hpp:9
Definition constraint-bound.hpp:25