#include <robot.h>
Public Member Functions | |
CRobot () | |
~CRobot () | |
void | init (char *filename) |
Initializes the robot. | |
void | cleanUp () |
void | initDhParameters (char *filename) |
Reads kinematic model data from xml file. | |
void | updateDhParameters (bool current=true) |
Reads current angles from the robot wrapper and updates the denavit hartenberg parameters. | |
void | getAnglesFromDh (float *angles) |
Extracts angles from denavit hartenberg parameters. | |
void | setDhFromAngles (float *angles) |
Updates denavit hartenberg parameters with array of angles. | |
void | calcForwardKinematics (bool draw=true) |
Calculates forward kinematics based on denavit hartenberg parameters. | |
void | calcInverseKinematics (int kinematicChain, CMatrix &pose) |
Calculates inverse kinematics. | |
void | calcDynamics (float *angles, float *angles_v, float *angles_a, int view, float *result) |
Calculates dynamic behaviour of robot. | |
void | estimateInverseKinematics (int kinematicChain, CMatrix &pose) |
Numerical estimation of the inverse kinematics. | |
void | getTCPs (CVec *positionAndOrientation) |
Generates an array of Position and Orientation vectors. | |
void | calcKinematicChain (int len, CBox *geometry[], CDh *dhValues[]) |
int | checkCollisions (bool msg=true, bool useOld=false) |
Starts collision test. | |
int | checkCollisions (int &first, int &second) |
Starts collision test. | |
bool | xmlToFrame (CFrame *frame, TiXmlElement *frameNode) |
Transforms a <FRAME> (xml object) into a frame. | |
int | getFrameByName (char *name, bool create=false) |
Returns index of frame with the stated name. | |
Public Attributes | |
CKinematicChainContainer | kinematicChains |
Kinematic model. | |
CFrame * | frames [FRAMES_COUNT] |
All frames associated with the kinematic and geometric model. | |
int | framesCount |
Number of frames. | |
int | id |
Robot type. | |
CGeometry | geometry |
Geometric model. |
CRobot::CRobot | ( | ) |
CRobot::~CRobot | ( | ) |
void CRobot::init | ( | char * | filename | ) |
Initializes the robot.
void CRobot::cleanUp | ( | ) |
void CRobot::initDhParameters | ( | char * | filename | ) |
Reads kinematic model data from xml file.
Loads frames and kinematic chains.
void CRobot::updateDhParameters | ( | bool | current = true |
) |
Reads current angles from the robot wrapper and updates the denavit hartenberg parameters.
current | True, if current angles of the servo motors should be used. False, if target angles should be used |
void CRobot::getAnglesFromDh | ( | float * | angles | ) |
Extracts angles from denavit hartenberg parameters.
void CRobot::setDhFromAngles | ( | float * | angles | ) |
Updates denavit hartenberg parameters with array of angles.
void CRobot::calcForwardKinematics | ( | bool | draw = true |
) |
Calculates forward kinematics based on denavit hartenberg parameters.
draw | True, if the new robot pose should be visualized in the opengl-viewer |
void CRobot::calcInverseKinematics | ( | int | kinematicChain, | |
CMatrix & | pose | |||
) |
Calculates inverse kinematics.
The result of the inverse kinematics calculation is stored in the denavit hartenberg structures of the links in the kinematic chain. Use getAnglesFromDh to extract the angle values.
kinematicChain | Index of kinematic chain | |
pose | Pose the last link in the kinematic chain should take on |
void CRobot::calcDynamics | ( | float * | angles, | |
float * | angles_v, | |||
float * | angles_a, | |||
int | view, | |||
float * | result | |||
) |
Calculates dynamic behaviour of robot.
TODO: implement
angles | Current angles | |
angles_v | Current angle speed | |
angles_a | Current angle acceleration |
void CRobot::estimateInverseKinematics | ( | int | kinematicChain, | |
CMatrix & | pose | |||
) |
Numerical estimation of the inverse kinematics.
DOES NOT WORK PROPERLY!
void CRobot::getTCPs | ( | CVec * | positionAndOrientation | ) |
Generates an array of Position and Orientation vectors.
The position (xzy) and orientation (euler angles) of every limb will be stored in the array. Used to display the limb information on the screen.
positionAndOrientation | Has to be allocated of size kinematicChains::length * 2 |
int CRobot::checkCollisions | ( | bool | msg = true , |
|
bool | useOld = false | |||
) |
Starts collision test.
msg | Show collision messages | |
useOld | Only show collision message if the robot pose changed (a bit) |
int CRobot::checkCollisions | ( | int & | first, | |
int & | second | |||
) |
bool CRobot::xmlToFrame | ( | CFrame * | frame, | |
TiXmlElement * | frameNode | |||
) |
Transforms a <FRAME> (xml object) into a frame.
int CRobot::getFrameByName | ( | char * | name, | |
bool | create = false | |||
) |
Returns index of frame with the stated name.
Kinematic model.
CFrame* CRobot::frames[FRAMES_COUNT] |
All frames associated with the kinematic and geometric model.
Number of frames.
int CRobot::id |
Geometric model.