KatanaNativeInterface
$VERSION$
|
Motor class. More...
#include <kmlMotBase.h>
Public Member Functions | |
const TMotGNL * | GetGNL () |
const TMotAPS * | GetAPS () |
const TMotTPS * | GetTPS () |
const TMotSCP * | GetSCP () |
const TMotDYL * | GetDYL () |
const TMotPVP * | GetPVP () |
const TMotSFW * | GetSFW () |
const TMotCLB * | GetCLB () |
const TMotInit * | GetInitialParameters () |
const int | GetEncoderTolerance () |
const int | GetEncoderMinPos () |
Returns the min Position of the Encoder. More... | |
const int | GetEncoderMaxPos () |
Returns the max Position of the Encoder. More... | |
const int | GetEncoderRange () |
Returns Encoder Range of the Encoder. More... | |
const bool | GetFreedom () |
Get the value of the freedom property. More... | |
const bool | GetBlocked () |
Get the value of the blocked property. More... | |
const bool | GetNmp () |
Get the value of the nmp property. More... | |
virtual | ~CMotBase () |
bool | init (CKatBase *_own, const TMotDesc _motDesc, CCplBase *protocol) |
void | sendAPS (const TMotAPS *_aps) |
send data More... | |
void | sendTPS (const TMotTPS *_tps) |
send data More... | |
void | sendSCP (const TMotSCP *_scp) |
send data More... | |
void | sendDYL (const TMotDYL *_dyl) |
send data More... | |
void | recvPVP () |
receive data More... | |
void | recvSCP () |
receive data More... | |
void | recvDYL () |
receive data More... | |
void | recvSFW () |
receive data More... | |
void | setSCP (TMotSCP _scp) |
void | setDYL (TMotDYL _dyl) |
void | setTPSP (int tar) |
parallel movement More... | |
void | setTPSPDegrees (double tar) |
void | resetTPSP () |
parallel movement More... | |
void | setInitialParameters (double angleOffset, double angleRange, int encodersPerCycle, int encoderOffset, int rotationDirection) |
void | setCalibrationParameters (bool doCalibration, short order, TSearchDir direction, TMotCmdFlg motorFlagAfter, int encoderPositionAfter) |
void | setCalibrated (bool calibrated) |
void | setTolerance (int tolerance) |
bool | checkAngleInRange (double angle) |
check limits in encoder values More... | |
bool | checkEncoderInRange (int encoder) |
void | inc (int dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS) |
Increments the motor specified by an index postion in encoder units. More... | |
void | dec (int dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS) |
Decrements the motor specified by an index postion in encoder units. More... | |
void | mov (int tar, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS) |
Moves the motor specified by an index to a given target position in encoder units. More... | |
void | waitForMotor (int tar, int encTolerance=100, short mode=0, int waitTimeout=TM_ENDLESS) |
Waits until the Motor has reached the given targen position. More... | |
void | incDegrees (double dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS) |
Increments the motor specified by an index postion in degrees. More... | |
void | decDegrees (double dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS) |
Decrements the motor specified by an index postion in degrees. More... | |
void | movDegrees (double tar, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS) |
Moves the motor specified by an index to a given target position in degrees. More... | |
void | resetBlocked () |
unblock the motor. More... | |
void | sendSpline (short targetPosition, short duration, short p1, short p2, short p3, short p4) |
Send one spline to the motor. More... | |
void | sendFourSplines (short targetPosition, short duration, std::vector< short > &coefficients) |
Send four splines to the motor. More... | |
void | setSpeedLimits (short positiveVelocity, short negativeVelocity) |
Set speed limits. More... | |
void | setSpeedLimit (short velocity) |
void | setAccelerationLimit (short acceleration) |
Set the acceleration limits More... | |
void | setPwmLimits (byte maxppwm, byte maxnpwm) |
Set the PWM limits More... | |
void | setControllerParameters (byte kSpeed, byte kPos, byte kI) |
Set the controller parameters More... | |
void | setCrashLimit (int limit) |
Set the crash limit More... | |
void | setCrashLimitLinear (int limit_lin) |
Set the crash limit linear. More... | |
void | setSpeedCollisionLimit (int limit) |
Set the collision limit. More... | |
void | setPositionCollisionLimit (int limit) |
Set the collision limit. More... | |
void | getParameterOrLimit (int subcommand, byte *R1, byte *R2, byte *R3) |
Get parameters or limits. More... | |
Protected Attributes | |
TMotGNL | gnl |
motor generals More... | |
TMotAPS | aps |
actual position More... | |
TMotTPS | tps |
target position More... | |
TMotSCP | scp |
static controller parameters More... | |
TMotDYL | dyl |
dynamic limits More... | |
TMotPVP | pvp |
reading motor parameters More... | |
TMotSFW | sfw |
slave firmware More... | |
TMotCLB | _calibrationParameters |
calibration structure More... | |
TMotENL | _encoderLimits |
motor limits in encoder values More... | |
TMotInit | _initialParameters |
bool | freedom |
if it is set, it will move on a parallel movement More... | |
bool | nmp |
true if new motor parameters are implemented on the firmware More... | |
bool | blocked |
true if the motor was blocked due to a crash of the robot More... | |
CCplBase * | protocol |
protocol interface More... | |
Friends | |
class | CKatBase |
Motor class.
This class allows to control one motor; to control a motor it has to be initialized by using the init function. And the usage the internal allocated resources should be deallocated by using the 'free' method.
Definition at line 219 of file kmlMotBase.h.
|
inlinevirtual |
Definition at line 267 of file kmlMotBase.h.
bool CMotBase::checkAngleInRange | ( | double | angle | ) |
check limits in encoder values
bool CMotBase::checkEncoderInRange | ( | int | encoder | ) |
void CMotBase::dec | ( | int | dif, |
bool | wait = false , |
||
int | tolerance = 100 , |
||
long | timeout = TM_ENDLESS |
||
) |
Decrements the motor specified by an index postion in encoder units.
void CMotBase::decDegrees | ( | double | dif, |
bool | wait = false , |
||
int | tolerance = 100 , |
||
long | timeout = TM_ENDLESS |
||
) |
Decrements the motor specified by an index postion in degrees.
|
inline |
Definition at line 242 of file kmlMotBase.h.
|
inline |
Get the value of the blocked property.
Definition at line 259 of file kmlMotBase.h.
|
inline |
Definition at line 248 of file kmlMotBase.h.
|
inline |
Definition at line 245 of file kmlMotBase.h.
|
inline |
Returns the max Position of the Encoder.
Definition at line 253 of file kmlMotBase.h.
References TMotENL::enc_maxpos.
|
inline |
Returns the min Position of the Encoder.
Definition at line 252 of file kmlMotBase.h.
References TMotENL::enc_minpos.
|
inline |
Returns Encoder Range of the Encoder.
Definition at line 254 of file kmlMotBase.h.
References TMotENL::enc_range.
|
inline |
Definition at line 251 of file kmlMotBase.h.
References TMotENL::enc_tolerance.
|
inline |
Get the value of the freedom property.
Definition at line 257 of file kmlMotBase.h.
|
inline |
Definition at line 241 of file kmlMotBase.h.
References CKatBase::gnl.
|
inline |
Definition at line 250 of file kmlMotBase.h.
|
inline |
Get the value of the nmp property.
Definition at line 261 of file kmlMotBase.h.
Get parameters or limits.
subcommand | 255-249;245, see katana user manual chapter 8 firmware commands for details |
R1 | pointer to store first byte of answer |
R2 | pointer to store second byte of answer |
R3 | pointer to store third byte of answer |
|
inline |
Definition at line 246 of file kmlMotBase.h.
|
inline |
Definition at line 244 of file kmlMotBase.h.
|
inline |
Definition at line 247 of file kmlMotBase.h.
|
inline |
Definition at line 243 of file kmlMotBase.h.
void CMotBase::inc | ( | int | dif, |
bool | wait = false , |
||
int | tolerance = 100 , |
||
long | timeout = TM_ENDLESS |
||
) |
Increments the motor specified by an index postion in encoder units.
void CMotBase::incDegrees | ( | double | dif, |
bool | wait = false , |
||
int | tolerance = 100 , |
||
long | timeout = TM_ENDLESS |
||
) |
Increments the motor specified by an index postion in degrees.
void CMotBase::mov | ( | int | tar, |
bool | wait = false , |
||
int | tolerance = 100 , |
||
long | timeout = TM_ENDLESS |
||
) |
Moves the motor specified by an index to a given target position in encoder units.
void CMotBase::movDegrees | ( | double | tar, |
bool | wait = false , |
||
int | tolerance = 100 , |
||
long | timeout = TM_ENDLESS |
||
) |
Moves the motor specified by an index to a given target position in degrees.
void CMotBase::recvDYL | ( | ) |
receive data
void CMotBase::recvPVP | ( | ) |
receive data
void CMotBase::recvSCP | ( | ) |
receive data
void CMotBase::recvSFW | ( | ) |
receive data
void CMotBase::resetBlocked | ( | ) |
unblock the motor.
void CMotBase::resetTPSP | ( | ) |
parallel movement
deprecated: for use with old Katana5M only
void CMotBase::sendAPS | ( | const TMotAPS * | _aps | ) |
send data
void CMotBase::sendDYL | ( | const TMotDYL * | _dyl | ) |
send data
void CMotBase::sendFourSplines | ( | short | targetPosition, |
short | duration, | ||
std::vector< short > & | coefficients | ||
) |
Send four splines to the motor.
duration | Duration has to be given in 10ms units |
coefficients | 4x4 coefficients have to be passed or the function will cause an assertion. |
void CMotBase::sendSCP | ( | const TMotSCP * | _scp | ) |
send data
void CMotBase::sendSpline | ( | short | targetPosition, |
short | duration, | ||
short | p1, | ||
short | p2, | ||
short | p3, | ||
short | p4 | ||
) |
Send one spline to the motor.
duration | Duration has to be given in 10ms units |
void CMotBase::sendTPS | ( | const TMotTPS * | _tps | ) |
send data
void CMotBase::setAccelerationLimit | ( | short | acceleration | ) |
Set the acceleration limits
void CMotBase::setCalibrated | ( | bool | calibrated | ) |
void CMotBase::setCalibrationParameters | ( | bool | doCalibration, |
short | order, | ||
TSearchDir | direction, | ||
TMotCmdFlg | motorFlagAfter, | ||
int | encoderPositionAfter | ||
) |
Set the controller parameters
void CMotBase::setCrashLimit | ( | int | limit | ) |
Set the crash limit
void CMotBase::setCrashLimitLinear | ( | int | limit_lin | ) |
Set the crash limit linear.
|
inline |
Definition at line 290 of file kmlMotBase.h.
void CMotBase::setInitialParameters | ( | double | angleOffset, |
double | angleRange, | ||
int | encodersPerCycle, | ||
int | encoderOffset, | ||
int | rotationDirection | ||
) |
void CMotBase::setPositionCollisionLimit | ( | int | limit | ) |
Set the collision limit.
|
inline |
Definition at line 289 of file kmlMotBase.h.
void CMotBase::setSpeedCollisionLimit | ( | int | limit | ) |
Set the collision limit.
|
inline |
Definition at line 359 of file kmlMotBase.h.
void CMotBase::setSpeedLimits | ( | short | positiveVelocity, |
short | negativeVelocity | ||
) |
Set speed limits.
void CMotBase::setTolerance | ( | int | tolerance | ) |
void CMotBase::setTPSP | ( | int | tar | ) |
parallel movement
deprecated: for use with old Katana5M only
void CMotBase::setTPSPDegrees | ( | double | tar | ) |
void CMotBase::waitForMotor | ( | int | tar, |
int | encTolerance = 100 , |
||
short | mode = 0 , |
||
int | waitTimeout = TM_ENDLESS |
||
) |
Waits until the Motor has reached the given targen position.
|
friend |
Definition at line 221 of file kmlMotBase.h.
|
protected |
calibration structure
Definition at line 232 of file kmlMotBase.h.
|
protected |
motor limits in encoder values
Definition at line 233 of file kmlMotBase.h.
|
protected |
Definition at line 234 of file kmlMotBase.h.
|
protected |
actual position
Definition at line 226 of file kmlMotBase.h.
|
protected |
true if the motor was blocked due to a crash of the robot
Definition at line 237 of file kmlMotBase.h.
|
protected |
dynamic limits
Definition at line 229 of file kmlMotBase.h.
|
protected |
if it is set, it will move on a parallel movement
Definition at line 235 of file kmlMotBase.h.
|
protected |
motor generals
Definition at line 225 of file kmlMotBase.h.
|
protected |
true if new motor parameters are implemented on the firmware
Definition at line 236 of file kmlMotBase.h.
|
protected |
protocol interface
Definition at line 264 of file kmlMotBase.h.
|
protected |
reading motor parameters
Definition at line 230 of file kmlMotBase.h.
|
protected |
static controller parameters
Definition at line 228 of file kmlMotBase.h.
|
protected |
slave firmware
Definition at line 231 of file kmlMotBase.h.
|
protected |
target position
Definition at line 227 of file kmlMotBase.h.