Control Libraries 7.4.0
Loading...
Searching...
No Matches
VelocityImpedance.hpp
1#pragma once
2
3#include <eigen3/Eigen/Core>
4#include <eigen3/Eigen/Dense>
5#include "controllers/impedance/Impedance.hpp"
6
7namespace controllers::impedance {
14template<class S>
15class VelocityImpedance : public Impedance<S> {
16public:
17
23 explicit VelocityImpedance(unsigned int dimensions = 6);
24
31 const std::list<std::shared_ptr<state_representation::ParameterInterface>>& parameters,
32 unsigned int dimensions = 6
33 );
34
42 S compute_command(const S& desired_state, const S& feedback_state) override;
43};
44
45template<class S>
46VelocityImpedance<S>::VelocityImpedance(unsigned int dimensions) : Impedance<S>(dimensions) {
47 this->parameters_.erase("inertia");
48 this->inertia_->set_value(Eigen::MatrixXd::Zero(dimensions, dimensions));
49}
50
51template<class S>
53 const std::list<std::shared_ptr<state_representation::ParameterInterface>>& parameters, unsigned int dimensions
54) :
55 VelocityImpedance<S>(dimensions) {
56 this->set_parameters(parameters);
57}
58
59}// namespace controllers
Definition of an impedance controller in either joint or task space.
Definition Impedance.hpp:18
std::shared_ptr< state_representation::Parameter< Eigen::MatrixXd > > inertia_
inertia matrix of the controller associated to acceleration
Definition Impedance.hpp:66
A velocity impedance is a normal impedance controller that only uses velocity input and integrates it...
S compute_command(const S &desired_state, const S &feedback_state) override
Compute the force (task space) or torque (joint space) command based on the input state of the system...
VelocityImpedance(const std::list< std::shared_ptr< state_representation::ParameterInterface > > &parameters, unsigned int dimensions=6)
Constructor from an initial parameter list.
VelocityImpedance(unsigned int dimensions=6)
Base constructor.
void set_parameters(const ParameterInterfaceList &parameters)
Set parameters from a list of parameters.
ParameterInterfaceMap parameters_
map of parameters by name