3#include "state_representation/space/joint/JointState.hpp"
4#include "state_representation/space/joint/JointVelocities.hpp"
5#include "state_representation/space/joint/JointAccelerations.hpp"
6#include "state_representation/space/joint/JointTorques.hpp"
11class JointAccelerations;
20 const Eigen::VectorXd& get_velocities()
const =
delete;
21 double get_velocity(
unsigned int joint_index)
const =
delete;
22 double get_velocity(
const std::string& joint_name)
const =
delete;
23 void set_velocities(
const Eigen::VectorXd& velocities) =
delete;
24 void set_velocities(
const std::vector<double>& velocities) =
delete;
25 void set_velocity(
double velocity,
unsigned int joint_index)
const =
delete;
26 void set_velocity(
double velocity,
const std::string& joint_name)
const =
delete;
27 const Eigen::VectorXd& get_accelerations()
const =
delete;
28 double get_acceleration(
unsigned int joint_index)
const =
delete;
29 double get_acceleration(
const std::string& joint_name)
const =
delete;
30 void set_accelerations(
const Eigen::VectorXd& accelerations) =
delete;
31 void set_accelerations(
const std::vector<double>& accelerations) =
delete;
32 void set_acceleration(
double acceleration,
unsigned int joint_index)
const =
delete;
33 void set_acceleration(
double acceleration,
const std::string& joint_name)
const =
delete;
34 const Eigen::VectorXd& get_torques()
const =
delete;
35 double get_torque(
unsigned int joint_index)
const =
delete;
36 double get_torque(
const std::string& joint_name)
const =
delete;
37 void set_torques(
const Eigen::VectorXd& torques) =
delete;
38 void set_torques(
const std::vector<double>& torques) =
delete;
39 void set_torque(
double torque,
unsigned int joint_index)
const =
delete;
40 void set_torque(
double torque,
const std::string& joint_name)
const =
delete;
64 explicit JointPositions(
const std::string& robot_name,
unsigned int nb_joints = 0);
71 explicit JointPositions(
const std::string& robot_name,
const std::vector<std::string>& joint_names);
78 explicit JointPositions(
const std::string& robot_name,
const Eigen::VectorXd& positions);
87 const std::string& robot_name,
const std::vector<std::string>& joint_names,
const Eigen::VectorXd& positions
120 static JointPositions Zero(
const std::string& robot_name,
const std::vector<std::string>& joint_names);
136 static JointPositions Random(
const std::string& robot_name,
const std::vector<std::string>& joint_names);
149 Eigen::VectorXd
data()
const override;
155 virtual void set_data(
const Eigen::VectorXd&
data)
override;
161 virtual void set_data(
const std::vector<double>&
data)
override;
169 void clamp(
double max_absolute_value,
double noise_ratio = 0.);
177 void clamp(
const Eigen::ArrayXd& max_absolute_value_array,
const Eigen::ArrayXd& noise_ratio_array);
195 JointPositions clamped(
const Eigen::ArrayXd& max_absolute_value_array,
const Eigen::ArrayXd& noise_ratio_array)
const;
Class to define accelerations of the joints.
Class to define 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 zero joint positions.
Eigen::VectorXd data() const override
Returns the positions data as an Eigen vector.
JointPositions & operator=(const JointPositions &positions)=default
Copy assignment operator that has to be defined to the custom assignment operator.
JointPositions & operator*=(double lambda)
Scale inplace by a scalar.
JointPositions operator-() const
Negate joint positions.
virtual void set_data(const Eigen::VectorXd &data) override
Set the positions data from an Eigen vector.
JointPositions operator/(double lambda) const
Scale joint positions by 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 random joint positions.
friend JointPositions operator*(double lambda, const JointPositions &positions)
Scale joint positions by a scalar.
JointPositions copy() const
Return a copy of the joint positions.
JointPositions()
Empty constructor.
JointPositions & operator/=(double lambda)
Scale inplace by 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 torques of the joints.
Class to define velocities of the joints.
Core state variables and objects.