orwell 0.0.0
RobotState.hpp
1/*
2 Copyright (c) Tobias Löw
3 Written by Tobias Löw <https://tobiloew.ch>
4
5 This file is part of orwell.
6
7 gafro is free software: you can redistribute it and/or modify
8 it under the terms of the GNU General Public License version 3 as
9 published by the Free Software Foundation.
10
11 gafro is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 GNU General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with gafro. If not, see <http://www.gnu.org/licenses/>.
18*/
19
20#pragma once
21
22#include <Eigen/Core>
23
24namespace orwell
25{
26
33 template <int dof>
34 class RobotState
35 {
36 public:
38 using Vector = Eigen::Vector<double, dof>;
39
44 RobotState();
45
50 virtual ~RobotState();
51
58 void setPosition(const Vector &position);
59
66 void setVelocity(const Vector &velocity);
67
74 void setTorque(const Vector &torque);
75
81 const Vector &getPosition() const;
82
88 const Vector &getVelocity() const;
89
95 const Vector &getTorque() const;
96
97 private:
99 Vector position_;
100
102 Vector velocity_;
103
105 Vector torque_;
106 };
107} // namespace orwell
108
109#include <orwell/RobotState.hxx>
describes the RobotState
const Vector & getVelocity() const
get the joint velocity
const Vector & getPosition() const
get the joint position
void setVelocity(const Vector &velocity)
set the joint velocity
const Vector & getTorque() const
get the joint torque
void setTorque(const Vector &torque)
set the joint torque
void setPosition(const Vector &position)
set the joint position
Eigen::Vector< double, dof > Vector
typedef