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

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

#include <JointAccelerations.hpp>

Inheritance diagram for state_representation::JointAccelerations:
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_velocities () const =delete
 
double get_velocity (unsigned int joint_index) const =delete
 
double get_velocity (const std::string &joint_name) const =delete
 
void set_velocities (const Eigen::VectorXd &accelerations)=delete
 
void set_velocities (const std::vector< double > &accelerations)=delete
 
void set_velocity (double velocity, unsigned int joint_index) const =delete
 
void set_velocity (double velocity, 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
 
JointStateoperator+= (const JointPositions &positions)=delete
 
JointStateoperator+= (const JointVelocities &velocities)=delete
 
JointStateoperator+= (const JointTorques &torques)=delete
 
JointState operator+ (const JointPositions &positions) const =delete
 
JointState operator+ (const JointVelocities &velocities) const =delete
 
JointState operator+ (const JointTorques &torques) const =delete
 
JointStateoperator-= (const JointPositions &positions)=delete
 
JointStateoperator-= (const JointVelocities &velocities)=delete
 
JointStateoperator-= (const JointTorques &torques)=delete
 
JointState operator- (const JointPositions &positions) const =delete
 
JointState operator- (const JointVelocities &velocities) const =delete
 
JointState operator- (const JointTorques &torques) const =delete
 
 JointAccelerations ()
 Empty constructor.
 
 JointAccelerations (const std::string &robot_name, unsigned int nb_joints=0)
 Constructor with name and number of joints provided.
 
 JointAccelerations (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor with name and list of joint names provided.
 
 JointAccelerations (const std::string &robot_name, const Eigen::VectorXd &accelerations)
 Constructor with name and acceleration values provided.
 
 JointAccelerations (const std::string &robot_name, const std::vector< std::string > &joint_names, const Eigen::VectorXd &accelerations)
 Constructor with name, a list of joint names and accelerations values provided.
 
 JointAccelerations (const JointAccelerations &accelerations)
 Copy constructor.
 
 JointAccelerations (const JointState &state)
 Copy constructor from a joint state.
 
 JointAccelerations (const JointVelocities &velocities)
 Differentiation constructor from joint velocities by considering that it is equivalent to dividing the velocities by 1 second.
 
JointAccelerationsoperator= (const JointAccelerations &accelerations)=default
 Copy assignment operator that has to be defined to the custom assignment operator.
 
Eigen::VectorXd data () const override
 Returns the accelerations data as an Eigen vector.
 
virtual void set_data (const Eigen::VectorXd &data) override
 Set the accelerations data from an Eigen vector.
 
virtual void set_data (const std::vector< double > &data) override
 Set the accelerations data from a std vector.
 
void clamp (double max_absolute_value, double noise_ratio=0.)
 Clamp inplace the magnitude of the acceleration to the values in argument.
 
void clamp (const Eigen::ArrayXd &max_absolute_value_array, const Eigen::ArrayXd &noise_ratio_array)
 Clamp inplace the magnitude of the acceleration to the values in argument.
 
JointAccelerations clamped (double max_absolute_value, double noise_ratio=0.) const
 Return the acceleration clamped to the values in argument.
 
JointAccelerations clamped (const Eigen::ArrayXd &max_absolute_value_array, const Eigen::ArrayXd &noise_ratio_array) const
 Return the acceleration clamped to the values in argument.
 
JointAccelerations copy () const
 Return a copy of the joint accelerations.
 
JointAccelerationsoperator*= (double lambda)
 Scale inplace by a scalar.
 
JointAccelerations operator* (double lambda) const
 Scale joint accelerations by a scalar.
 
JointVelocities operator* (const std::chrono::nanoseconds &dt) const
 Integrate joint accelerations over a time period.
 
JointAccelerationsoperator/= (double lambda)
 Scale inplace by a scalar.
 
JointAccelerations operator/ (double lambda) const
 Scale joint accelerations by a scalar.
 
JointAccelerationsoperator+= (const JointAccelerations &accelerations)
 Add inplace other joint accelerations.
 
JointAccelerationsoperator+= (const JointState &state)
 Add inplace other joint accelerations from a joint state.
 
JointAccelerations operator+ (const JointAccelerations &accelerations) const
 Add other joint accelerations.
 
JointState operator+ (const JointState &state) const
 Add another joint sate.
 
JointAccelerations operator- () const
 Negate joint accelerations.
 
JointAccelerationsoperator-= (const JointAccelerations &accelerations)
 Compute inplace the difference with other joint accelerations.
 
JointAccelerationsoperator-= (const JointState &state)
 Compute inplace the difference with a joint state.
 
JointAccelerations operator- (const JointAccelerations &accelerations) const
 Compute the difference with other joint accelerations.
 
JointState operator- (const JointState &state) const
 Compute the difference with a joint state.
 
- Public Member Functions inherited from state_representation::JointState
 JointState ()
 Empty constructor for a joint state.
 
 JointState (const std::string &robot_name, unsigned int nb_joints=0)
 Constructor with name and number of joints provided.
 
 JointState (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor with name and list of joint names provided.
 
 JointState (const JointState &state)
 Copy constructor of a joint state.
 
JointStateoperator= (const JointState &state)
 Copy assignment operator that has to be defined to the custom assignment operator.
 
unsigned int get_size () const
 Getter of the size from the attributes.
 
const std::vector< std::string > & get_names () const
 Getter of the names attribute.
 
unsigned int get_joint_index (const std::string &joint_name) const
 Get joint index by the name of the joint, if it exists.
 
const Eigen::VectorXd & get_positions () const
 Getter of the positions attribute.
 
double get_position (const std::string &joint_name) const
 Get the position of a joint by its name, if it exists.
 
double get_position (unsigned int joint_index) const
 Get the position of a joint by its index, if it exists.
 
const Eigen::VectorXd & get_velocities () const
 Getter of the velocities attribute.
 
double get_velocity (const std::string &joint_name) const
 Get the velocity of a joint by its name, if it exists.
 
double get_velocity (unsigned int joint_index) const
 Get the velocity of a joint by its index, if it exists.
 
const Eigen::VectorXd & get_accelerations () const
 Getter of the accelerations attribute.
 
double get_acceleration (const std::string &joint_name) const
 Get the acceleration of a joint by its name, if it exists.
 
double get_acceleration (unsigned int joint_index) const
 Get the acceleration of a joint by its index, if it exists.
 
const Eigen::VectorXd & get_torques () const
 Getter of the torques attribute.
 
double get_torque (const std::string &joint_name) const
 Get the torque of a joint by its name, if it exists.
 
double get_torque (unsigned int joint_index) const
 Get the torque of a joint by its index, if it exists.
 
Eigen::ArrayXd array () const
 Returns the data vector as an Eigen array.
 
void set_names (unsigned int nb_joints)
 Setter of the names attribute from the number of joints.
 
void set_names (const std::vector< std::string > &names)
 Setter of the names attribute.
 
void set_positions (const Eigen::VectorXd &positions)
 Setter of the positions attribute.
 
void set_positions (const std::vector< double > &positions)
 Setter of the positions from std vector.
 
void set_position (double position, const std::string &joint_name)
 Set the position of a joint by its name.
 
void set_position (double position, unsigned int joint_index)
 Set the position of a joint by its index.
 
void set_velocities (const Eigen::VectorXd &velocities)
 Setter of the velocities attribute.
 
void set_velocities (const std::vector< double > &velocities)
 Setter of the velocities from std vector.
 
void set_velocity (double velocity, const std::string &joint_name)
 Set the velocity of a joint by its name.
 
void set_velocity (double velocity, unsigned int joint_index)
 Set the velocity of a joint by its index.
 
void set_accelerations (const Eigen::VectorXd &accelerations)
 Setter of the accelerations attribute.
 
void set_accelerations (const std::vector< double > &accelerations)
 Setter of the accelerations from std vector.
 
void set_acceleration (double acceleration, const std::string &joint_name)
 Set the acceleration of a joint by its name.
 
void set_acceleration (double acceleration, unsigned int joint_index)
 Set the acceleration of a joint by its index.
 
void set_torques (const Eigen::VectorXd &torques)
 Setter of the torques attribute.
 
void set_torques (const std::vector< double > &torques)
 Setter of the torques attributes.
 
void set_torque (double torque, const std::string &joint_name)
 Set the torque of a joint by its name.
 
void set_torque (double torque, unsigned int joint_index)
 Set the torque of a joint by its index.
 
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.
 
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.
 
JointState copy () const
 Return a copy of the joint state.
 
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.
 
void reset () override
 Reset the object to a post-construction state.
 
bool is_incompatible (const State &state) const override
 Check if the joint state is incompatible for operations with the state given as argument.
 
void set_zero ()
 Set the joint state to a zero value.
 
std::vector< double > to_std_vector () const
 Return the joint state as a std vector.
 
JointStateoperator*= (double lambda)
 Scale inplace by a scalar.
 
JointState operator* (double lambda) const
 Scale a joint state by a scalar.
 
JointStateoperator/= (double lambda)
 Scale inplace by a scalar.
 
JointState operator/ (double lambda) const
 Scale a joint state by a scalar.
 
JointStateoperator+= (const JointState &state)
 Add inplace another joint state.
 
JointState operator+ (const JointState &state) const
 Add another joint sate.
 
JointState operator- () const
 Negate a joint state.
 
JointStateoperator-= (const JointState &state)
 Compute inplace the difference with another joint state.
 
JointState operator- (const JointState &state) const
 Compute the difference with another joint state.
 
- Public Member Functions inherited from state_representation::State
 State ()
 Empty constructor.
 
 State (const std::string &name)
 Constructor with name specification.
 
 State (const State &state)
 Copy constructor from another state.
 
virtual ~State ()=default
 Virtual destructor.
 
Stateoperator= (const State &state)
 Copy assignment operator that has to be defined to the custom assignment operator.
 
const StateTypeget_type () const
 Getter of the type attribute.
 
const std::string & get_name () const
 Getter of the name attribute.
 
bool is_empty () const
 Getter of the empty attribute.
 
const std::chrono::time_point< std::chrono::steady_clock > & get_timestamp () const
 Getter of the timestamp attribute.
 
virtual void set_name (const std::string &name)
 Setter of the name attribute.
 
void reset_timestamp ()
 Reset the timestamp attribute to now.
 
virtual void set_data (const Eigen::MatrixXd &data)
 Set the data of the state from an Eigen matrix.
 
double get_age () const
 Get the age of the state, i.e. the time since the last modification.
 
bool is_deprecated (double time_delay) const
 Check if the state is deprecated given a certain time delay.
 
template<typename DurationT >
bool is_deprecated (const std::chrono::duration< int64_t, DurationT > &time_delay) const
 Check if the state is deprecated given a certain time delay.
 
 operator bool () const noexcept
 Boolean operator for the truthiness of a state.
 

Static Public Member Functions

static JointAccelerations Zero (const std::string &robot_name, unsigned int nb_joints)
 Constructor for zero joint accelerations.
 
static JointAccelerations Zero (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor for zero joint accelerations.
 
static JointAccelerations Random (const std::string &robot_name, unsigned int nb_joints)
 Constructor for random joint accelerations.
 
static JointAccelerations Random (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor for random joint accelerations.
 
- 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 joint state.
 
static JointState Zero (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor for a zero joint state.
 
static JointState Random (const std::string &robot_name, unsigned int nb_joints)
 Constructor for a random joint state.
 
static JointState Random (const std::string &robot_name, const std::vector< std::string > &joint_names)
 Constructor for a random joint state.
 

Friends

JointAccelerations operator* (double lambda, const JointAccelerations &accelerations)
 Scale joint accelerations by a scalar.
 
JointAccelerations operator* (const Eigen::MatrixXd &lambda, const JointAccelerations &accelerations)
 Scale joint accelerations by a matrix.
 
JointVelocities operator* (const std::chrono::nanoseconds &dt, const JointAccelerations &accelerations)
 Integrate joint accelerations over a time period.
 
std::ostream & operator<< (std::ostream &os, const JointAccelerations &accelerations)
 Overload the ostream operator for printing.
 

Additional Inherited Members

- Protected Member Functions inherited from state_representation::JointState
void multiply_state_variable (const Eigen::MatrixXd &lambda, const JointStateVariable &state_variable_type)
 Proxy function that scale the specified state variable by a matrix.
 
Eigen::VectorXd get_state_variable (const JointStateVariable &state_variable_type) const
 Getter of the variable value corresponding to the input.
 
void set_state_variable (const Eigen::VectorXd &new_value, const JointStateVariable &state_variable_type)
 Setter of the variable value corresponding to the input.
 
void set_state_variable (const std::vector< double > &new_value, const JointStateVariable &state_variable_type)
 Setter of the variable value corresponding to the input.
 
void set_state_variable (double new_value, unsigned int joint_index, const JointStateVariable &state_variable_type)
 Setter of the variable value corresponding to the input.
 
std::string to_string () const override
 Convert the state to its string representation.
 
- Protected Member Functions inherited from state_representation::State
void set_type (const StateType &type)
 Setter of the state type attribute.
 
void set_empty (bool empty=true)
 Setter of the empty attribute.
 
void assert_not_empty () const
 Throw an exception if the state is empty.
 

Detailed Description

Class to define accelerations of the joints.

Definition at line 18 of file JointAccelerations.hpp.

Constructor & Destructor Documentation

◆ JointAccelerations() [1/8]

state_representation::JointAccelerations::JointAccelerations ( )
explicit

Empty constructor.

Definition at line 9 of file JointAccelerations.cpp.

◆ JointAccelerations() [2/8]

state_representation::JointAccelerations::JointAccelerations ( 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 13 of file JointAccelerations.cpp.

◆ JointAccelerations() [3/8]

state_representation::JointAccelerations::JointAccelerations ( 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 24 of file JointAccelerations.cpp.

◆ JointAccelerations() [4/8]

state_representation::JointAccelerations::JointAccelerations ( const std::string &  robot_name,
const Eigen::VectorXd &  accelerations 
)
explicit

Constructor with name and acceleration values provided.

name The name of the state

accelerations The vector of accelerations

Definition at line 18 of file JointAccelerations.cpp.

◆ JointAccelerations() [5/8]

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

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

name The name of the state

joint_names List of joint names

accelerations The vector of accelerations

Definition at line 28 of file JointAccelerations.cpp.

◆ JointAccelerations() [6/8]

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

Copy constructor.

Definition at line 43 of file JointAccelerations.cpp.

◆ JointAccelerations() [7/8]

state_representation::JointAccelerations::JointAccelerations ( const JointState state)

Copy constructor from a joint state.

Definition at line 35 of file JointAccelerations.cpp.

◆ JointAccelerations() [8/8]

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

Differentiation constructor from joint velocities by considering that it is equivalent to dividing the velocities by 1 second.

Definition at line 46 of file JointAccelerations.cpp.

Member Function Documentation

◆ clamp() [1/2]

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

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

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

Definition at line 84 of file JointAccelerations.cpp.

◆ clamp() [2/2]

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

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

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

Definition at line 79 of file JointAccelerations.cpp.

◆ clamped() [1/2]

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

Return the acceleration clamped to the values in argument.

Parameters
max_absolute_value_arrayThe maximum magnitude of acceleration for each joint
noise_ratio_arrayIf provided, this value will be used to apply a dead zone under which the acceleration will be set to 0
Returns
The clamped joint accelerations

Definition at line 94 of file JointAccelerations.cpp.

◆ clamped() [2/2]

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

Return the acceleration clamped to the values in argument.

Parameters
max_absolute_valuethe maximum magnitude of acceleration for all the joints
noise_ratioIf provided, this value will be used to apply a dead zone under which the acceleration will be set to 0
Returns
The clamped joint accelerations

Definition at line 88 of file JointAccelerations.cpp.

◆ copy()

JointAccelerations state_representation::JointAccelerations::copy ( ) const

Return a copy of the joint accelerations.

Definition at line 101 of file JointAccelerations.cpp.

◆ data()

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

Returns the accelerations data as an Eigen vector.

Returns
The accelerations data vector

Reimplemented from state_representation::JointState.

Definition at line 67 of file JointAccelerations.cpp.

◆ operator*() [1/2]

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

Integrate joint accelerations over a time period.

Parameters
dtThe time period used for integration
Returns
The resulting joint velocities after integration

Definition at line 127 of file JointAccelerations.cpp.

◆ operator*() [2/2]

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

Scale joint accelerations by a scalar.

All joints in all the state variables are scaled by the same factor.

Parameters
lambdaThe scaling factor
Returns
The reference to the scaled joint state
Parameters
lambdaThe scaling factor
Returns
The scaled joint accelerations

Definition at line 111 of file JointAccelerations.cpp.

◆ operator*=()

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

Scale inplace by a scalar.

All joints in all the state variables are scaled by the same factor.

Parameters
lambdaThe scaling factor
Returns
The reference to the scaled joint state
Parameters
lambdaThe scaling factor
Returns
The reference to the scaled joint accelerations

Definition at line 106 of file JointAccelerations.cpp.

◆ operator+() [1/2]

JointAccelerations state_representation::JointAccelerations::operator+ ( const JointAccelerations accelerations) const

Add other joint accelerations.

Parameters
accelerationsJoint accelerations with same name and same joint names
Returns
The combined joint accelerations

Definition at line 161 of file JointAccelerations.cpp.

◆ operator+() [2/2]

JointState state_representation::JointAccelerations::operator+ ( const JointState state) const

Add another joint sate.

Parameters
stateA joint state with same name and same joint names
Returns
The combined joint state

Definition at line 165 of file JointAccelerations.cpp.

◆ operator+=() [1/2]

JointAccelerations & state_representation::JointAccelerations::operator+= ( const JointAccelerations accelerations)

Add inplace other joint accelerations.

Parameters
accelerationsJoint accelerations with same name and same joint names
Returns
The reference to the combined joint accelerations

Definition at line 151 of file JointAccelerations.cpp.

◆ operator+=() [2/2]

JointAccelerations & state_representation::JointAccelerations::operator+= ( const JointState state)

Add inplace other joint accelerations from a joint state.

Parameters
stateA joint state with same name and same joint names
Returns
The reference to the combined joint accelerations

Definition at line 156 of file JointAccelerations.cpp.

◆ operator-() [1/3]

JointAccelerations state_representation::JointAccelerations::operator- ( ) const

Negate joint accelerations.

Returns
The negative value of the joint accelerations

Definition at line 169 of file JointAccelerations.cpp.

◆ operator-() [2/3]

JointAccelerations state_representation::JointAccelerations::operator- ( const JointAccelerations accelerations) const

Compute the difference with other joint accelerations.

Parameters
accelerationsJoint accelerations with same name and same joint names
Returns
The difference in accelerations

Definition at line 183 of file JointAccelerations.cpp.

◆ operator-() [3/3]

JointState state_representation::JointAccelerations::operator- ( const JointState state) const

Compute the difference with a joint state.

Parameters
stateA joint state with same name and same joint names
Returns
The difference in all the state variables

Definition at line 187 of file JointAccelerations.cpp.

◆ operator-=() [1/2]

JointAccelerations & state_representation::JointAccelerations::operator-= ( const JointAccelerations accelerations)

Compute inplace the difference with other joint accelerations.

Parameters
accelerationsJoint accelerations with same name and same joint names
Returns
The reference to the difference in accelerations

Definition at line 173 of file JointAccelerations.cpp.

◆ operator-=() [2/2]

JointAccelerations & state_representation::JointAccelerations::operator-= ( const JointState state)

Compute inplace the difference with a joint state.

Parameters
stateA joint state with same name and same joint names
Returns
The reference to the difference in accelerations

Definition at line 178 of file JointAccelerations.cpp.

◆ operator/()

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

Scale joint accelerations by a scalar.

All joints in all the state variables are scaled by the same factor.

Parameters
lambdaThe scaling factor
Returns
The reference to the scaled joint state
Parameters
lambdaThe scaling factor
Returns
The scaled joint accelerations

Definition at line 147 of file JointAccelerations.cpp.

◆ operator/=()

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

Scale inplace by a scalar.

All joints in all the state variables are scaled by the same factor.

Parameters
lambdaThe scaling factor
Returns
The reference to the scaled joint state
Parameters
lambdaThe scaling factor
Returns
The reference to the scaled joint accelerations

Definition at line 142 of file JointAccelerations.cpp.

◆ operator=()

JointAccelerations & state_representation::JointAccelerations::operator= ( const JointAccelerations accelerations)
default

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

Parameters
accelerationsThe state with value to assign
Returns
Reference to the current state with new values

◆ Random() [1/2]

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

Constructor for random joint accelerations.

Parameters
robot_nameThe name of the associated robot
joint_namesList of joint names
Returns
Joint accelerations with random values

Definition at line 63 of file JointAccelerations.cpp.

◆ Random() [2/2]

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

Constructor for random joint accelerations.

Parameters
robot_nameThe name of the associated robot
nb_jointsThe number of joints for initialization
Returns
Joint accelerations with random values

Definition at line 58 of file JointAccelerations.cpp.

◆ set_data() [1/2]

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

Set the accelerations data from an Eigen vector.

Parameters
dataThe accelerations data vector

Reimplemented from state_representation::JointState.

Definition at line 71 of file JointAccelerations.cpp.

◆ set_data() [2/2]

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

Set the accelerations data from a std vector.

Parameters
dataThe accelerations data vector

Reimplemented from state_representation::JointState.

Definition at line 75 of file JointAccelerations.cpp.

◆ Zero() [1/2]

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

Constructor for zero joint accelerations.

Parameters
robot_nameThe name of the associated robot
joint_namesList of joint names
Returns
Joint accelerations with zero values

Definition at line 54 of file JointAccelerations.cpp.

◆ Zero() [2/2]

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

Constructor for zero joint accelerations.

Parameters
robot_nameThe name of the associated robot
nb_jointsThe number of joints for initialization
Returns
Joint accelerations with zero values

Definition at line 49 of file JointAccelerations.cpp.

Friends And Related Symbol Documentation

◆ operator* [1/3]

JointAccelerations operator* ( const Eigen::MatrixXd &  lambda,
const JointAccelerations accelerations 
)
friend

Scale joint accelerations by a matrix.

Parameters
lambdaThe scaling matrix
accelerationsThe joint accelerations to be scaled
Returns
The scaled joint accelerations

Definition at line 121 of file JointAccelerations.cpp.

◆ operator* [2/3]

JointVelocities operator* ( const std::chrono::nanoseconds &  dt,
const JointAccelerations accelerations 
)
friend

Integrate joint accelerations over a time period.

Parameters
dtThe time period used for integration
accelerationsThe joint accelerations to be integrated
Returns
The resulting joint velocities after integration

Definition at line 138 of file JointAccelerations.cpp.

◆ operator* [3/3]

JointAccelerations operator* ( double  lambda,
const JointAccelerations accelerations 
)
friend

Scale joint accelerations by a scalar.

All joints in all the state variables are scaled by the same factor.

Parameters
lambdaThe scaling factor
Returns
The reference to the scaled joint state
Parameters
lambdaThe scaling factor
accelerationsThe joint accelerations to be scaled
Returns
The scaled joint accelerations

Definition at line 115 of file JointAccelerations.cpp.

◆ operator<<

std::ostream & operator<< ( std::ostream &  os,
const JointAccelerations accelerations 
)
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 191 of file JointAccelerations.cpp.


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