Line |
Branch |
Exec |
Source |
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_contact_force_hpp__ |
19 |
|
|
#define __invdyn_task_contact_force_hpp__ |
20 |
|
|
|
21 |
|
|
#include <tsid/deprecated.hh> |
22 |
|
|
#include <tsid/tasks/task-base.hpp> |
23 |
|
|
#include <tsid/formulations/contact-level.hpp> |
24 |
|
|
#include <memory> |
25 |
|
|
|
26 |
|
|
namespace tsid { |
27 |
|
|
namespace tasks { |
28 |
|
|
class TaskContactForce : public TaskBase { |
29 |
|
|
public: |
30 |
|
|
EIGEN_MAKE_ALIGNED_OPERATOR_NEW |
31 |
|
|
|
32 |
|
|
TaskContactForce(const std::string& name, RobotWrapper& robot); |
33 |
|
|
|
34 |
|
✗ |
virtual ~TaskContactForce() {} |
35 |
|
|
|
36 |
|
|
/** |
37 |
|
|
* Contact force tasks have an additional compute method that takes as extra |
38 |
|
|
* input argument the list of active contacts. This can be needed for force |
39 |
|
|
* tasks that involve all contacts, such as the CoP task. |
40 |
|
|
*/ |
41 |
|
|
TSID_DISABLE_WARNING_PUSH |
42 |
|
|
// clang-format off |
43 |
|
|
TSID_DISABLE_WARNING(-Woverloaded-virtual) |
44 |
|
|
// clang-format on |
45 |
|
|
virtual const ConstraintBase& compute( |
46 |
|
|
const double t, ConstRefVector q, ConstRefVector v, Data& data, |
47 |
|
|
const std::vector<std::shared_ptr<ContactLevel> >* contacts) = 0; |
48 |
|
|
TSID_DISABLE_WARNING_POP |
49 |
|
|
|
50 |
|
|
/** |
51 |
|
|
* Return the name of the contact associated to this task if this task is |
52 |
|
|
* associated to a specific contact. If this task is associated to multiple |
53 |
|
|
* contact forces (all of them), returns an empty string. |
54 |
|
|
*/ |
55 |
|
|
virtual const std::string& getAssociatedContactName() = 0; |
56 |
|
|
}; |
57 |
|
|
} // namespace tasks |
58 |
|
|
} // namespace tsid |
59 |
|
|
|
60 |
|
|
#endif // ifndef __invdyn_task_contact_force_hpp__ |
61 |
|
|
|