1#include "controllers/impedance/Impedance.hpp"
3#include "controllers/exceptions/NotImplementedException.hpp"
4#include "state_representation/space/joint/JointState.hpp"
5#include "state_representation/space/cartesian/CartesianState.hpp"
9namespace controllers::impedance {
24 Eigen::Vector3d position_control = this->stiffness_->get_value().topLeftCorner<3, 3>() * state_error.
get_position()
32 Eigen::Vector3d orientation_control =
33 this->stiffness_->get_value().bottomRightCorner<3, 3>() * state_error.
get_orientation().vec()
37 Eigen::VectorXd wrench(6);
38 wrench << position_control, orientation_control;
40 if (this->feed_forward_force_->get_value()) {
45 command.set_wrench(wrench);
53 JointState state_error = command_state - feedback_state;
57 Eigen::VectorXd torque_control = this->stiffness_->get_value() * state_error.
get_positions()
62 if (this->feed_forward_force_->get_value()) {
65 clamp_force(torque_control);
67 command.set_torques(torque_control);
S compute_command(const S &command_state, const S &feedback_state) override
Compute the command output based on the commanded state and a feedback state To be redefined based on...
Class to represent a state in Cartesian space.
void set_orientation(const Eigen::Quaterniond &orientation)
Setter of the orientation.
const Eigen::Vector3d & get_linear_velocity() const
Getter of the linear velocity attribute.
const Eigen::Vector3d & get_position() const
Getter of the position attribute.
const Eigen::Vector3d & get_linear_acceleration() const
Getter of the linear acceleration attribute.
const Eigen::Quaterniond & get_orientation() const
Getter of the orientation attribute.
Eigen::Matrix< double, 6, 1 > get_wrench() const
Getter of the 6d wrench from force and torque attributes.
const Eigen::Vector3d & get_angular_velocity() const
Getter of the angular velocity attribute.
const Eigen::Vector3d & get_angular_acceleration() const
Getter of the angular acceleration attribute.
Class to define a state in joint space.
const Eigen::VectorXd & get_torques() const
Getter of the torques attribute.
const Eigen::VectorXd & get_velocities() const
Getter of the velocities attribute.
const Eigen::VectorXd & get_accelerations() const
Getter of the accelerations attribute.
const std::vector< std::string > & get_names() const
Getter of the names attribute.
const Eigen::VectorXd & get_positions() const
Getter of the positions attribute.
const std::string & get_reference_frame() const
Getter of the reference frame as const reference.
const std::string & get_name() const
Getter of the name attribute.
Core state variables and objects.