KatanaNativeInterface $VERSION$

CMotBase Class Reference

Motor class. More...

#include <kmlMotBase.h>

Collaboration diagram for CMotBase:

List of all members.

Public Member Functions

const TMotGNLGetGNL ()
const TMotAPSGetAPS ()
const TMotTPSGetTPS ()
const TMotSCPGetSCP ()
const TMotDYLGetDYL ()
const TMotPVPGetPVP ()
const TMotSFWGetSFW ()
const TMotCLBGetCLB ()
const TMotInitGetInitialParameters ()
const int GetEncoderTolerance ()
const int GetEncoderMinPos ()
 Returns the min Position of the Encoder.
const int GetEncoderMaxPos ()
 Returns the max Position of the Encoder.
const int GetEncoderRange ()
 Returns Encoder Range of the Encoder.
const bool GetFreedom ()
 Get the value of the freedom property.
const bool GetBlocked ()
 Get the value of the blocked property.
const bool GetNmp ()
 Get the value of the nmp property.
virtual ~CMotBase ()
bool init (CKatBase *_own, const TMotDesc _motDesc, CCplBase *protocol)
void sendAPS (const TMotAPS *_aps)
 send data
void sendTPS (const TMotTPS *_tps)
 send data
void sendSCP (const TMotSCP *_scp)
 send data
void sendDYL (const TMotDYL *_dyl)
 send data
void recvPVP ()
 receive data
void recvSCP ()
 receive data
void recvDYL ()
 receive data
void recvSFW ()
 receive data
void setSCP (TMotSCP _scp)
void setDYL (TMotDYL _dyl)
void setTPSP (int tar)
 parallel movement
void setTPSPDegrees (double tar)
void resetTPSP ()
 parallel movement
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
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.
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.
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.
void waitForMotor (int tar, int encTolerance=100, short mode=0, int waitTimeout=TM_ENDLESS)
 Waits until the Motor has reached the given targen position.
void incDegrees (double dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS)
 Increments the motor specified by an index postion in degrees.
void decDegrees (double dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS)
 Decrements the motor specified by an index postion in degrees.
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.
void resetBlocked ()
 unblock the motor.
void sendSpline (short targetPosition, short duration, short p1, short p2, short p3, short p4)
 Send one spline to the motor.
void sendFourSplines (short targetPosition, short duration, std::vector< short > &coefficients)
 Send four splines to the motor.
void setSpeedLimits (short positiveVelocity, short negativeVelocity)
void setSpeedLimit (short velocity)
void setAccelerationLimit (short acceleration)
 Set the acceleration limits.
void setPwmLimits (byte maxppwm, byte maxnpwm)
 Set the PWM limits.
void setControllerParameters (byte kSpeed, byte kPos, byte kI)
 Set the controller parameters.
void setCrashLimit (int limit)
 Set the crash limit.
void setCrashLimitLinear (int limit_lin)
 Set the crash limit linear.
void setSpeedCollisionLimit (int limit)
 Set the collision limit.
void setPositionCollisionLimit (int limit)
 Set the collision limit.
void getParameterOrLimit (int subcommand, byte *R1, byte *R2, byte *R3)
 Get parameters or limits.

Protected Attributes

TMotGNL gnl
 motor generals
TMotAPS aps
 actual position
TMotTPS tps
 target position
TMotSCP scp
 static controller parameters
TMotDYL dyl
 dynamic limits
TMotPVP pvp
 reading motor parameters
TMotSFW sfw
 slave firmware
TMotCLB _calibrationParameters
 calibration structure
TMotENL _encoderLimits
 motor limits in encoder values
TMotInit _initialParameters
bool freedom
 if it is set, it will move on a parallel movement
bool nmp
 true if new motor parameters are implemented on the firmware
bool blocked
 true if the motor was blocked due to a crash of the robot
CCplBaseprotocol
 protocol interface

Friends

class CKatBase

Detailed Description

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.


Constructor & Destructor Documentation

virtual CMotBase::~CMotBase ( ) [inline, virtual]

Definition at line 267 of file kmlMotBase.h.


Member Function Documentation

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.

const TMotAPS* CMotBase::GetAPS ( ) [inline]

Definition at line 242 of file kmlMotBase.h.

const bool CMotBase::GetBlocked ( ) [inline]

Get the value of the blocked property.

Definition at line 259 of file kmlMotBase.h.

const TMotCLB* CMotBase::GetCLB ( ) [inline]

Definition at line 248 of file kmlMotBase.h.

const TMotDYL* CMotBase::GetDYL ( ) [inline]

Definition at line 245 of file kmlMotBase.h.

