AUTh-ARL Core Stack
0.7
|
Defines an abstract model for a robot storing information like DOFs, kinematics etc. More...
#include <model.h>
Public Member Functions | |
Model () | |
An empty constructor. More... | |
Model (const std::string &n) | |
A basic constructor parsing the name of the model. More... | |
std::string | getName () |
Returns the name of the model. More... | |
unsigned int | getNrOfChains () |
Returns the total number of the chains of the model. More... | |
unsigned int | getNrOfMainChains () |
Returns the number of the main chains of the model. More... | |
std::string | getChainName (unsigned int chain) |
Returns the name of a chain. More... | |
std::vector< std::string > | getChainNames () |
Returns the names of every chain of the model. More... | |
unsigned int | getNrOfJoints () |
Returns the total number of the joints (total DOFs) of the robot model. More... | |
unsigned int | getNrOfJoints (int chain) |
Returns the number of the joints of a specific chain. More... | |
std::vector< std::string > | getJointNames () |
Returns the names of total joints of the robot model. More... | |
std::vector< std::string > | getJointNames (unsigned int chain) |
Returns the names of joints of one chain. More... | |
std::string | getJointName (unsigned int joint) |
Returns the name of a joint of the whole robot. More... | |
std::string | getJointName (unsigned int chain, unsigned int joint) |
Returns the name of a joint existing in a given chain. More... | |
std::pair< double, double > | getJointLimit (unsigned int chain, unsigned int joint) |
Returns the limit of a joint existing in a given chain. More... | |
double | getJointVelocityLimit (unsigned int joint) |
Returns the velocity limit of a joint existing in the complete list joints. More... | |
std::pair< double, double > | getJointLimit (unsigned int joint) |
Returns the limit of a joint existing in the complete list joints. More... | |
std::vector< std::pair< double, double > > | getJointLimits (unsigned int chain) |
Returns the limits of joints of one chain. More... | |
unsigned int | getGlobalIndex (int chain, unsigned int joint) |
Returns the index of a joint existing in a given main chain. This index is out of the total main joints of the robot. More... | |
std::vector< std::pair< double, double > > | getJointLimits () |
Returns the limits of total joints of the robot model. More... | |
void | test () |
Tests if a model has initialized properly. Call it in your implemented derived class constructor. More... | |
Public Attributes | |
std::map< std::string, int > | chain_index |
std::vector < KDL::ChainFkSolverPos_recursive > | fk_solver |
A number of KDL forward kinematic solvers, one for each chain. More... | |
std::vector < KDL::ChainJntToJacSolver > | jac_solver |
A number of KDL Jacobian solvers, one for each chain. Calculates the base Jacobian matrix of the chain. More... | |
std::vector< KDL::Chain > | chain |
A number of KDL Chains storing the kinematics of each chain. More... | |
Protected Attributes | |
std::vector< std::vector < unsigned int > > | global_index |
An array storing the global indeces. Should be filled by every model which derives from this class. More... | |
std::string | name |
The name of this Model. More... | |
unsigned int | num_chains_exclusive |
The number of the mutually exclusive chains. More... | |
std::vector< std::string > | chain_name |
The names of the chains of this Model. More... | |
std::vector< std::vector < std::string > > | joint_name |
The joint names of this Model. More... | |
std::vector< std::pair< double, double > > | joint_limit |
The joint limits of this Model. More... | |
std::vector< double > | velocity_limit |
The joint velocity limits of this Model. More... | |
std::vector< std::vector < std::string > > | link_name |
The link names of this Model. More... | |
Defines an abstract model for a robot storing information like DOFs, kinematics etc.
The Model of a robot contains the following things:
A class which derives from Model should always define the following:
A class which derives from Model could define, if desired, the following:
Upon availability of a URDF model of the robot someone can parse the URDF to Model class.
arl::robot::Model::Model | ( | ) |
An empty constructor.
|
explicit |
A basic constructor parsing the name of the model.
std::string arl::robot::Model::getChainName | ( | unsigned int | chain | ) |
Returns the name of a chain.
chain | The desired chain |
std::vector< std::string > arl::robot::Model::getChainNames | ( | ) |
Returns the names of every chain of the model.
unsigned int arl::robot::Model::getGlobalIndex | ( | int | chain, |
unsigned int | joint | ||
) |
Returns the index of a joint existing in a given main chain. This index is out of the total main joints of the robot.
chain | The chain of the desired joint |
joint | The desired joint |
std::pair< double, double > arl::robot::Model::getJointLimit | ( | unsigned int | chain, |
unsigned int | joint | ||
) |
Returns the limit of a joint existing in a given chain.
The following call will return a pair containing the lower and upper limit of the 2nd joint of the 3rd chain:
chain | The chain of the desired joint |
joint | The desired joint |
std::pair< double, double > arl::robot::Model::getJointLimit | ( | unsigned int | joint | ) |
Returns the limit of a joint existing in the complete list joints.
This means that needs to be given an index from the total number of joints of this model as given by Model::getNrOfJoints().
joint | The desired joint |
std::vector< std::pair< double, double > > arl::robot::Model::getJointLimits | ( | unsigned int | chain | ) |
Returns the limits of joints of one chain.
Returns the limits of the joints of the one chain of the robot as a standard vector of pairs (min, max). The size of this vector will match the output of Model::getNrOfJoints(unsigned int chain).
chain | The desired chain |
std::vector< std::pair< double, double > > arl::robot::Model::getJointLimits | ( | ) |
Returns the limits of total joints of the robot model.
Returns the limits of the joints of the whole robot as a standard vector of pairs (min, max). The size of this vector will match the output of Model::getNrOfJoints(). The sequence of the limits will follow the sequence of the joints and the sequence of the mutually exclusive chains stored in this Model.
std::string arl::robot::Model::getJointName | ( | unsigned int | joint | ) |
Returns the name of a joint of the whole robot.
This means that needs to be given an index from the total number of joints of this model as given by Model::getNrOfJoints().
joint | The desired joint |
std::string arl::robot::Model::getJointName | ( | unsigned int | chain, |
unsigned int | joint | ||
) |
Returns the name of a joint existing in a given chain.
The following call will return the name of the 2nd joint of the 3rd chain:
chain | The chain of the desired joint |
joint | The desired joint |
std::vector< std::string > arl::robot::Model::getJointNames | ( | ) |
Returns the names of total joints of the robot model.
Returns the names of the joints of the whole robot as a standard vector of strings. The size of this vector will match the output of Model::getNrOfJoints(). The sequence of the names will follow the sequence of the joints and the sequench of the mutually exclusive chains stored in this Model.
std::vector< std::string > arl::robot::Model::getJointNames | ( | unsigned int | chain | ) |
Returns the names of joints of one chain.
Returns the names of the joints of the one chain of the robot as a standard vector of strings. The size of this vector will match the output of Model::getNrOfJoints(unsigned int chain).
chain | The desired chain |
double arl::robot::Model::getJointVelocityLimit | ( | unsigned int | joint | ) |
Returns the velocity limit of a joint existing in the complete list joints.
This means that needs to be given an index from the total number of joints of this model as given by Model::getNrOfJoints().
joint | The desired joint |
std::string arl::robot::Model::getName | ( | ) |
Returns the name of the model.
unsigned int arl::robot::Model::getNrOfChains | ( | ) |
Returns the total number of the chains of the model.
unsigned int arl::robot::Model::getNrOfJoints | ( | ) |
Returns the total number of the joints (total DOFs) of the robot model.
As the total number of the main chains, i.e. all the distinct joints of this model because some models may have multiple chains which share joints between them.
unsigned int arl::robot::Model::getNrOfJoints | ( | int | chain | ) |
Returns the number of the joints of a specific chain.
chain | The index of the kinematic chain |
unsigned int arl::robot::Model::getNrOfMainChains | ( | ) |
Returns the number of the main chains of the model.
void arl::robot::Model::test | ( | ) |
Tests if a model has initialized properly. Call it in your implemented derived class constructor.
std::vector<KDL::Chain> arl::robot::Model::chain |
A number of KDL Chains storing the kinematics of each chain.
std::map<std::string, int> arl::robot::Model::chain_index |
|
protected |
The names of the chains of this Model.
The joint names as a tandard vector of strings. For example the chain_name.at(2) should contain the name of the 2nd chain of the model
std::vector<KDL::ChainFkSolverPos_recursive> arl::robot::Model::fk_solver |
A number of KDL forward kinematic solvers, one for each chain.
|
protected |
An array storing the global indeces. Should be filled by every model which derives from this class.
std::vector<KDL::ChainJntToJacSolver> arl::robot::Model::jac_solver |
A number of KDL Jacobian solvers, one for each chain. Calculates the base Jacobian matrix of the chain.
|
protected |
The joint limits of this Model.
The joint limit as a standard vector of double pairs. For example the joint_limit.at(1).first should contain the lower (min) limit of the 2nd joint of the robot (considered as global index) of the whereas limit.at(2).second should contain the upper (max) limit of the same joint.
|
protected |
The joint names of this Model.
The joint names as a 2D standard vector of strings. For example the joint_name.at(1).at(2) should contain the name of the 2nd joint of the 1st defined chain.
|
protected |
The link names of this Model.
The link names as a 2D standard vector of strings. For example the link_name.at(1).at(2) should contain the name of the 2nd link of the 1st defined chain.
|
protected |
|
protected |
The number of the mutually exclusive chains.
Mutually exclusive chains will not share common joints between them. The mutually exclussive chains are a subset of the total chains of the model. For instance a class which inherits from Model and defines a model for the 7DOF KUKA LWR4+ arm can have 1 chain which is exclusive and contains the 7 joints and a number of other chains depended on the usage of the class. The rest of the chains can be 7 other chains from the base of the robot to each joint of the robot and can be used for example in order to have the task pose of each joint of the robot. A robot with two arms can have two mutually exclusive chains (the two arms) or a robotic hand can have a number of mutually exclusive chains equal to its fingers.
|
protected |
The joint velocity limits of this Model.
The joint limit as a standard vector of double. For example the velocity_limit.at(i) contains the speed limit of the joint i, and with i a global joint index