Control Libraries 6.3.4
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Friends | List of all members
state_representation::JointVelocities Class Reference

Class to define velocities of the joints. More...

#include <JointVelocities.hpp>

Inheritance diagram for state_representation::JointVelocities:
state_representation::JointState state_representation::State

Public Member Functions

const Eigen::VectorXd & get_positions () const =delete
 
double get_position (unsigned int joint_index) const =delete
 
double get_position (const std::string &joint_name) const =delete
 
void set_positions (const Eigen::VectorXd &positions)=delete
 
void set_positions (const std::vector< double > &positions)=delete
 
void set_position (double position, unsigned int joint_index) const =delete
 
void set_position (double position, const std::string &joint_name) const =delete
 
const Eigen::VectorXd & get_accelerations () const =delete
 
double get_acceleration (unsigned int joint_index) const =delete
 
double get_acceleration (const std::string &joint_name) const =delete
 
void set_accelerations (const Eigen::VectorXd &accelerations)=delete
 
void set_accelerations (const std::vector< double > &accelerations)=delete
 
void set_acceleration (double acceleration, unsigned int joint_index) const =delete
 
void set_acceleration (double acceleration, const std::string &joint_name) const =delete
 
const Eigen::VectorXd & get_torques () const =delete
 
double get_torque (unsigned int joint_index) const =delete
 
double get_torque (const std::string &joint_name) const =delete
 
void set_torques (const Eigen::VectorXd &torques)=delete
 
void set_torques (const std::vector< double > &torques)=delete
 
void set_torque (double torque, unsigned int joint_index) const =delete
 
