3#include "state_representation/space/joint/JointState.hpp"
4#include "state_representation/space/joint/JointVelocities.hpp"
18 const Eigen::VectorXd& get_velocities()
const =
delete;
19 double get_velocity(
unsigned int joint_index)
const =
delete;
20 double get_velocity(
const std::string& joint_name)
const =
delete;
21 void set_velocities(
const Eigen::VectorXd& velocities) =
delete;
22 void set_velocities(
const std::vector<double>& velocities) =
delete;
23 void set_velocity(
double velocity,
unsigned int joint_index)
const =
delete;
24 void set_velocity(
double velocity,
const std::string& joint_name)
const =
delete;
25 const Eigen::VectorXd& get_accelerations()
const =
delete;
26 double get_acceleration(
unsigned int joint_index)
const =
delete;
27 double get_acceleration(
const std::string& joint_name)
const =
delete;
28 void set_accelerations(
const Eigen::VectorXd& accelerations) =
delete;
29 void set_accelerations(
const std::vector<double>& accelerations) =
delete;
30 void set_acceleration(
double acceleration,
unsigned int joint_index)
const =
delete;
31 void set_acceleration(
double acceleration,
const std::string& joint_name)
const =
delete;
32 const Eigen::VectorXd& get_torques()
const =
delete;
33 double get_torque(
unsigned int joint_index)
const =
delete;
34 double get_torque(
const std::string& joint_name)
const =
delete;
35 void set_torques(
const Eigen::VectorXd& torques) =
delete;
36 void set_torques(
const std::vector<double>& torques) =
delete;
37 void set_torque(
double torque,
unsigned int joint_index)
const =
delete;
38 void set_torque(
double torque,
const std::string& joint_name)
const =
delete;
50 explicit JointPositions(
const std::string& robot_name,
unsigned int nb_joints = 0);
57 explicit JointPositions(
const std::string& robot_name,
const std::vector<std::string>& joint_names);
64 explicit JointPositions(
const std::string& robot_name,
const Eigen::VectorXd& positions);
73 const std::string& robot_name,
const std::vector<std::string>& joint_names,
const Eigen::VectorXd& positions
106 static JointPositions Zero(
const std::string& robot_name,
const std::vector<std::string>& joint_names);
122 static JointPositions Random(
const std::string& robot_name,
const std::vector<std::string>& joint_names);
232 Eigen::VectorXd
data()
const override;
238 virtual void set_data(
const Eigen::VectorXd&
data)
override;
244 virtual void set_data(
const std::vector<double>&
data)
override;
252 void clamp(
double max_absolute_value,
double noise_ratio = 0.);
269 void clamp(
const Eigen::ArrayXd& max_absolute_value_array,
const Eigen::ArrayXd& noise_ratio_array);
278 JointPositions clamped(
const Eigen::ArrayXd& max_absolute_value_array,
const Eigen::ArrayXd& noise_ratio_array)
const;
Class to define a positions of the joints.
void clamp(double max_absolute_value, double noise_ratio=0.)
Clamp inplace the magnitude of the positions to the value in argument.
friend std::ostream & operator<<(std::ostream &os, const JointPositions &positions)
Overload the ostream operator for printing.
static JointPositions Zero(const std::string &robot_name, unsigned int nb_joints)
Constructor for the zero JointPositions.
Eigen::VectorXd data() const override
Returns the positions data as an Eigen vector.
JointPositions & operator=(const JointPositions &positions)=default
Copy assignment operator that have to be defined to the custom assignment operator.
JointPositions & operator*=(double lambda)
Overload the *= operator with a double gain.
virtual void set_data(const Eigen::VectorXd &data) override
Set the positions data from an Eigen vector.
JointPositions & operator-=(const JointPositions &positions)
Overload the -= operator.
JointPositions & operator+=(const JointPositions &positions)
Overload the += operator.
JointPositions operator/(double lambda) const
Overload the / operator with a scalar.
JointPositions clamped(double max_absolute_value, double noise_ratio=0.) const
Return the position clamped to the value in argument.
static JointPositions Random(const std::string &robot_name, unsigned int nb_joints)
Constructor for the random JointPositions.
JointPositions operator+(const JointPositions &positions) const
Overload the + operator.
friend JointPositions operator*(double lambda, const JointPositions &positions)
Overload the * operator with a scalar.
JointPositions copy() const
Return a copy of the JointPositions.
JointPositions operator-(const JointPositions &positions) const
Overload the - operator.
JointPositions()
Empty constructor.
JointPositions & operator/=(double lambda)
Overload the /= operator with a scalar.
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 velocities of the joints.
Core state variables and objects.