orwell 0.0.0
JointImpedanceController.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 <orwell/ReferenceController.hpp>
23#include <orwell/torque/TorqueController.hpp>
24
25namespace orwell
26{
27
34 template <int dof>
35 class JointImpedanceController : public TorqueReferenceController<dof, Eigen::Vector<double, dof>>
36 {
37 public:
45 JointImpedanceController(const sackmesser::Interface::Ptr &interface, const std::string &name);
46
52
58 Eigen::Vector<double, dof> computeCommand();
59
60 private:
68 Eigen::Vector<double, dof> limit(const Eigen::Vector<double, dof> &position_difference);
69
70 private:
75 struct Configuration : public sackmesser::Configuration
76 {
81 bool load(const std::string &ns, const std::shared_ptr<sackmesser::Configurations> &server);
82
85 Eigen::Matrix<double, dof, dof> stiffness_;
86
89 Eigen::Matrix<double, dof, dof> damping_;
90
93 Eigen::Vector<double, dof> position_difference_limit_;
94 } config_;
95 };
96
97} // namespace orwell
98
99#include <orwell/torque/JointImpedanceController.hxx>
100
101REGISTER_CLASS(orwell::TorqueController<7>, orwell::JointImpedanceController<7>, "joint_impedance_controller")
defines an impedance control law in joint space
Eigen::Vector< double, dof > computeCommand()
computes the control command for the impedance control law in joint space
JointImpedanceController(const sackmesser::Interface::Ptr &interface, const std::string &name)
loads configuration parameters
base implementation of a Controller tracking a given Reference
Controller using torque commands.