orwell 0.0.0
RobotState.hxx
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 <orwell/RobotState.hpp>
23
24namespace orwell
25{
26
27 template <int dof>
28 RobotState<dof>::RobotState() = default;
29
30 template <int dof>
31 RobotState<dof>::~RobotState() = default;
32
33 template <int dof>
35 {
36 position_ = position;
37 }
38
39 template <int dof>
41 {
42 velocity_ = velocity;
43 }
44
45 template <int dof>
47 {
48 torque_ = torque;
49 }
50
51 template <int dof>
53 {
54 return position_;
55 }
56
57 template <int dof>
59 {
60 return velocity_;
61 }
62
63 template <int dof>
65 {
66 return torque_;
67 }
68
69} // namespace orwell
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