void set_torque (double torque, const std::string &joint_name) const =delete
 
 JointVelocities ()
 Empty constructor. More...
 
 JointVelocities (const std::string &robot_name, unsigned int nb_joints=0)
 Constructor with name and number of joints provided. More...
 
 JointVelocities (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor with name and list of joint names provided. More...
 
 JointVelocities (const std::string &robot_name, const Eigen::VectorXd &velocities)
 Constructor with name and velocity values provided. More...
 
 JointVelocities (const std::string &robot_name, const std::vector< std::string > &joint_names, const Eigen::VectorXd &velocities)
 Constructor with name, a list of joint names and velocity values provided. More...
 
 JointVelocities (const JointVelocities &velocities)
 Copy constructor. More...
 
 JointVelocities (const JointState &state)
 Copy constructor from a JointState. More...
 
 JointVelocities (const JointAccelerations &accelerations)
 Integration constructor from a JointAccelerations by considering that it is equivalent to multiplying the accelerations by 1 second. More...
 
 JointVelocities (const JointPositions &positions)
 Differentiation constructor from a JointPositions by considering that it is equivalent to dividing the positions by 1 second. More...
 
JointVelocitiesoperator= (const JointVelocities &velocities)=default
 Copy assignment operator that have to be defined to the custom assignment operator. More...
 
JointVelocitiesoperator+= (const JointVelocities &velocities)
 Overload the += operator. More...
 
JointVelocities operator+ (const JointVelocities &velocities) const
 Overload the + operator. More...
 
JointVelocitiesoperator-= (const JointVelocities &velocities)
 Overload the -= operator. More...
 
JointVelocities operator- (const JointVelocities &velocities) const
 Overload the - operator. More...
 
JointVelocitiesoperator*= (double lambda)
 Overload the *= operator with a double gain. More...
 
JointVelocities operator* (double lambda) const
 Overload the * operator with a double gain. More...
 
JointVelocitiesoperator*= (const Eigen::ArrayXd &lambda)
 Overload the *= operator with an array of gains. More...
 
JointVelocities operator* (const Eigen::ArrayXd &lambda) const
 Overload the *= operator with an array of gains. More...
 
JointVelocitiesoperator*= (const Eigen::MatrixXd &lambda)
 Overload the *= operator with a matrix of gains. More...
 
JointVelocities operator* (const Eigen::MatrixXd &lambda) const
 Overload the * operator with a matrix of gains. More...
 
JointVelocitiesoperator/= (double lambda)
 Overload the /= operator with a scalar. More...
 
JointVelocities operator/ (double lambda) const
 Overload the / operator with a scalar. More...
 
JointAccelerations operator/ (const std::chrono::nanoseconds &dt) const
 Overload the / operator with a time period. More...
 
JointPositions operator* (const std::chrono::nanoseconds &dt) const
 Overload the * operator with a time period. More...
 
JointVelocities copy () const
 Return a copy of the JointVelocities. More...
 
Eigen::VectorXd data () const override
 Returns the velocities data as an Eigen vector. More...
 
virtual void set_data (const Eigen::VectorXd &data) override
 Set the velocities data from an Eigen vector. More...
 
virtual void set_data (const std::vector< double > &data) override
 Set the velocities data from a std vector. More...
 
void clamp (double max_absolute_value, double noise_ratio=0.)
 Clamp inplace the magnitude of the velocity to the values in argument. More...
 
JointVelocities clamped (double max_absolute_value, double noise_ratio=0.) const
 Return the velocity clamped to the values in argument. More...
 
void clamp (const Eigen::ArrayXd &max_absolute_value_array, const Eigen::ArrayXd &noise_ratio_array)
 Clamp inplace the magnitude of the velocity to the values in argument. More...
 
JointVelocities clamped (const Eigen::ArrayXd &max_absolute_value_array, const Eigen::ArrayXd &noise_ratio_array) const
 Return the velocity clamped to the values in argument. More...
 
- Public Member Functions inherited from state_representation::JointState
 JointState ()
 Empty constructor for a JointState. More...
 
 JointState (const std::string &robot_name, unsigned int nb_joints=0)
 Constructor with name and number of joints provided. More...
 
 JointState (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor with name and list of joint names provided. More...
 
 JointState (const JointState &state)=default
 Copy constructor of a JointState. More...
 
JointStateoperator= (const JointState &state)
 Copy assignment operator that have to be defined to the custom assignment operator. More...
 
unsigned int get_size () const
 Getter of the size from the attributes. More...
 
const std::vector< std::string > & get_names () const
 Getter of the names attribute. More...
 
void set_names (unsigned int nb_joints)
 Setter of the names attribute from the number of joints. More...
 
void set_names (const std::vector< std::string > &names)
 Setter of the names attribute. More...
 
unsigned int get_joint_index (const std::string &joint_name) const
 Get joint index by the name of the joint, if it exists. More...
 
const Eigen::VectorXd & get_positions () const
 Getter of the positions attribute. More...
 
double get_position (const std::string &joint_name) const
 Get the position of a joint by its name, if it exists. More...
 
double get_position (unsigned int joint_index) const
 Get the position of a joint by its index, if it exists. More...
 
void set_positions (const Eigen::VectorXd &positions)
 Setter of the positions attribute. More...
 
void set_positions (const std::vector< double > &positions)
 Setter of the positions from std vector. More...
 
void set_position (double position, const std::string &joint_name)
 Set the position of a joint by its name. More...
 
void set_position (double position, unsigned int joint_index)
 Set the position of a joint by its index. More...
 
const Eigen::VectorXd & get_velocities () const
 Getter of the velocities attribute. More...
 
double get_velocity (const std::string &joint_name) const
 Get the velocity of a joint by its name, if it exists. More...
 
double get_velocity (unsigned int joint_index) const
 Get the velocity of a joint by its index, if it exists. More...
 
void set_velocities (const Eigen::VectorXd &velocities)
 Setter of the velocities attribute. More...
 
void set_velocities (const std::vector< double > &velocities)
 Setter of the velocities from std vector. More...
 
void set_velocity (double velocity, const std::string &joint_name)
 Set the velocity of a joint by its name. More...
 
void set_velocity (double velocity, unsigned int joint_index)
 Set the velocity of a joint by its index. More...
 
const Eigen::VectorXd & get_accelerations () const
 Getter of the accelerations attribute. More...
 
double get_acceleration (const std::string &joint_name) const
 Get the acceleration of a joint by its name, if it exists. More...
 
double get_acceleration (unsigned int joint_index) const
 Get the acceleration of a joint by its index, if it exists. More...
 
void set_accelerations (const Eigen::VectorXd &accelerations)
 Setter of the accelerations attribute. More...
 
void set_accelerations (const std::vector< double > &accelerations)
 Setter of the accelerations from std vector. More...
 
void set_acceleration (double acceleration, const std::string &joint_name)
 Set the acceleration of a joint by its name. More...
 
void set_acceleration (double acceleration, unsigned int joint_index)
 Set the acceleration of a joint by its index. More...
 
const Eigen::VectorXd & get_torques () const
 Getter of the torques attribute. More...
 
double get_torque (const std::string &joint_name) const
 Get the torque of a joint by its name, if it exists. More...
 
double get_torque (unsigned int joint_index) const
 Get the torque of a joint by its index, if it exists. More...
 
void set_torques (const Eigen::VectorXd &torques)
 Setter of the torques attribute. More...
 
void set_torques (const std::vector< double > &torques)
 Setter of the torques attributes. More...
 
void set_torque (double torque, const std::string &joint_name)
 Set the torque of a joint by its name. More...
 
void set_torque (double torque, unsigned int joint_index)
 Set the torque of a joint by its index. More...
 
bool is_compatible (const State &state) const
 Check if the state is compatible for operations with the state given as argument. More...
 
void initialize ()
 Initialize the State to a zero value. More...
 
void set_zero ()
 Set the JointState to a zero value. More...
 
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. More...
 
void clamp_state_variable (const Eigen::ArrayXd &max_absolute_value_array, const JointStateVariable &state_variable_type, const Eigen::ArrayXd &noise_ratio_array)
 Clamp inplace the magnitude of the a specific joint state variable for each individual joint. More...
 
JointState copy () const
 Return a copy of the JointState. More...
 
virtual Eigen::VectorXd data () const
 Returns the data as the concatenation of all the state variables in a single vector. More...
 
virtual void set_data (const Eigen::VectorXd &data) override
 Set the data of the state from all the state variables in a single Eigen vector. More...
 
virtual void set_data (const std::vector< double > &data) override
 Set the data of the state from all the state variables in a single std vector. More...
 
Eigen::ArrayXd array () const
 Returns the data vector as an Eigen Array. More...
 
JointStateoperator+= (const JointState &state)
 Overload the += operator. More...
 
JointState operator+ (const JointState &state) const
 Overload the + operator. More...
 
JointStateoperator-= (const JointState &state)
 Overload the -= operator. More...
 
JointState operator- (const JointState &state) const
 Overload the - operator. More...
 
JointStateoperator*= (double lambda)
 Overload the *= operator with a double gain. More...
 
JointState operator* (double lambda) const
 Overload the * operator with a double gain. More...
 
JointStateoperator*= (const Eigen::ArrayXd &lambda)
 Overload the *= operator with an array of gains. More...
 
JointState operator* (const Eigen::ArrayXd &lambda) const
 Overload the * operator with an array of gains. More...
 
JointStateoperator*= (const Eigen::MatrixXd &lambda)
 Overload the *= operator with a matrix of gains. More...
 
JointState operator* (const Eigen::MatrixXd &lambda) const
 Overload the * operator with a matrix of gains. More...
 
JointStateoperator/= (double lambda)
 Overload the /= operator with a scalar. More...
 
JointState operator/ (double lambda) const
 Overload the / operator with a scalar. More...
 
double dist (const JointState &state, const JointStateVariable &state_variable_type=JointStateVariable::ALL) const
 Compute the distance to another state as the sum of distances between each attribute. More...
 
std::vector< double > to_std_vector () const
 Return the joint state as a std vector of floats. More...
 
- Public Member Functions inherited from state_representation::State
 State ()
 Empty constructor. More...
 
 State (const StateType &type)
 Constructor only specifying the type of the state from the StateType enumeration. More...
 
 State (const StateType &type, const std::string &name, const bool &empty=true)
 Constructor with name specification. More...
 
 State (const State &state)
 Copy constructor from another State. More...
 
virtual ~State ()=default
 Virtual destructor.
 
Stateoperator= (const State &state)
 Copy assignment operator that have to be defined to the custom assignment operator. More...
 
const StateTypeget_type () const
 Getter of the type attribute. More...
 
bool is_empty () const
 Getter of the empty attribute. More...
 
void set_empty (bool empty=true)
 Setter of the empty attribute. More...
 
void set_filled ()
 Setter of the empty attribute to false and also reset the timestamp. More...
 
const std::chrono::time_point< std::chrono::steady_clock > & get_timestamp () const
 Getter of the timestamp attribute. More...
 
void set_timestamp (const std::chrono::time_point< std::chrono::steady_clock > &timepoint)
 Setter of the timestamp attribute. More...
 
void reset_timestamp ()
 Reset the timestamp attribute to now. More...
 
const std::string & get_name () const
 Getter of the name as const reference. More...
 
virtual void set_name (const std::string &name)
 Setter of the name. More...
 
template<typename DurationT >
bool is_deprecated (const std::chrono::duration< int64_t, DurationT > &time_delay)
 Check if the state is deprecated given a certain time delay. More...
 
virtual bool is_compatible (const State &state) const
 Check if the state is compatible for operations with the state given as argument. More...
 
virtual void initialize ()
 Initialize the State to a zero value. More...
 
virtual void set_data (const Eigen::VectorXd &data)
 Set the data of the state from a single Eigen vector. More...
 
virtual void set_data (const std::vector< double > &data)
 Set the data of the state from a single std vector. More...
 
virtual void set_data (const Eigen::MatrixXd &data)
 Set the data of the state from an Eigen matrix. More...
 
 operator bool () const noexcept
 Boolean operator for the truthiness of a state. More...
 

Static Public Member Functions

static JointVelocities Zero (const std::string &robot_name, unsigned int nb_joints)
 Constructor for the zero JointVelocities. More...
 
static JointVelocities Zero (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor for the zero JointVelocities. More...
 
static JointVelocities Random (const std::string &robot_name, unsigned int nb_joints)
 Constructor for the random JointVelocities. More...
 
static JointVelocities Random (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor for the random JointVelocities. More...
 
- Static Public Member Functions inherited from state_representation::JointState
static JointState Zero (const std::string &robot_name, unsigned int nb_joints)
 Constructor for a zero JointState. More...
 
static JointState Zero (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor for a zero JointState. More...
 
static JointState Random (const std::string &robot_name, unsigned int nb_joints)
 Constructor for a random JointState. More...
 
static JointState Random (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor for a random JointState. More...
 

Friends

std::ostream & operator<< (std::ostream &os, const JointVelocities &velocities)
 Overload the ostream operator for printing. More...
 
JointVelocities operator* (double lambda, const JointVelocities &velocities)
 Overload the * operator with a scalar. More...
 
JointVelocities operator* (const Eigen::ArrayXd &lambda, const JointVelocities &velocities)
 Overload the * operator with an array of gains. More...
 
JointVelocities operator* (const Eigen::MatrixXd &lambda, const JointVelocities &velocities)
 Overload the * operator with a matrix of gains. More...
 
JointPositions operator* (const std::chrono::nanoseconds &dt, const JointVelocities &velocities)
 Overload the * operator with a time period. More...
 

Additional Inherited Members

- Protected Member Functions inherited from state_representation::JointState
void multiply_state_variable (const Eigen::ArrayXd &lambda, const JointStateVariable &state_variable_type)
 Proxy function that multiply the specified state variable by an array of gain. More...
 
void multiply_state_variable (const Eigen::MatrixXd &lambda, const JointStateVariable &state_variable_type)
 Proxy function that multiply the specified state variable by an array of gain. More...
 
Eigen::VectorXd get_state_variable (const JointStateVariable &state_variable_type) const
 Getter of the variable value corresponding to the input. More...
 
void set_state_variable (const Eigen::VectorXd &new_value, const JointStateVariable &state_variable_type)
 Setter of the variable value corresponding to the input. More...
 
- Protected Member Functions inherited from state_representation::State
void set_type (const StateType &type)
 Override the state type. More...
 

Detailed Description

Class to define velocities of the joints.

Definition at line 15 of file JointVelocities.hpp.

Constructor & Destructor Documentation

◆ JointVelocities() [1/9]

state_representation::JointVelocities::JointVelocities ( )
explicit

Empty constructor.

Definition at line 7 of file JointVelocities.cpp.

◆ JointVelocities() [2/9]

state_representation::JointVelocities::JointVelocities ( const std::string &  robot_name,
unsigned int  nb_joints = 0 
)
explicit

Constructor with name and number of joints provided.

name the name of the state

nb_joints the number of joints for initialization

Definition at line 11 of file JointVelocities.cpp.

◆ JointVelocities() [3/9]

state_representation::JointVelocities::JointVelocities ( const std::string &  robot_name,
const std::vector< std::string > &  joint_names 
)
explicit

Constructor with name and list of joint names provided.

name the name of the state

joint_names list of joint names

Definition at line 22 of file JointVelocities.cpp.

◆ JointVelocities() [4/9]

state_representation::JointVelocities::JointVelocities ( const std::string &  robot_name,
const Eigen::VectorXd &  velocities 
)
explicit

Constructor with name and velocity values provided.

name the name of the state

velocities the vector of velocities

Definition at line 16 of file JointVelocities.cpp.

◆ JointVelocities() [5/9]

state_representation::JointVelocities::JointVelocities ( const std::string &  robot_name,
const std::vector< std::string > &  joint_names,
const Eigen::VectorXd &  velocities 
)
explicit

Constructor with name, a list of joint names and velocity values provided.

name the name of the state

joint_names list of joint names

velocities the vector of velocities

Definition at line 27 of file JointVelocities.cpp.

◆ JointVelocities() [6/9]

state_representation::JointVelocities::JointVelocities ( const JointVelocities velocities)

Copy constructor.

Definition at line 42 of file JointVelocities.cpp.

◆ JointVelocities() [7/9]

state_representation::JointVelocities::JointVelocities ( const JointState state)

Copy constructor from a JointState.

Definition at line 34 of file JointVelocities.cpp.

◆ JointVelocities() [8/9]

state_representation::JointVelocities::JointVelocities ( const JointAccelerations accelerations)

Integration constructor from a JointAccelerations by considering that it is equivalent to multiplying the accelerations by 1 second.

Definition at line 45 of file JointVelocities.cpp.

◆ JointVelocities() [9/9]

state_representation::JointVelocities::JointVelocities ( const JointPositions positions)

Differentiation constructor from a JointPositions by considering that it is equivalent to dividing the positions by 1 second.

Definition at line 48 of file JointVelocities.cpp.

Member Function Documentation

◆ clamp() [1/2]

void state_representation::JointVelocities::clamp ( const Eigen::ArrayXd &  max_absolute_value_array,
const Eigen::ArrayXd &  noise_ratio_array 
)

Clamp inplace the magnitude of the velocity to the values in argument.

Parameters
max_absolute_value_arraythe maximum magnitude of velocity for each joint
noise_ratio_arrayif provided, this value will be used to apply a dead zone under which the velocity will be set to 0

Definition at line 176 of file JointVelocities.cpp.

◆ clamp() [2/2]

void state_representation::JointVelocities::clamp ( double  max_absolute_value,
double  noise_ratio = 0. 
)

Clamp inplace the magnitude of the velocity to the values in argument.

Parameters
max_absolute_valuethe maximum magnitude of velocity for all the joints
noise_ratioif provided, this value will be used to apply a dead zone under which the velocity will be set to 0

Definition at line 166 of file JointVelocities.cpp.

◆ clamped() [1/2]

JointVelocities state_representation::JointVelocities::clamped ( const Eigen::ArrayXd &  max_absolute_value_array,
const Eigen::ArrayXd &  noise_ratio_array 
) const

Return the velocity clamped to the values in argument.

Parameters
max_absolute_value_arraythe maximum magnitude of velocity for each joint
noise_ratio_arrayif provided, this value will be used to apply a dead zone under which the velocity will be set to 0
Returns
the clamped JointVelocities

Definition at line 180 of file JointVelocities.cpp.

◆ clamped() [2/2]

JointVelocities state_representation::JointVelocities::clamped ( double  max_absolute_value,
double  noise_ratio = 0. 
) const

Return the velocity clamped to the values in argument.

Parameters
max_absolute_valuethe maximum magnitude of velocity for all the joints
noise_ratioif provided, this value will be used to apply a dead zone under which the velocity will be set to 0
Returns
the clamped JointVelocities

Definition at line 170 of file JointVelocities.cpp.

◆ copy()

JointVelocities state_representation::JointVelocities::copy ( ) const

Return a copy of the JointVelocities.

Returns
the copy

Definition at line 149 of file JointVelocities.cpp.

◆ data()

Eigen::VectorXd state_representation::JointVelocities::data ( ) const
overridevirtual

Returns the velocities data as an Eigen vector.

Returns
the velocities data vector

Reimplemented from state_representation::JointState.

Definition at line 154 of file JointVelocities.cpp.

◆ operator*() [1/4]

JointVelocities state_representation::JointVelocities::operator* ( const Eigen::ArrayXd &  lambda) const

Overload the *= operator with an array of gains.

Parameters
lambdathe gain array to multiply with
Returns
the JointVelocities multiplied by lambda

Definition at line 99 of file JointVelocities.cpp.

◆ operator*() [2/4]

JointVelocities state_representation::JointVelocities::operator* ( const Eigen::MatrixXd &  lambda) const

Overload the * operator with a matrix of gains.

Parameters
lambdathe matrix to multiply with
Returns
the JointVelocities multiplied by lambda

Definition at line 110 of file JointVelocities.cpp.

◆ operator*() [3/4]

JointPositions state_representation::JointVelocities::operator* ( const std::chrono::nanoseconds &  dt) const

Overload the * operator with a time period.

Parameters
dtthe time period to multiply with
Returns
the JointPositions corresponding to the displacement over the time period

Definition at line 137 of file JointVelocities.cpp.

◆ operator*() [4/4]

JointVelocities state_representation::JointVelocities::operator* ( double  lambda) const

Overload the * operator with a double gain.

Parameters
lambdathe gain to multiply with
Returns
the JointVelocities multiplied by lambda

Definition at line 90 of file JointVelocities.cpp.

◆ operator*=() [1/3]

JointVelocities & state_representation::JointVelocities::operator*= ( const Eigen::ArrayXd &  lambda)

Overload the *= operator with an array of gains.

Parameters
lambdathe gain array to multiply with
Returns
the JointVelocities multiplied by lambda

Definition at line 94 of file JointVelocities.cpp.

◆ operator*=() [2/3]

JointVelocities & state_representation::JointVelocities::operator*= ( const Eigen::MatrixXd &  lambda)

Overload the *= operator with a matrix of gains.

Parameters
lambdathe matrix to multiply with
Returns
the JointVelocities multiplied by lambda

Definition at line 105 of file JointVelocities.cpp.

◆ operator*=() [3/3]

JointVelocities & state_representation::JointVelocities::operator*= ( double  lambda)

Overload the *= operator with a double gain.

Parameters
lambdathe gain to multiply with
Returns
the JointVelocities multiplied by lambda

Definition at line 85 of file JointVelocities.cpp.

◆ operator+()

JointVelocities state_representation::JointVelocities::operator+ ( const JointVelocities velocities) const

Overload the + operator.

Parameters
velocitiesJointVelocities to add
Returns
the current JointVelocities added the JointVelocities given in argument

Definition at line 72 of file JointVelocities.cpp.

◆ operator+=()

JointVelocities & state_representation::JointVelocities::operator+= ( const JointVelocities velocities)

Overload the += operator.

Parameters
velocitiesJointVelocities to add
Returns
the current JointVelocities added the JointVelocities given in argument

Definition at line 67 of file JointVelocities.cpp.

◆ operator-()

JointVelocities state_representation::JointVelocities::operator- ( const JointVelocities velocities) const

Overload the - operator.

Parameters
velocitiesJointVelocities to subtract
Returns
the current JointVelocities subtracted the JointVelocities given in argument

Definition at line 81 of file JointVelocities.cpp.

◆ operator-=()

JointVelocities & state_representation::JointVelocities::operator-= ( const JointVelocities velocities)

Overload the -= operator.

Parameters
velocitiesJointVelocities to subtract
Returns
the current JointVelocities subtracted the JointVelocities given in argument

Definition at line 76 of file JointVelocities.cpp.

◆ operator/() [1/2]

JointAccelerations state_representation::JointVelocities::operator/ ( const std::chrono::nanoseconds &  dt) const

Overload the / operator with a time period.

Parameters
dtthe time period to multiply with
Returns
the JointAccelerations corresponding to the accelerations over the time period

Definition at line 125 of file JointVelocities.cpp.

◆ operator/() [2/2]

JointVelocities state_representation::JointVelocities::operator/ ( double  lambda) const

Overload the / operator with a scalar.

Parameters
lambdathe scalar to divide with
Returns
the JointVelocities divided by lambda

Definition at line 121 of file JointVelocities.cpp.

◆ operator/=()

JointVelocities & state_representation::JointVelocities::operator/= ( double  lambda)

Overload the /= operator with a scalar.

Parameters
lambdathe scalar to divide with
Returns
the JointVelocities divided by lambda

Definition at line 116 of file JointVelocities.cpp.

◆ operator=()

JointVelocities & state_representation::JointVelocities::operator= ( const JointVelocities velocities)
default

Copy assignment operator that have to be defined to the custom assignment operator.

Parameters
velocitiesthe state with value to assign
Returns
reference to the current state with new values

◆ Random() [1/2]

JointVelocities state_representation::JointVelocities::Random ( const std::string &  robot_name,
const std::vector< std::string > &  joint_names 
)
static

Constructor for the random JointVelocities.

Parameters
robot_namethe name of the associated robot
joint_nameslist of joint names
Returns
JointVelocities with random velocities values

Definition at line 63 of file JointVelocities.cpp.

◆ Random() [2/2]

JointVelocities state_representation::JointVelocities::Random ( const std::string &  robot_name,
unsigned int  nb_joints 
)
static

Constructor for the random JointVelocities.

Parameters
robot_namethe name of the associated robot
nb_jointsthe number of joints for initialization
Returns
JointVelocities with random velocities values

Definition at line 59 of file JointVelocities.cpp.

◆ set_data() [1/2]

void state_representation::JointVelocities::set_data ( const Eigen::VectorXd &  data)
overridevirtual

Set the velocities data from an Eigen vector.

Parameters
thevelocities data vector

Reimplemented from state_representation::JointState.

Definition at line 158 of file JointVelocities.cpp.

◆ set_data() [2/2]

void state_representation::JointVelocities::set_data ( const std::vector< double > &  data)
overridevirtual

Set the velocities data from a std vector.

Parameters
thevelocities data vector

Reimplemented from state_representation::JointState.

Definition at line 162 of file JointVelocities.cpp.

◆ Zero() [1/2]

JointVelocities state_representation::JointVelocities::Zero ( const std::string &  robot_name,
const std::vector< std::string > &  joint_names 
)
static

Constructor for the zero JointVelocities.

Parameters
robot_namethe name of the associated robot
joint_nameslist of joint names
Returns
JointVelocities with zero velocities values

Definition at line 55 of file JointVelocities.cpp.

◆ Zero() [2/2]

JointVelocities state_representation::JointVelocities::Zero ( const std::string &  robot_name,
unsigned int  nb_joints 
)
static

Constructor for the zero JointVelocities.

Parameters
robot_namethe name of the associated robot
nb_jointsthe number of joints for initialization
Returns
JointVelocities with zero velocities values

Definition at line 51 of file JointVelocities.cpp.

Friends And Related Function Documentation

◆ operator* [1/4]

JointVelocities operator* ( const Eigen::ArrayXd &  lambda,
const JointVelocities velocities 
)
friend

Overload the * operator with an array of gains.

Parameters
lambdathe array to multiply with
Returns
the JointVelocities provided multiply by lambda

Definition at line 209 of file JointVelocities.cpp.

◆ operator* [2/4]

JointVelocities operator* ( const Eigen::MatrixXd &  lambda,
const JointVelocities velocities 
)
friend

Overload the * operator with a matrix of gains.

Parameters
lambdathe matrix to multiply with
Returns
the JointVelocities provided multiply by lambda

Definition at line 215 of file JointVelocities.cpp.

◆ operator* [3/4]

JointPositions operator* ( const std::chrono::nanoseconds &  dt,
const JointVelocities velocities 
)
friend

Overload the * operator with a time period.

Parameters
dtthe time period to multiply with
Returns
the JointPositions corresponding to the displacement over the time period

Definition at line 221 of file JointVelocities.cpp.

◆ operator* [4/4]

JointVelocities operator* ( double  lambda,
const JointVelocities velocities 
)
friend

Overload the * operator with a scalar.

Parameters
lambdathe scalar to multiply with
Returns
the JointVelocities provided multiply by lambda

Definition at line 203 of file JointVelocities.cpp.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const JointVelocities velocities 
)
friend

Overload the ostream operator for printing.

Parameters
osthe ostream to append the string representing the state
statethe state to print
Returns
the appended ostream

Definition at line 188 of file JointVelocities.cpp.


The documentation for this class was generated from the following files: