| Line |
Branch |
Exec |
Source |
| 1 |
|
|
// |
| 2 |
|
|
// Copyright (c) 2021 University of Trento |
| 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_cop_equality_hpp__ |
| 19 |
|
|
#define __invdyn_task_cop_equality_hpp__ |
| 20 |
|
|
|
| 21 |
|
|
#include "tsid/math/fwd.hpp" |
| 22 |
|
|
#include "tsid/tasks/task-contact-force.hpp" |
| 23 |
|
|
#include "tsid/trajectories/trajectory-base.hpp" |
| 24 |
|
|
#include "tsid/math/constraint-equality.hpp" |
| 25 |
|
|
#include "tsid/formulations/inverse-dynamics-formulation-base.hpp" |
| 26 |
|
|
|
| 27 |
|
|
namespace tsid { |
| 28 |
|
|
namespace tasks { |
| 29 |
|
|
|
| 30 |
|
|
class TaskCopEquality : public TaskContactForce { |
| 31 |
|
|
public: |
| 32 |
|
|
EIGEN_MAKE_ALIGNED_OPERATOR_NEW |
| 33 |
|
|
|
| 34 |
|
|
typedef math::Index Index; |
| 35 |
|
|
typedef trajectories::TrajectorySample TrajectorySample; |
| 36 |
|
|
typedef math::Vector Vector; |
| 37 |
|
|
typedef math::Vector3 Vector3; |
| 38 |
|
|
typedef math::ConstraintEquality ConstraintEquality; |
| 39 |
|
|
typedef pinocchio::SE3 SE3; |
| 40 |
|
|
|
| 41 |
|
|
TaskCopEquality(const std::string &name, RobotWrapper &robot); |
| 42 |
|
|
|
| 43 |
|
✗ |
virtual ~TaskCopEquality() {} |
| 44 |
|
|
|
| 45 |
|
|
void setContactList( |
| 46 |
|
|
const std::vector<std::shared_ptr<ContactLevel> > *contacts); |
| 47 |
|
|
|
| 48 |
|
|
int dim() const; |
| 49 |
|
|
|
| 50 |
|
|
virtual const std::string &getAssociatedContactName(); |
| 51 |
|
|
|
| 52 |
|
|
const ConstraintBase &compute(const double t, ConstRefVector q, |
| 53 |
|
|
ConstRefVector v, Data &data); |
| 54 |
|
|
|
| 55 |
|
|
const ConstraintBase &compute( |
| 56 |
|
|
const double t, ConstRefVector q, ConstRefVector v, Data &data, |
| 57 |
|
|
const std::vector<std::shared_ptr<ContactLevel> > *contacts); |
| 58 |
|
|
|
| 59 |
|
|
const ConstraintBase &getConstraint() const; |
| 60 |
|
|
|
| 61 |
|
|
void setReference(const Vector3 &ref); |
| 62 |
|
|
const Vector3 &getReference() const; |
| 63 |
|
|
|
| 64 |
|
|
void setContactNormal(const Vector3 &n); |
| 65 |
|
|
const Vector3 &getContactNormal() const; |
| 66 |
|
|
|
| 67 |
|
|
protected: |
| 68 |
|
|
const std::vector<std::shared_ptr<ContactLevel> > *m_contacts; |
| 69 |
|
|
std::string m_contact_name; // an empty string |
| 70 |
|
|
Vector3 m_normal; // normal direction to the ground expressed in world frame |
| 71 |
|
|
Vector3 m_ref; // reference CoP in world frame |
| 72 |
|
|
ConstraintEquality m_constraint; |
| 73 |
|
|
}; |
| 74 |
|
|
|
| 75 |
|
|
} // namespace tasks |
| 76 |
|
|
} // namespace tsid |
| 77 |
|
|
|
| 78 |
|
|
#endif // ifndef __invdyn_task_com_equality_hpp__ |
| 79 |
|
|
|