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()
27 Eigen::Vector3d commanded_force = position_control + state_error.
get_force();
30 Eigen::Vector3d orientation_control =
31 this->stiffness_->get_value().bottomRightCorner<3, 3>() * state_error.
get_orientation().vec()
34 Eigen::Vector3d commanded_torque = orientation_control + state_error.
get_torque();
36 Eigen::VectorXd wrench(6);
37 wrench << commanded_force, commanded_torque;
40 command.set_wrench(wrench);
48 JointState state_error = command_state - feedback_state;
52 Eigen::VectorXd state_control = this->stiffness_->get_value() * state_error.
get_positions()
55 Eigen::VectorXd commanded_torques = state_control + state_error.
get_torques();
56 clamp_force(commanded_torques);
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.
const Eigen::Vector3d & get_force() const
Getter of the force attribute.
const Eigen::Vector3d & get_torque() const
Getter of the torque attribute.
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.
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.
void set_torques(const Eigen::VectorXd &torques)
Setter of the torques 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 as const reference.
Core state variables and objects.