Virtual base robot class. More...
#include <robot.h>
Public Member Functions | |
ReturnMatrix | acceleration (const ColumnVector &q, const ColumnVector &qp, const ColumnVector &tau) |
Joints acceleration without contact force. More... | |
ReturnMatrix | acceleration (const ColumnVector &q, const ColumnVector &qp, const ColumnVector &tau, const ColumnVector &Fext, const ColumnVector &Next) |
Joints acceleration. More... | |
virtual ReturnMatrix | C (const ColumnVector &qp)=0 |
virtual void | delta_torque (const ColumnVector &q, const ColumnVector &qp, const ColumnVector &qpp, const ColumnVector &dq, const ColumnVector &dqp, const ColumnVector &dqpp, ColumnVector &torque, ColumnVector &dtorque)=0 |
virtual void | dq_torque (const ColumnVector &q, const ColumnVector &qp, const ColumnVector &qpp, const ColumnVector &dq, ColumnVector &torque, ColumnVector &dtorque)=0 |
virtual void | dqp_torque (const ColumnVector &q, const ColumnVector &qp, const ColumnVector &dqp, ColumnVector &torque, ColumnVector &dtorque)=0 |
ReturnMatrix | dtau_dq (const ColumnVector &q, const ColumnVector &qp, const ColumnVector &qpp) |
Sensitivity of the dynamics with respect to . More... | |
ReturnMatrix | dtau_dqp (const ColumnVector &q, const ColumnVector &qp) |
Sensitivity of the dynamics with respect to . More... | |
virtual void | dTdqi (Matrix &dRot, ColumnVector &dp, const int i)=0 |
virtual ReturnMatrix | dTdqi (const int i)=0 |
void | error (const std::string &msg1) const |
Print the message msg1 on the console. More... | |
virtual ReturnMatrix | G ()=0 |
int | get_available_dof () const |
Counts number of currently non-immobile links. More... | |
int | get_available_dof (const int endlink) const |
Counts number of currently non-immobile links up to and including endlink. More... | |
ReturnMatrix | get_available_q (void) const |
Return the joint position vector of available (non-immobile) joints. More... | |
ReturnMatrix | get_available_q (const int endlink) const |
Return the joint position vector of available (non-immobile) joints up to and including endlink. More... | |
ReturnMatrix | get_available_qp (void) const |
Return the joint velocity vector of available (non-immobile) joints. More... | |
ReturnMatrix | get_available_qp (const int endlink) const |
Return the joint velocity vector of available (non-immobile) joints up to and including endlink. More... | |
ReturnMatrix | get_available_qpp (void) const |
Return the joint acceleration vector of available (non-immobile) joints. More... | |
ReturnMatrix | get_available_qpp (const int endlink) const |
Return the joint acceleration vector of available (non-immobile) joints up to and including endlink. More... | |
bool | get_DH () const |
Return true if in DH notation, false otherwise. More... | |
int | get_dof () const |
Return dof. More... | |
int | get_fix () const |
Return fix. More... | |
Real | get_q (const int i) const |
ReturnMatrix | get_q (void) const |
Return the joint position vector. More... | |
ReturnMatrix | get_qp (void) const |
Return the joint velocity vector. More... | |
ReturnMatrix | get_qpp (void) const |
Return the joint acceleration vector. More... | |
ReturnMatrix | inertia (const ColumnVector &q) |
Inertia of the manipulator. More... | |
virtual ReturnMatrix | inv_kin (const Matrix &Tobj, const int mj=0) |
Numerical inverse kinematics. See inv_kin(const Matrix & Tobj, const int mj, const int endlink, bool & converge) More... | |
ReturnMatrix | inv_kin (const Matrix &Tobj, const int mj, bool &converge) |
virtual ReturnMatrix | inv_kin (const Matrix &Tobj, const int mj, const int endlink, bool &converge) |
Numerical inverse kinematics. More... | |
virtual ReturnMatrix | inv_kin_puma (const Matrix &Tobj, bool &converge)=0 |
virtual ReturnMatrix | inv_kin_rhino (const Matrix &Tobj, bool &converge)=0 |
virtual ReturnMatrix | inv_kin_schilling (const Matrix &Tobj, bool &converge)=0 |
virtual ReturnMatrix | jacobian (const int ref=0) const |
Jacobian of mobile links expressed at frame ref. More... | |
virtual ReturnMatrix | jacobian (const int endlink, const int ref) const =0 |
ReturnMatrix | jacobian_DLS_inv (const double eps, const double lambda_max, const int ref=0) const |
Inverse Jacobian based on damped least squares inverse. More... | |
virtual ReturnMatrix | jacobian_dot (const int ref=0) const =0 |
void | kine (Matrix &Rot, ColumnVector &pos) const |
Direct kinematics at end effector. More... | |
void | kine (Matrix &Rot, ColumnVector &pos, const int j) const |
Direct kinematics at end effector. More... | |
ReturnMatrix | kine (void) const |
Return the end effector direct kinematics transform matrix. More... | |
ReturnMatrix | kine (const int j) const |
Return the frame j direct kinematics transform matrix. More... | |
ReturnMatrix | kine_pd (const int ref=0) const |
Direct kinematics with velocity. More... | |
virtual void | kine_pd (Matrix &Rot, ColumnVector &pos, ColumnVector &pos_dot, const int ref) const =0 |
Robot_basic & | operator= (const Robot_basic &x) |
Overload = operator. More... | |
Robot_basic (const int ndof=1, const bool dh_parameter=false, const bool min_inertial_para=false) | |
Constructor. More... | |
Robot_basic (const Matrix &initrobot_motor, const bool dh_parameter=false, const bool min_inertial_para=false) | |
Constructor. More... | |
Robot_basic (const Matrix &initrobot, const Matrix &initmotor, const bool dh_parameter=false, const bool min_inertial_para=false) | |
Constructor. More... | |
Robot_basic (const std::string &filename, const std::string &robotName, const bool dh_parameter=false, const bool min_inertial_para=false) | |
Robot_basic (const Robot_basic &x) | |
Copy constructor. More... | |
virtual void | robotType_inv_kin ()=0 |
void | set_q (const ColumnVector &q) |
Set the joint position vector. More... | |
void | set_q (const Matrix &q) |
Set the joint position vector. More... | |
void | set_q (const Real q, const int i) |
void | set_qp (const ColumnVector &qp) |
Set the joint velocity vector. More... | |
void | set_qpp (const ColumnVector &qpp) |
Set the joint acceleration vector. More... | |
virtual ReturnMatrix | torque (const ColumnVector &q, const ColumnVector &qp, const ColumnVector &qpp)=0 |
virtual ReturnMatrix | torque (const ColumnVector &q, const ColumnVector &qp, const ColumnVector &qpp, const ColumnVector &Fext_, const ColumnVector &Next_)=0 |
virtual ReturnMatrix | torque_novelocity (const ColumnVector &qpp)=0 |
virtual | ~Robot_basic () |
Destructor. More... | |
Public Attributes | |
ColumnVector * | a |
ColumnVector * | da |
ColumnVector * | df |
ColumnVector * | dF |
ColumnVector * | dn |
ColumnVector * | dN |
ColumnVector * | dp |
ColumnVector * | dvp |
ColumnVector * | dw |
ColumnVector * | dwp |
ColumnVector * | f |
ColumnVector * | F |
ColumnVector * | f_nv |
ColumnVector | gravity |
Gravity vector. More... | |
Link * | links |
Pointer on Link cclass. More... | |
ColumnVector * | N |
ColumnVector * | n |
ColumnVector * | n_nv |
ColumnVector * | p |
ColumnVector * | pp |
Matrix * | R |
Temprary rotation matrix. More... | |
ColumnVector * | vp |
ColumnVector * | w |
ColumnVector * | wp |
ColumnVector | z0 |
Axis vector at each joint. More... | |
Private Types | |
enum | EnumRobotType { DEFAULT = 0, RHINO = 1, PUMA = 2, SCHILLING = 3 } |
enum EnumRobotType More... | |
Private Member Functions | |
void | cleanUpPointers () |
Free all vectors and matrix memory. More... | |
Private Attributes | |
int | dof |
Degree of freedom. More... | |
int | fix |
Virtual link, used with modified DH notation. More... | |
EnumRobotType | robotType |
Robot type. More... | |
Friends | |
class | mRobot |
class | mRobot_min_para |
class | mRobotgl |
class | Robot |
class | Robotgl |
|
private |
Robot_basic::Robot_basic | ( | const int | ndof = 1 , |
const bool | dh_parameter = false , |
||
const bool | min_inertial_para = false |
||
) |
Constructor.
ndof | Robot degree of freedom. |
dh_parameter | true if DH notation, false if modified DH notation. |
min_inertial_para | true inertial parameter are in minimal form. |
Allocate memory for vectors and matrix pointers. Initialize all the Links instance.
Robot_basic::Robot_basic | ( | const Matrix & | dhinit, |
const bool | dh_parameter = false , |
||
const bool | min_inertial_para = false |
||
) |
Constructor.
dhinit | Robot initialization matrix. |
dh_parameter | true if DH notation, false if modified DH notation. |
min_inertial_para | true inertial parameter are in minimal form. |
Allocate memory for vectors and matrix pointers. Initialize all the Links instance.
Robot_basic::Robot_basic | ( | const Matrix & | initrobot, |
const Matrix & | initmotor, | ||
const bool | dh_parameter = false , |
||
const bool | min_inertial_para = false |
||
) |
Constructor.
initrobot | Robot initialization matrix. |
initmotor | Motor initialization matrix. |
dh_parameter | true if DH notation, false if modified DH notation. |
min_inertial_para | true inertial parameter are in minimal form. |
Allocate memory for vectors and matrix pointers. Initialize all the Links instance.
Robot_basic::Robot_basic | ( | const std::string & | filename, |
const std::string & | robotName, | ||
const bool | dh_parameter = false , |
||
const bool | min_inertial_para = false |
||
) |
Robot_basic::Robot_basic | ( | const Robot_basic & | x | ) |
|
virtual |
ReturnMatrix Robot_basic::acceleration | ( | const ColumnVector & | q, |
const ColumnVector & | qp, | ||
const ColumnVector & | tau | ||
) |
Joints acceleration without contact force.
Definition at line 100 of file dynamics.cpp.
ReturnMatrix Robot_basic::acceleration | ( | const ColumnVector & | q, |
const ColumnVector & | qp, | ||
const ColumnVector & | tau_cmd, | ||
const ColumnVector & | Fext, | ||
const ColumnVector & | Next | ||
) |
Joints acceleration.
The robot dynamics is
then the joint acceleration is
Definition at line 112 of file dynamics.cpp.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
|
private |
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
ReturnMatrix Robot_basic::dtau_dq | ( | const ColumnVector & | q, |
const ColumnVector & | qp, | ||
const ColumnVector & | qpp | ||
) |
Sensitivity of the dynamics with respect to .
This function computes .
Definition at line 58 of file sensitiv.cpp.
ReturnMatrix Robot_basic::dtau_dqp | ( | const ColumnVector & | q, |
const ColumnVector & | qp | ||
) |
Sensitivity of the dynamics with respect to .
This function computes .
Definition at line 84 of file sensitiv.cpp.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
void Robot_basic::error | ( | const std::string & | msg1 | ) | const |
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
|
inline |
int Robot_basic::get_available_dof | ( | const int | endlink | ) | const |
|
inline |
ReturnMatrix Robot_basic::get_available_q | ( | const int | endlink | ) | const |
|
inline |
ReturnMatrix Robot_basic::get_available_qp | ( | const int | endlink | ) | const |
|
inline |
ReturnMatrix Robot_basic::get_available_qpp | ( | const int | endlink | ) | const |
|
inline |
|
inline |
ReturnMatrix Robot_basic::get_q | ( | void | ) | const |
ReturnMatrix Robot_basic::get_qp | ( | void | ) | const |
ReturnMatrix Robot_basic::get_qpp | ( | void | ) | const |
ReturnMatrix Robot_basic::inertia | ( | const ColumnVector & | q | ) |
Inertia of the manipulator.
Definition at line 83 of file dynamics.cpp.
|
virtual |
Numerical inverse kinematics. See inv_kin(const Matrix & Tobj, const int mj, const int endlink, bool & converge)
Overload inv_kin function.
Reimplemented in mRobot_min_para, mRobot, and Robot.
Definition at line 83 of file invkine.cpp.
|
inline |
|
virtual |
Numerical inverse kinematics.
Tobj | Transformation matrix expressing the desired end effector pose. |
mj | Select algorithm type, 0: based on Jacobian, 1: based on derivative of T. |
converge | Indicate if the algorithm converge. |
endlink | the link to pretend is the end effector |
The joint position vector before the inverse kinematics is returned if the algorithm does not converge.
Reimplemented in mRobot_min_para, mRobot, and Robot.
Definition at line 91 of file invkine.cpp.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
|
inlinevirtual |
Jacobian of mobile links expressed at frame ref.
Reimplemented in mRobot_min_para, mRobot, and Robot.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
ReturnMatrix Robot_basic::jacobian_DLS_inv | ( | const double | eps, |
const double | lambda_max, | ||
const int | ref = 0 |
||
) | const |
Inverse Jacobian based on damped least squares inverse.
eps | Range of singular region. |
lambda_max | Value to obtain a good solution in singular region. |
ref | Selected frame (ex: joint 4). |
The Jacobian inverse, based on damped least squares, is
where and is a damping factor and the identity matrix respectively. Based on SVD (Singular Value Decomposition) the Jacobian is , where , and are respectively the input vector, the ouput vector and the singular values ( , is the rank of J). Using the previous equations we obtain
A singular region, based on the smallest singular value, can be defined by
Definition at line 169 of file kinemat.cpp.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
void Robot_basic::kine | ( | Matrix & | Rot, |
ColumnVector & | pos | ||
) | const |
Direct kinematics at end effector.
Rot | End effector orientation. |
pos | Enf effector position. |
Definition at line 92 of file kinemat.cpp.
void Robot_basic::kine | ( | Matrix & | Rot, |
ColumnVector & | pos, | ||
const int | j | ||
) | const |
Direct kinematics at end effector.
Rot | Frame j orientation. |
pos | Frame j position. |
j | Selected frame. |
Definition at line 102 of file kinemat.cpp.
ReturnMatrix Robot_basic::kine | ( | void | ) | const |
Return the end effector direct kinematics transform matrix.
Definition at line 120 of file kinemat.cpp.
ReturnMatrix Robot_basic::kine | ( | const int | j | ) | const |
Return the frame j direct kinematics transform matrix.
Definition at line 129 of file kinemat.cpp.
ReturnMatrix Robot_basic::kine_pd | ( | const int | j = 0 | ) | const |
Direct kinematics with velocity.
Return a matrix. The first three columns are the frame j to the base rotation, the fourth column is the frame j w.r.t to the base postion vector and the last column is the frame j w.r.t to the base translational velocity vector. Print an error on the console if j is out of range.
Definition at line 142 of file kinemat.cpp.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
Robot_basic & Robot_basic::operator= | ( | const Robot_basic & | x | ) |
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
void Robot_basic::set_q | ( | const ColumnVector & | q | ) |
void Robot_basic::set_q | ( | const Matrix & | q | ) |
|
inline |
void Robot_basic::set_qp | ( | const ColumnVector & | qp | ) |
void Robot_basic::set_qpp | ( | const ColumnVector & | qpp | ) |
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
|
pure virtual |
Implemented in mRobot_min_para, mRobot, and Robot.
|
friend |
ColumnVector * Robot_basic::a |
ColumnVector * Robot_basic::da |
ColumnVector * Robot_basic::df |
ColumnVector * Robot_basic::dF |
ColumnVector * Robot_basic::dn |
ColumnVector * Robot_basic::dN |
ColumnVector * Robot_basic::dp |
ColumnVector * Robot_basic::dvp |
ColumnVector * Robot_basic::dw |
ColumnVector * Robot_basic::dwp |
ColumnVector * Robot_basic::f |
ColumnVector * Robot_basic::F |
ColumnVector * Robot_basic::f_nv |
|
private |
ColumnVector Robot_basic::gravity |
ColumnVector * Robot_basic::n |
ColumnVector * Robot_basic::N |
ColumnVector * Robot_basic::n_nv |
ColumnVector * Robot_basic::p |
ColumnVector * Robot_basic::pp |
|
private |
ColumnVector * Robot_basic::vp |
ColumnVector* Robot_basic::w |
ColumnVector * Robot_basic::wp |
ColumnVector Robot_basic::z0 |