| Line |
Branch |
Exec |
Source |
| 1 |
|
|
// |
| 2 |
|
|
// Copyright (c) 2020 CNRS, NYU, MPI Tübingen, PAL Robotics |
| 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_capture_point_inequality_hpp__ |
| 19 |
|
|
#define __invdyn_task_capture_point_inequality_hpp__ |
| 20 |
|
|
|
| 21 |
|
|
#include <tsid/tasks/task-motion.hpp> |
| 22 |
|
|
#include <tsid/trajectories/trajectory-base.hpp> |
| 23 |
|
|
#include <tsid/math/constraint-inequality.hpp> |
| 24 |
|
|
#include <vector> |
| 25 |
|
|
#include <pinocchio/multibody/model.hpp> |
| 26 |
|
|
#include <pinocchio/multibody/data.hpp> |
| 27 |
|
|
|
| 28 |
|
|
namespace tsid { |
| 29 |
|
|
namespace tasks { |
| 30 |
|
|
|
| 31 |
|
|
class TaskCapturePointInequality : public TaskMotion { |
| 32 |
|
|
public: |
| 33 |
|
|
EIGEN_MAKE_ALIGNED_OPERATOR_NEW |
| 34 |
|
|
|
| 35 |
|
|
typedef math::Index Index; |
| 36 |
|
|
typedef math::Vector Vector; |
| 37 |
|
|
typedef math::Matrix Matrix; |
| 38 |
|
|
typedef math::Vector3 Vector3; |
| 39 |
|
|
typedef math::ConstraintInequality ConstraintInequality; |
| 40 |
|
|
typedef pinocchio::Data Data; |
| 41 |
|
|
typedef pinocchio::SE3 SE3; |
| 42 |
|
|
|
| 43 |
|
|
TaskCapturePointInequality(const std::string& name, RobotWrapper& robot, |
| 44 |
|
|
const double timeStep); |
| 45 |
|
|
|
| 46 |
|
✗ |
virtual ~TaskCapturePointInequality() {} |
| 47 |
|
|
|
| 48 |
|
|
int dim() const; |
| 49 |
|
|
|
| 50 |
|
|
const ConstraintBase& compute(const double t, ConstRefVector q, |
| 51 |
|
|
ConstRefVector v, Data& data); |
| 52 |
|
|
|
| 53 |
|
|
const ConstraintBase& getConstraint() const; |
| 54 |
|
|
|
| 55 |
|
|
Vector getAcceleration(ConstRefVector dv) const; |
| 56 |
|
|
|
| 57 |
|
|
const Vector& position() const; |
| 58 |
|
|
|
| 59 |
|
|
void setSupportLimitsXAxis(const double x_min, const double x_max); |
| 60 |
|
|
|
| 61 |
|
|
void setSupportLimitsYAxis(const double y_min, const double y_max); |
| 62 |
|
|
|
| 63 |
|
|
void setSafetyMargin(const double x_margin, const double y_margin); |
| 64 |
|
|
|
| 65 |
|
|
protected: |
| 66 |
|
|
Vector m_drift_vec; |
| 67 |
|
|
Vector3 m_drift; |
| 68 |
|
|
Vector m_p_com, m_v_com; |
| 69 |
|
|
Vector m_rp_min; |
| 70 |
|
|
Vector m_rp_max; |
| 71 |
|
|
|
| 72 |
|
|
ConstraintInequality m_constraint; |
| 73 |
|
|
|
| 74 |
|
|
Vector m_safety_margin; |
| 75 |
|
|
Vector m_support_limits_x; |
| 76 |
|
|
Vector m_support_limits_y; |
| 77 |
|
|
|
| 78 |
|
|
Eigen::Index m_nv; |
| 79 |
|
|
double m_delta_t; |
| 80 |
|
|
double m_g; |
| 81 |
|
|
double m_w; |
| 82 |
|
|
double m_ka; |
| 83 |
|
|
int m_dim; |
| 84 |
|
|
|
| 85 |
|
|
Vector b_lower; |
| 86 |
|
|
Vector b_upper; |
| 87 |
|
|
}; |
| 88 |
|
|
|
| 89 |
|
|
} // namespace tasks |
| 90 |
|
|
} // namespace tsid |
| 91 |
|
|
|
| 92 |
|
|
#endif // ifndef __invdyn_task_capture_point_inequality_hpp__ |
| 93 |
|
|
|