GCC Code Coverage Report


Directory: ./
File: include/tsid/tasks/task-joint-posture.hpp
Date: 2024-08-26 20:29:39
Exec Total Coverage
Lines: 1 1 100.0%
Branches: 0 0 -%

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_joint_posture_hpp__
19 #define __invdyn_task_joint_posture_hpp__
20
21 #include <tsid/tasks/task-motion.hpp>
22 #include <tsid/trajectories/trajectory-base.hpp>
23 #include <tsid/math/constraint-equality.hpp>
24 #include <tsid/deprecated.hh>
25
26 namespace tsid {
27 namespace tasks {
28
29 class TaskJointPosture : public TaskMotion {
30 public:
31 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
32
33 typedef math::Index Index;
34 typedef trajectories::TrajectorySample TrajectorySample;
35 typedef math::Vector Vector;
36 typedef math::VectorXi VectorXi;
37 typedef math::ConstraintEquality ConstraintEquality;
38 typedef pinocchio::Data Data;
39
40 TaskJointPosture(const std::string& name, RobotWrapper& robot);
41
42 8 virtual ~TaskJointPosture() {}
43
44 int dim() const;
45
46 const ConstraintBase& compute(const double t, ConstRefVector q,
47 ConstRefVector v, Data& data);
48
49 const ConstraintBase& getConstraint() const;
50
51 void setReference(const TrajectorySample& ref);
52 const TrajectorySample& getReference() const;
53
54 const Vector& getDesiredAcceleration() const;
55 Vector getAcceleration(ConstRefVector dv) const;
56
57 TSID_DEPRECATED const Vector& mask() const; // deprecated
58 TSID_DEPRECATED void mask(const Vector& mask); // deprecated
59 virtual void setMask(math::ConstRefVector mask);
60
61 const Vector& position_error() const;
62 const Vector& velocity_error() const;
63 const Vector& position() const;
64 const Vector& velocity() const;
65 const Vector& position_ref() const;
66 const Vector& velocity_ref() const;
67
68 const Vector& Kp();
69 const Vector& Kd();
70 void Kp(ConstRefVector Kp);
71 void Kd(ConstRefVector Kp);
72
73 protected:
74 Vector m_Kp;
75 Vector m_Kd;
76 Vector m_p_error, m_v_error;
77 Vector m_p, m_v;
78 Vector m_a_des;
79 VectorXi m_activeAxes;
80 TrajectorySample m_ref;
81 Vector m_ref_q_augmented;
82 ConstraintEquality m_constraint;
83 };
84
85 } // namespace tasks
86 } // namespace tsid
87
88 #endif // ifndef __invdyn_task_joint_posture_hpp__
89