KatanaNativeInterface
$VERSION$
|
Linear movement Class. More...
#include <lmBase.h>
Public Member Functions | |
CLMBase () | |
void | initLM () |
Initialize the parameters for the linear movements. | |
void | movLM (double X, double Y, double Z, double Al, double Be, double Ga, bool exactflag, double vmax, bool wait=true, int tolerance=100, long timeout=TM_ENDLESS) |
void | movLM2PwithL (double X1, double Y1, double Z1, double Al1, double Be1, double Ga1, double X2, double Y2, double Z2, double Al2, double Be2, double Ga2, bool exactflag, double vmax, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS) |
Old version of movLM2P which uses L-Command (only 4 splines) | |
void | movLM2P4D (double X1, double Y1, double Z1, double Al1, double Be1, double Ga1, double X2, double Y2, double Z2, double Al2, double Be2, double Ga2, bool exactflag, double vmax, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS) |
void | movLM2P (double X1, double Y1, double Z1, double Al1, double Be1, double Ga1, double X2, double Y2, double Z2, double Al2, double Be2, double Ga2, bool exactflag, double vmax, bool wait=true, int tolerance=100, long timeout=TM_ENDLESS) |
New version of movLM2P with multiple splines. | |
void | setMaximumLinearVelocity (double maximumVelocity) |
double | getMaximumLinearVelocity () const |
void | setActivatePositionController (bool activate) |
Re-Activate the position controller after the linear movement. | |
bool | getActivatePositionController () |
Check if the position controller will be activated after the linear movement. | |
void | moveRobotLinearTo (double x, double y, double z, double phi, double theta, double psi, bool waitUntilReached=true, int waitTimeout=TM_ENDLESS) |
void | moveRobotLinearTo (std::vector< double > coordinates, bool waitUntilReached=true, int waitTimeout=TM_ENDLESS) |
This method does the same as the one above and is mainly provided for convenience. | |
Private Member Functions | |
void | fillPoints (double vmax) |
void | polDeviratives () |
void | polCoefficients () |
void | calcParameters (double *arr_actpos, double *arr_tarpos, double vmax) |
double | totalTime (double distance, double acc, double dec, double vmax) |
Calculates time needed for movement over a distance. | |
double | relPosition (double reltime, double distance, double acc, double dec, double vmax) |
Calculates the relative position reached after the relative time given. | |
void | splineCoefficients (int steps, double *timearray, double *encoderarray, double *arr_p1, double *arr_p2, double *arr_p3, double *arr_p4) |
Calculates the spline coefficient and stores them in arr_p1 - arr_p4. | |
bool | checkJointSpeed (std::vector< int > lastsolution, std::vector< int > solution, double time) |
Checks if the joint speeds are below speed limit. | |
Private Attributes | |
double | _maximumVelocity |
bool | _activatePositionController |
bool | _isInitialized |
TLMtrajectory | trajectory |
TBLENDtrajectory | blendtrajectory |
Linear movement Class.
This class allows to do linear movements with the Katana robot.
CLMBase::CLMBase | ( | ) | [inline] |
void CLMBase::calcParameters | ( | double * | arr_actpos, |
double * | arr_tarpos, | ||
double | vmax | ||
) | [private] |
bool CLMBase::checkJointSpeed | ( | std::vector< int > | lastsolution, |
std::vector< int > | solution, | ||
double | time | ||
) | [private] |
Checks if the joint speeds are below speed limit.
Maximum joint speed is 180enc / 10ms.
lastsolution | encoder values of last point |
solution | encoder values of current point |
time | time difference between the points in s |
void CLMBase::fillPoints | ( | double | vmax | ) | [private] |
Check if the position controller will be activated after the linear movement.
double CLMBase::getMaximumLinearVelocity | ( | ) | const |
void CLMBase::initLM | ( | ) |
Initialize the parameters for the linear movements.
This is in the case you want to initialize it manually
void CLMBase::moveRobotLinearTo | ( | double | x, |
double | y, | ||
double | z, | ||
double | phi, | ||
double | theta, | ||
double | psi, | ||
bool | waitUntilReached = true , |
||
int | waitTimeout = TM_ENDLESS |
||
) |
waitUntilReached | has to be true with new implementation of movLM2P |
void CLMBase::moveRobotLinearTo | ( | std::vector< double > | coordinates, |
bool | waitUntilReached = true , |
||
int | waitTimeout = TM_ENDLESS |
||
) |
This method does the same as the one above and is mainly provided for convenience.
void CLMBase::movLM | ( | double | X, |
double | Y, | ||
double | Z, | ||
double | Al, | ||
double | Be, | ||
double | Ga, | ||
bool | exactflag, | ||
double | vmax, | ||
bool | wait = true , |
||
int | tolerance = 100 , |
||
long | timeout = TM_ENDLESS |
||
) |
wait | has to be true with new implementation of movLM2P |
void CLMBase::movLM2P | ( | double | X1, |
double | Y1, | ||
double | Z1, | ||
double | Al1, | ||
double | Be1, | ||
double | Ga1, | ||
double | X2, | ||
double | Y2, | ||
double | Z2, | ||
double | Al2, | ||
double | Be2, | ||
double | Ga2, | ||
bool | exactflag, | ||
double | vmax, | ||
bool | wait = true , |
||
int | tolerance = 100 , |
||
long | timeout = TM_ENDLESS |
||
) |
New version of movLM2P with multiple splines.
X1 | X coordinate of actual position |
Y1 | Y coordinate of actual position |
Z1 | Z coordinate of actual position |
Ph1 | Phi angle of actual position |
Th1 | Theta angle of actual position |
Ps1 | Psi angle of actual position |
X2 | X coordinate of target position |
Y2 | Y coordinate of target position |
Z2 | Z coordinate of target position |
Ph2 | Phi angle of target position |
Th2 | Theta angle of target position |
Ps2 | Psi angle of target position |
exactflag | activate the position controller after the movement |
vmax | maximum velocity of the movement in mm/s |
wait | param for legacy reasons only, has to be true |
tolerance | tolerance for all motor encoders |
timeout | timeout for linear movement in ms |
NoSolutionException | if no solution found for IK |
JointSpeedException | if joint speed too high |
WaitParameterException | if wait set to false |
void CLMBase::movLM2P4D | ( | double | X1, |
double | Y1, | ||
double | Z1, | ||
double | Al1, | ||
double | Be1, | ||
double | Ga1, | ||
double | X2, | ||
double | Y2, | ||
double | Z2, | ||
double | Al2, | ||
double | Be2, | ||
double | Ga2, | ||
bool | exactflag, | ||
double | vmax, | ||
bool | wait = false , |
||
int | tolerance = 100 , |
||
long | timeout = TM_ENDLESS |
||
) |
void CLMBase::movLM2PwithL | ( | double | X1, |
double | Y1, | ||
double | Z1, | ||
double | Al1, | ||
double | Be1, | ||
double | Ga1, | ||
double | X2, | ||
double | Y2, | ||
double | Z2, | ||
double | Al2, | ||
double | Be2, | ||
double | Ga2, | ||
bool | exactflag, | ||
double | vmax, | ||
bool | wait = false , |
||
int | tolerance = 100 , |
||
long | timeout = TM_ENDLESS |
||
) |
Old version of movLM2P which uses L-Command (only 4 splines)
void CLMBase::polCoefficients | ( | ) | [private] |
void CLMBase::polDeviratives | ( | ) | [private] |
double CLMBase::relPosition | ( | double | reltime, |
double | distance, | ||
double | acc, | ||
double | dec, | ||
double | vmax | ||
) | [private] |
Calculates the relative position reached after the relative time given.
reltime | relative time (fraction of totaltime) |
distance | distance of the movement in mm |
acc | acceleration at the beginning in mm/s^2 |
dec | deceleration at the end in mm/s^2 |
vmax | maximum velocity of the movement in mm/s |
void CLMBase::setActivatePositionController | ( | bool | activate | ) |
Re-Activate the position controller after the linear movement.
void CLMBase::setMaximumLinearVelocity | ( | double | maximumVelocity | ) |
void CLMBase::splineCoefficients | ( | int | steps, |
double * | timearray, | ||
double * | encoderarray, | ||
double * | arr_p1, | ||
double * | arr_p2, | ||
double * | arr_p3, | ||
double * | arr_p4 | ||
) | [private] |
Calculates the spline coefficient and stores them in arr_p1 - arr_p4.
Boundary conditions are that f_1'=0 and f_n'=0 (zero velocity at beginning and end of the movement) and f_i''=P_(i+1)''.
steps | number of splines to calculate |
timearray | times of the points (length = steps + 1) |
encoderarray | encoder values of the points (length = steps + 1) |
arr_p1 | to return parameters 1 (length = steps) |
arr_p2 | to return parameters 2 (length = steps) |
arr_p3 | to return parameters 3 (length = steps) |
arr_p4 | to return parameters 4 (length = steps) |
double CLMBase::totalTime | ( | double | distance, |
double | acc, | ||
double | dec, | ||
double | vmax | ||
) | [private] |
Calculates time needed for movement over a distance.
distance | distance of the movement in mm |
acc | acceleration at the beginning in mm/s^2 |
dec | deceleration at the end in mm/s^2 |
vmax | maximum velocity of the movement in mm/s |
bool CLMBase::_activatePositionController [private] |
bool CLMBase::_isInitialized [private] |
double CLMBase::_maximumVelocity [private] |
TBLENDtrajectory CLMBase::blendtrajectory [private] |
TLMtrajectory CLMBase::trajectory [private] |