const int CMotBase::GetEncoderMaxPos ( ) [inline]

Returns the max Position of the Encoder.

Definition at line 253 of file kmlMotBase.h.

const int CMotBase::GetEncoderMinPos ( ) [inline]

Returns the min Position of the Encoder.

Definition at line 252 of file kmlMotBase.h.

const int CMotBase::GetEncoderRange ( ) [inline]

Returns Encoder Range of the Encoder.

Definition at line 254 of file kmlMotBase.h.

const int CMotBase::GetEncoderTolerance ( ) [inline]

Definition at line 251 of file kmlMotBase.h.

const bool CMotBase::GetFreedom ( ) [inline]

Get the value of the freedom property.

Definition at line 257 of file kmlMotBase.h.

const TMotGNL* CMotBase::GetGNL ( ) [inline]

Definition at line 241 of file kmlMotBase.h.

References CKatBase::gnl.

const TMotInit* CMotBase::GetInitialParameters ( ) [inline]

Definition at line 250 of file kmlMotBase.h.

const bool CMotBase::GetNmp ( ) [inline]

Get the value of the nmp property.

Definition at line 261 of file kmlMotBase.h.

void CMotBase::getParameterOrLimit ( int  subcommand,
byte R1,
byte R2,
byte R3 
)

Get parameters or limits.

Parameters:
subcommand255-249;245, see katana user manual chapter 8 firmware commands for details
R1pointer to store first byte of answer
R2pointer to store second byte of answer
R3pointer to store third byte of answer
const TMotPVP* CMotBase::GetPVP ( ) [inline]

Definition at line 246 of file kmlMotBase.h.

const TMotSCP* CMotBase::GetSCP ( ) [inline]

Definition at line 244 of file kmlMotBase.h.

const TMotSFW* CMotBase::GetSFW ( ) [inline]

Definition at line 247 of file kmlMotBase.h.

const TMotTPS* CMotBase::GetTPS ( ) [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.

bool CMotBase::init ( CKatBase _own,
const TMotDesc  _motDesc,
CCplBase protocol 
)
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.

Parameters:
durationDuration has to be given in 10ms units
coefficients4x4 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.

Parameters:
durationDuration 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 
)
void CMotBase::setControllerParameters ( byte  kSpeed,
byte  kPos,
byte  kI 
)

Set the controller parameters.

void CMotBase::setCrashLimit ( int  limit)

Set the crash limit.

void CMotBase::setCrashLimitLinear ( int  limit_lin)

Set the crash limit linear.

void CMotBase::setDYL ( TMotDYL  _dyl) [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.

void CMotBase::setPwmLimits ( byte  maxppwm,
byte  maxnpwm 
)

Set the PWM limits.

void CMotBase::setSCP ( TMotSCP  _scp) [inline]

Definition at line 289 of file kmlMotBase.h.

void CMotBase::setSpeedCollisionLimit ( int  limit)

Set the collision limit.

void CMotBase::setSpeedLimit ( short  velocity) [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.


Friends And Related Function Documentation

friend class CKatBase [friend]

Definition at line 221 of file kmlMotBase.h.


Member Data Documentation

calibration structure

Definition at line 232 of file kmlMotBase.h.

motor limits in encoder values

Definition at line 233 of file kmlMotBase.h.

Definition at line 234 of file kmlMotBase.h.

TMotAPS CMotBase::aps [protected]

actual position

Definition at line 226 of file kmlMotBase.h.

bool CMotBase::blocked [protected]

true if the motor was blocked due to a crash of the robot

Definition at line 237 of file kmlMotBase.h.

TMotDYL CMotBase::dyl [protected]

dynamic limits

Definition at line 229 of file kmlMotBase.h.

bool CMotBase::freedom [protected]

if it is set, it will move on a parallel movement

Definition at line 235 of file kmlMotBase.h.

TMotGNL CMotBase::gnl [protected]

motor generals

Definition at line 225 of file kmlMotBase.h.

bool CMotBase::nmp [protected]

true if new motor parameters are implemented on the firmware

Definition at line 236 of file kmlMotBase.h.

protocol interface

Definition at line 264 of file kmlMotBase.h.

TMotPVP CMotBase::pvp [protected]

reading motor parameters

Definition at line 230 of file kmlMotBase.h.

TMotSCP CMotBase::scp [protected]

static controller parameters

Definition at line 228 of file kmlMotBase.h.

TMotSFW CMotBase::sfw [protected]

slave firmware

Definition at line 231 of file kmlMotBase.h.

TMotTPS CMotBase::tps [protected]

target position

Definition at line 227 of file kmlMotBase.h.


The documentation for this class was generated from the following file: