Motor class. More...
#include <kmlMotBase.h>
Public Member Functions | |
bool | checkAngleInRange (double angle) |
check limits in encoder values More... | |
bool | checkEncoderInRange (int encoder) |
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 | decDegrees (double dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS) |
Decrements the motor specified by an index postion in degrees. More... | |
const TMotAPS * | GetAPS () |
bool | GetBlocked () |
Get the value of the blocked property. More... | |
const TMotCLB * | GetCLB () |
const TMotDYL * | GetDYL () |
int | GetEncoderMaxPos () |
Returns the max Position of the Encoder. More... | |
int | GetEncoderMinPos () |
Returns the min Position of the Encoder. More... | |
int | GetEncoderRange () |
Returns Encoder Range of the Encoder. More... | |
int | GetEncoderTolerance () |
bool | GetFreedom () |
Get the value of the freedom property. More... | |
const TMotGNL * | GetGNL () |
const TMotInit * | GetInitialParameters () |
void | getParameterOrLimit (int subcommand, byte *R1, byte *R2, byte *R3) |
const TMotPVP * | GetPVP () |
const TMotSCP * | GetSCP () |
const TMotSFW * | GetSFW () |
const TMotTPS * | GetTPS () |
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 | incDegrees (double dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS) |
Increments the motor specified by an index postion in degrees. More... | |
bool | init (CKatBase *_own, const TMotDesc _motDesc, CCplBase *protocol) |
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 | 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 | recvPVP () |
receive data More... | |
void | recvSFW () |
receive data More... | |
void | resetBlocked () |
unblock the motor. More... | |
void | sendAPS (const TMotAPS *_aps) |
send data More... | |
void | sendSpline (short targetPosition, short duration, short p1, short p2, short p3, short p4) |
void | sendTPS (const TMotTPS *_tps) |
send data More... | |
void | setAccelerationLimit (short acceleration) |
Set the acceleration limits. More... | |
void | setCalibrated (bool calibrated) |
void | setCalibrationParameters (bool doCalibration, short order, TSearchDir direction, TMotCmdFlg motorFlagAfter, int encoderPositionAfter) |
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 | setDYL (TMotDYL _dyl) |
void | setInitialParameters (double angleOffset, double angleRange, int encodersPerCycle, int encoderOffset, int rotationDirection) |
void | setPositionCollisionLimit (int limit) |
Set the collision limit. More... | |
void | setPwmLimits (byte maxppwm, byte maxnpwm) |
Set the PWM limits (for the drive controller) More... | |
void | setSCP (TMotSCP _scp) |
void | setSpeedCollisionLimit (int limit) |
Set the collision limit. More... | |
void | setSpeedLimit (short velocity) |
void | setSpeedLimits (short positiveVelocity, short negativeVelocity) |
Set speed limits. More... | |
void | setTolerance (int tolerance) |
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... | |
virtual | ~CMotBase () |
Protected Attributes | |
TMotCLB | _calibrationParameters |
calibration structure More... | |
TMotENL | _encoderLimits |
motor limits in encoder values More... | |
TMotInit | _initialParameters |
TMotAPS | aps |
actual position More... | |
bool | blocked |
true if the motor was blocked due to a crash of the robot More... | |
TMotDYL | dyl |
dynamic limits More... | |
bool | freedom |
if it is set, it will move on a parallel movement More... | |
TMotGNL | gnl |
motor generals More... | |
CCplBase * | protocol |
protocol interface More... | |
TMotPVP | pvp |
reading motor parameters More... | |
TMotSCP | scp |
static controller parameters More... | |
TMotSFW | sfw |
slave firmware More... | |
TMotTPS | tps |
target position 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 220 of file kmlMotBase.h.
|
inlinevirtual |
Definition at line 265 of file kmlMotBase.h.
bool CMotBase::checkAngleInRange | ( | double | angle | ) |
check limits in encoder values
Definition at line 362 of file kmlMotBase.cpp.
bool CMotBase::checkEncoderInRange | ( | int | encoder | ) |
Definition at line 365 of file kmlMotBase.cpp.
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.
Definition at line 375 of file kmlMotBase.cpp.
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.
Definition at line 434 of file kmlMotBase.cpp.
|
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.
|
inline |
Returns the min Position of the Encoder.
Definition at line 252 of file kmlMotBase.h.
|
inline |
Returns Encoder Range of the Encoder.
Definition at line 254 of file kmlMotBase.h.
|
inline |
Definition at line 251 of file kmlMotBase.h.
|
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.
|
inline |
Definition at line 250 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 |
Definition at line 274 of file kmlMotBase.cpp.
|
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.
Definition at line 370 of file kmlMotBase.cpp.
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.
Definition at line 427 of file kmlMotBase.cpp.
Definition at line 20 of file kmlMotBase.cpp.
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.
Definition at line 380 of file kmlMotBase.cpp.
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.
Definition at line 441 of file kmlMotBase.cpp.
void CMotBase::recvPVP | ( | ) |
receive data
Definition at line 90 of file kmlMotBase.cpp.
void CMotBase::recvSFW | ( | ) |
receive data
Definition at line 109 of file kmlMotBase.cpp.
void CMotBase::resetBlocked | ( | ) |
unblock the motor.
Definition at line 35 of file kmlMotBase.cpp.
void CMotBase::sendAPS | ( | const TMotAPS * | _aps | ) |
send data
Definition at line 53 of file kmlMotBase.cpp.
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 |
Definition at line 299 of file kmlMotBase.cpp.
void CMotBase::sendTPS | ( | const TMotTPS * | _tps | ) |
send data
Definition at line 73 of file kmlMotBase.cpp.
void CMotBase::setAccelerationLimit | ( | short | acceleration | ) |
Set the acceleration limits.
Definition at line 149 of file kmlMotBase.cpp.
void CMotBase::setCalibrated | ( | bool | calibrated | ) |
Definition at line 353 of file kmlMotBase.cpp.
void CMotBase::setCalibrationParameters | ( | bool | doCalibration, |
short | order, | ||
TSearchDir | direction, | ||
TMotCmdFlg | motorFlagAfter, | ||
int | encoderPositionAfter | ||
) |
Definition at line 343 of file kmlMotBase.cpp.
Set the controller parameters.
Definition at line 186 of file kmlMotBase.cpp.
void CMotBase::setCrashLimit | ( | int | limit | ) |
Set the crash limit.
Definition at line 206 of file kmlMotBase.cpp.
void CMotBase::setCrashLimitLinear | ( | int | limit_lin | ) |
Set the crash limit linear.
Definition at line 224 of file kmlMotBase.cpp.
|
inline |
Definition at line 280 of file kmlMotBase.h.
void CMotBase::setInitialParameters | ( | double | angleOffset, |
double | angleRange, | ||
int | encodersPerCycle, | ||
int | encoderOffset, | ||
int | rotationDirection | ||
) |
Definition at line 324 of file kmlMotBase.cpp.
void CMotBase::setPositionCollisionLimit | ( | int | limit | ) |
Set the collision limit.
Definition at line 259 of file kmlMotBase.cpp.
Set the PWM limits (for the drive controller)
Definition at line 165 of file kmlMotBase.cpp.
|
inline |
Definition at line 279 of file kmlMotBase.h.
void CMotBase::setSpeedCollisionLimit | ( | int | limit | ) |
Set the collision limit.
Definition at line 243 of file kmlMotBase.cpp.
|
inline |
Definition at line 331 of file kmlMotBase.h.
void CMotBase::setSpeedLimits | ( | short | positiveVelocity, |
short | negativeVelocity | ||
) |
Set speed limits.
Definition at line 130 of file kmlMotBase.cpp.
void CMotBase::setTolerance | ( | int | tolerance | ) |
Definition at line 358 of file kmlMotBase.cpp.
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.
Definition at line 396 of file kmlMotBase.cpp.
|
friend |
Definition at line 222 of file kmlMotBase.h.
|
protected |
calibration structure
Definition at line 233 of file kmlMotBase.h.
|
protected |
motor limits in encoder values
Definition at line 234 of file kmlMotBase.h.
|
protected |
Definition at line 235 of file kmlMotBase.h.
|
protected |
actual position
Definition at line 227 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 230 of file kmlMotBase.h.
|
protected |
if it is set, it will move on a parallel movement
Definition at line 236 of file kmlMotBase.h.
|
protected |
motor generals
Definition at line 226 of file kmlMotBase.h.
|
protected |
protocol interface
Definition at line 262 of file kmlMotBase.h.
|
protected |
reading motor parameters
Definition at line 231 of file kmlMotBase.h.
|
protected |
static controller parameters
Definition at line 229 of file kmlMotBase.h.
|
protected |
slave firmware
Definition at line 232 of file kmlMotBase.h.
|
protected |
target position
Definition at line 228 of file kmlMotBase.h.