Control Libraries 6.3.4
|
Class to define a robot Jacobian matrix. More...
#include <Jacobian.hpp>
Public Member Functions | |
Jacobian () | |
Empty constructor for a Jacobian. More... | |
Jacobian (const std::string &robot_name, unsigned int nb_joints, const std::string &frame, const std::string &reference_frame="world") | |
Constructor with name, number of joints, frame name and reference frame provided. More... | |
Jacobian (const std::string &robot_name, const std::vector< std::string > &joint_names, const std::string &frame, const std::string &reference_frame="world") | |
Constructor with name, joint names, frame name and reference frame provided. More... | |
Jacobian (const std::string &robot_name, const std::string &frame, const Eigen::MatrixXd &data, const std::string &reference_frame="world") | |
Constructor with name, frame, Jacobian matrix and reference frame provided. More... | |
Jacobian (const std::string &robot_name, const std::vector< std::string > &joint_names, const std::string &frame, const Eigen::MatrixXd &data, const std::string &reference_frame="world") | |
Constructor with name, joint names, frame name, Jacobian matrix and reference frame provided. More... | |
Jacobian (const Jacobian &jacobian) | |
Copy constructor of a Jacobian. More... | |
Jacobian & | operator= (const Jacobian &jacobian) |
Copy assignment operator that have to be defined to the custom assignment operator. More... | |
unsigned int | rows () const |
Getter of the number of rows attribute. More... | |
Eigen::VectorXd | row (unsigned int index) const |
Accessor of the row data at given index. More... | |
unsigned int | cols () const |
Getter of the number of columns attribute. More... | |
Eigen::VectorXd | col (unsigned int index) const |
Accessor of the column data at given index. More... | |
const std::vector< std::string > & | get_joint_names () const |
Getter of the joint_names attribute. More... | |
void | set_joint_names (unsigned int nb_joints) |
Setter of the joint_names attribute from the number of joints. More... | |
void | set_joint_names (const std::vector< std::string > &joint_names) |
Setter of the joint_names attribute from a vector of joint names. More... | |
const std::string & | get_frame () const |
Getter of the frame attribute. More... | |
const std::string & | get_reference_frame () const |
Getter of the reference_frame attribute. More... | |
void | set_reference_frame (const CartesianPose &reference_frame) |
Setter of the reference_frame attribute from a CartesianPose Update the value of the data matrix accordingly by changing the reference frame of each columns. This means that the computation needs to be compatible, i.e. the previous reference frame should match the name of the new reference frame as input. More... | |
const Eigen::MatrixXd & | data () const |
Getter of the data attribute. More... | |
void | set_data (const Eigen::MatrixXd &data) override |
Setter of the data attribute. More... | |
bool | is_compatible (const State &state) const override |
Check if the Jacobian matrix is compatible for operations with the state given as argument. More... | |
void | initialize () override |
Initialize the matrix to a zero value. More... | |
Jacobian | transpose () const |
Return the transpose of the Jacobian matrix. More... | |
Jacobian | inverse () const |
Return the inverse of the Jacobian matrix If the matrix is not invertible, an error is thrown advising to use the pseudoinverse function instead. More... | |
Jacobian | pseudoinverse () const |
Return the pseudoinverse of the Jacobian matrix. More... | |
Eigen::MatrixXd | operator* (const Eigen::MatrixXd &matrix) const |
Overload the * operator with an arbitrary matrix. More... | |
Eigen::MatrixXd | operator* (const Jacobian &jacobian) const |
Overload the * operator with another Jacobian. More... | |
CartesianTwist | operator* (const JointVelocities &dq) const |
Overload the * operator with a JointVelocities. More... | |
JointVelocities | operator* (const CartesianTwist &twist) const |
Overload the * operator with a CartesianTwist. More... | |
JointTorques | operator* (const CartesianWrench &wrench) const |
Overload the * operator with a CartesianWrench. More... | |
Eigen::MatrixXd | solve (const Eigen::MatrixXd &matrix) const |
Solve the system X = inv(J)*M to obtain X which is more efficient than multiplying with the pseudo-inverse. More... | |
JointVelocities | solve (const CartesianTwist &twist) const |
Solve the system dX = J*dq to obtain dq which is more efficient than multiplying with the pseudo-inverse. More... | |
double & | operator() (unsigned int row, unsigned int col) |
Overload the () operator in a non const fashion to modify the value at given (row, col) More... | |
const double & | operator() (unsigned int row, unsigned int col) const |
Overload the () operator const fashion to access the value at given (row, col) More... | |
Jacobian | copy () const |
Return a copy of the JointPositions. 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. | |
State & | operator= (const State &state) |
Copy assignment operator that have to be defined to the custom assignment operator. More... | |
const StateType & | get_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 Jacobian | Random (const std::string &robot_name, unsigned int nb_joints, const std::string &frame, const std::string &reference_frame="world") |
Constructor for a random Jacobian. More... | |
static Jacobian | Random (const std::string &robot_name, const std::vector< std::string > &joint_names, const std::string &frame, const std::string &reference_frame="world") |
Constructor for a random Jacobian. More... | |
Friends | |
void | swap (Jacobian &jacobian1, Jacobian &jacobian2) |
Swap the values of the two Jacobian. More... | |
std::ostream & | operator<< (std::ostream &os, const Jacobian &jacobian) |
Overload the ostream operator for printing. More... | |
Jacobian | operator* (const CartesianPose &pose, const Jacobian &jacobian) |
Overload the * operator with a CartesianPose on left side. This is equivalent to a changing of reference frame of the Jacobian. More... | |
Eigen::MatrixXd | operator* (const Eigen::MatrixXd &matrix, const Jacobian &jacobian) |
Overload the * operator with an arbitrary matrix on the left side. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from state_representation::State | |
void | set_type (const StateType &type) |
Override the state type. More... | |
Class to define a robot Jacobian matrix.
Definition at line 20 of file Jacobian.hpp.
state_representation::Jacobian::Jacobian | ( | ) |
Empty constructor for a Jacobian.
Definition at line 7 of file Jacobian.cpp.
state_representation::Jacobian::Jacobian | ( | const std::string & | robot_name, |
unsigned int | nb_joints, | ||
const std::string & | frame, | ||
const std::string & | reference_frame = "world" |
||
) |
Constructor with name, number of joints, frame name and reference frame provided.
robot_name | the name of the associated robot |
nb_joints | the number of joints of the robot |
frame | the name of the frame at which the Jacobian is computed |
reference_frame | the name of the reference frame in which the Jacobian is expressed (default "world") |
Definition at line 11 of file Jacobian.cpp.
state_representation::Jacobian::Jacobian | ( | const std::string & | robot_name, |
const std::vector< std::string > & | joint_names, | ||
const std::string & | frame, | ||
const std::string & | reference_frame = "world" |
||
) |
Constructor with name, joint names, frame name and reference frame provided.
robot_name | the name of the associated robot |
joint_names | the vector of joint names of the robot |
frame | the name of the frame at which the Jacobian is computed |
reference_frame | the name of the reference frame in which the Jacobian is expressed (default "world") |
Definition at line 25 of file Jacobian.cpp.
state_representation::Jacobian::Jacobian | ( | const std::string & | robot_name, |
const std::string & | frame, | ||
const Eigen::MatrixXd & | data, | ||
const std::string & | reference_frame = "world" |
||
) |
Constructor with name, frame, Jacobian matrix and reference frame provided.
robot_name | the name of the associated robot |
frame | the name of the frame at which the Jacobian is computed |
data | the values of the Jacobian matrix |
reference_frame | the name of the reference frame in which the Jacobian is expressed (default "world") |
Definition at line 38 of file Jacobian.cpp.
state_representation::Jacobian::Jacobian | ( | const std::string & | robot_name, |
const std::vector< std::string > & | joint_names, | ||
const std::string & | frame, | ||
const Eigen::MatrixXd & | data, | ||
const std::string & | reference_frame = "world" |
||
) |
Constructor with name, joint names, frame name, Jacobian matrix and reference frame provided.
robot_name | the name of the associated robot |
joint_names | the vector of joint names of the robot |
frame | the name of the frame at which the Jacobian is computed |
data | the values of the Jacobian matrix |
reference_frame | the name of the reference frame in which the Jacobian is expressed (default "world") |
Definition at line 46 of file Jacobian.cpp.
state_representation::Jacobian::Jacobian | ( | const Jacobian & | jacobian | ) |
Copy constructor of a Jacobian.
Definition at line 55 of file Jacobian.cpp.
|
inline |
Accessor of the column data at given index.
index | the index of the desired column |
Definition at line 356 of file Jacobian.hpp.
|
inline |
Getter of the number of columns attribute.
Definition at line 348 of file Jacobian.hpp.
Jacobian state_representation::Jacobian::copy | ( | ) | const |
|
inline |
Getter of the data attribute.
Definition at line 392 of file Jacobian.hpp.
|
inline |
Getter of the frame attribute.
Definition at line 384 of file Jacobian.hpp.
|
inline |
Getter of the joint_names attribute.
Definition at line 360 of file Jacobian.hpp.
|
inline |
Getter of the reference_frame attribute.
Definition at line 388 of file Jacobian.hpp.
|
overridevirtual |
Initialize the matrix to a zero value.
Reimplemented from state_representation::State.
Definition at line 64 of file Jacobian.cpp.
Jacobian state_representation::Jacobian::inverse | ( | ) | const |
Return the inverse of the Jacobian matrix If the matrix is not invertible, an error is thrown advising to use the pseudoinverse function instead.
Definition at line 145 of file Jacobian.cpp.
|
overridevirtual |
Check if the Jacobian matrix is compatible for operations with the state given as argument.
state | the state to check compatibility with |
Reimplemented from state_representation::State.
Definition at line 88 of file Jacobian.cpp.
|
inline |
Overload the () operator in a non const fashion to modify the value at given (row, col)
row | the index of the row |
the | index of the column |
Definition at line 407 of file Jacobian.hpp.
|
inline |
Overload the () operator const fashion to access the value at given (row, col)
row | the index of the row |
the | index of the column |
Definition at line 417 of file Jacobian.hpp.
JointVelocities state_representation::Jacobian::operator* | ( | const CartesianTwist & | twist | ) | const |
Overload the * operator with a CartesianTwist.
twist | the cartesian velocity to multiply with |
Definition at line 200 of file Jacobian.cpp.
JointTorques state_representation::Jacobian::operator* | ( | const CartesianWrench & | wrench | ) | const |
Overload the * operator with a CartesianWrench.
wrench | the cartesian wrench to multiply with |
Definition at line 215 of file Jacobian.cpp.
Eigen::MatrixXd state_representation::Jacobian::operator* | ( | const Eigen::MatrixXd & | matrix | ) | const |
Overload the * operator with an arbitrary matrix.
matrix | the matrix to multiply with |
Definition at line 166 of file Jacobian.cpp.
Eigen::MatrixXd state_representation::Jacobian::operator* | ( | const Jacobian & | jacobian | ) | const |
Overload the * operator with another Jacobian.
jacobian | the Jacobian to multiply with |
Definition at line 177 of file Jacobian.cpp.
CartesianTwist state_representation::Jacobian::operator* | ( | const JointVelocities & | dq | ) | const |
Overload the * operator with a JointVelocities.
dq | the joint velocity to multiply with |
Definition at line 185 of file Jacobian.cpp.
Copy assignment operator that have to be defined to the custom assignment operator.
jacobian | the Jacobian with value to assign |
Definition at line 338 of file Jacobian.hpp.
Jacobian state_representation::Jacobian::pseudoinverse | ( | ) | const |
Return the pseudoinverse of the Jacobian matrix.
Definition at line 157 of file Jacobian.cpp.
|
static |
Constructor for a random Jacobian.
robot_name | the name of the associated robot |
joint_names | the vector of joint names of the robot |
frame | the name of the frame at which the Jacobian is computed |
reference_frame | the name of the reference frame in which the Jacobian is expressed (default "world") |
Definition at line 79 of file Jacobian.cpp.
|
static |
Constructor for a random Jacobian.
robot_name | the name of the associated robot |
nb_joints | the number of joints of the robot |
frame | the name of the frame at which the Jacobian is computed |
reference_frame | the name of the reference frame in which the Jacobian is expressed (default "world") |
Definition at line 70 of file Jacobian.cpp.
|
inline |
Accessor of the row data at given index.
index | the index of the desired row |
Definition at line 352 of file Jacobian.hpp.
|
inline |
Getter of the number of rows attribute.
Definition at line 344 of file Jacobian.hpp.
|
inlineoverridevirtual |
Setter of the data attribute.
Reimplemented from state_representation::State.
Definition at line 396 of file Jacobian.hpp.
|
inline |
Setter of the joint_names attribute from a vector of joint names.
Definition at line 375 of file Jacobian.hpp.
|
inline |
Setter of the joint_names attribute from the number of joints.
Definition at line 364 of file Jacobian.hpp.
void state_representation::Jacobian::set_reference_frame | ( | const CartesianPose & | reference_frame | ) |
Setter of the reference_frame attribute from a CartesianPose Update the value of the data matrix accordingly by changing the reference frame of each columns. This means that the computation needs to be compatible, i.e. the previous reference frame should match the name of the new reference frame as input.
reference_frame | the reference frame as a CartesianPose |
Definition at line 133 of file Jacobian.cpp.
JointVelocities state_representation::Jacobian::solve | ( | const CartesianTwist & | twist | ) | const |
Solve the system dX = J*dq to obtain dq which is more efficient than multiplying with the pseudo-inverse.
dX | the cartesian velocity to multiply with |
Definition at line 241 of file Jacobian.cpp.
Eigen::MatrixXd state_representation::Jacobian::solve | ( | const Eigen::MatrixXd & | matrix | ) | const |
Solve the system X = inv(J)*M to obtain X which is more efficient than multiplying with the pseudo-inverse.
matrix | the matrix to solve the system with |
Definition at line 230 of file Jacobian.cpp.
Jacobian state_representation::Jacobian::transpose | ( | ) | const |
Return the transpose of the Jacobian matrix.
Definition at line 137 of file Jacobian.cpp.
|
friend |
Overload the * operator with a CartesianPose on left side. This is equivalent to a changing of reference frame of the Jacobian.
pose | the CartesianPose to multiply with |
jacobian | the Jacobian to be multiplied with the CartesianPose |
Definition at line 288 of file Jacobian.cpp.
|
friend |
Overload the * operator with an arbitrary matrix on the left side.
matrix | the matrix to multiply with |
jacobian | the jacobian matrix |
Definition at line 318 of file Jacobian.cpp.
|
friend |
Overload the ostream operator for printing.
os | the ostream to append the string representing the matrix to |
jacobian | the Jacobian to print |
Definition at line 263 of file Jacobian.cpp.
Swap the values of the two Jacobian.
Definition at line 328 of file Jacobian.hpp.