3#include "state_representation/space/joint/JointState.hpp"
15 const Eigen::VectorXd& get_positions()
const =
delete;
16 double get_position(
unsigned int joint_index)
const =
delete;
17 double get_position(
const std::string& joint_name)
const =
delete;
18 void set_positions(
const Eigen::VectorXd& positions) =
delete;
19 void set_positions(
const std::vector<double>& positions) =
delete;
20 void set_position(
double position,
unsigned int joint_index)
const =
delete;
21 void set_position(
double position,
const std::string& joint_name)
const =
delete;
22 const Eigen::VectorXd& get_velocities()
const =
delete;
23 double get_velocity(
unsigned int joint_index)
const =
delete;
24 double get_velocity(
const std::string& joint_name)
const =
delete;
25 void set_velocities(
const Eigen::VectorXd& velocities) =
delete;
26 void set_velocities(
const std::vector<double>& velocities) =
delete;
27 void set_velocity(
double velocity,
unsigned int joint_index)
const =
delete;
28 void set_velocity(
double velocity,
const std::string& joint_name)
const =
delete;
29 const Eigen::VectorXd& get_accelerations()
const =
delete;
30 double get_acceleration(
unsigned int joint_index)
const =
delete;
31 double get_acceleration(
const std::string& joint_name)
const =
delete;
32 void set_accelerations(
const Eigen::VectorXd& accelerations) =
delete;
33 void set_accelerations(
const std::vector<double>& accelerations) =
delete;
34 void set_acceleration(
double acceleration,
unsigned int joint_index)
const =
delete;
35 void set_acceleration(
double acceleration,
const std::string& joint_name)
const =
delete;
47 explicit JointTorques(
const std::string& robot_name,
unsigned int nb_joints = 0);
54 explicit JointTorques(
const std::string& robot_name,
const std::vector<std::string>& joint_names);
61 explicit JointTorques(
const std::string& robot_name,
const Eigen::VectorXd& torques);
69 explicit JointTorques(
const std::string& robot_name,
const std::vector<std::string>& joint_names,
70 const Eigen::VectorXd& torques);
88 static JointTorques Zero(
const std::string& robot_name,
unsigned int nb_joints);
96 static JointTorques Zero(
const std::string& robot_name,
const std::vector<std::string>& joint_names);
112 static JointTorques Random(
const std::string& robot_name,
const std::vector<std::string>& joint_names);
215 Eigen::VectorXd
data()
const override;
221 virtual void set_data(
const Eigen::VectorXd&
data)
override;
227 virtual void set_data(
const std::vector<double>&
data)
override;
236 void clamp(
double max_absolute_value,
double noise_ratio = 0.);
253 void clamp(
const Eigen::ArrayXd& max_absolute_value_array,
const Eigen::ArrayXd& noise_ratio_array);
262 JointTorques clamped(
const Eigen::ArrayXd& max_absolute_value_array,
const Eigen::ArrayXd& noise_ratio_array)
const;
Class to define a state in joint space.
void clamp_state_variable(double max_absolute_value, const JointStateVariable &state_variable_type, double noise_ratio=0)
Clamp inplace the magnitude of the a specific joint state variable.
Class to define torques of the joints.
friend std::ostream & operator<<(std::ostream &os, const JointTorques &torques)
Overload the ostream operator for printing.
void clamp(double max_absolute_value, double noise_ratio=0.)
Clamp inplace the magnitude of the torque to the values in argument.
JointTorques copy() const
Return a copy of the JointTorques.
JointTorques & operator+=(const JointTorques &torques)
Overload the += operator.
JointTorques clamped(double max_absolute_value, double noise_ratio=0.) const
Return the torque clamped to the values in argument.
JointTorques()
Empty constructor.
JointTorques & operator=(const JointTorques &torques)=default
Copy assignment operator that have to be defined to the custom assignment operator.
virtual void set_data(const Eigen::VectorXd &data) override
Set the torques data from an Eigen vector.
static JointTorques Random(const std::string &robot_name, unsigned int nb_joints)
Constructor for the random JointTorques.
JointTorques operator+(const JointTorques &torques) const
Overload the + operator.
JointTorques & operator-=(const JointTorques &torques)
Overload the -= operator.
JointTorques operator-(const JointTorques &torques) const
Overload the - operator.
static JointTorques Zero(const std::string &robot_name, unsigned int nb_joints)
Constructor for the zero JointTorques.
JointTorques & operator/=(double lambda)
Overload the /= operator with a scalar.
JointTorques operator/(double lambda) const
Overload the / operator with a scalar.
JointTorques & operator*=(double lambda)
Overload the *= operator with a double gain.
Eigen::VectorXd data() const override
Returns the torques data as an Eigen vector.
friend JointTorques operator*(double lambda, const JointTorques &torques)
Overload the * operator with a scalar.
Core state variables and objects.