KatanaNativeInterface
$VERSION$
|
Go to the documentation of this file.
255 const bool GetFreedom() {
return freedom; }
const bool GetBlocked() {
return blocked; }
const bool GetNmp() {
return nmp; }
270 void sendAPS(
const TMotAPS* _aps);
void sendTPS(
const TMotTPS* _tps);
void sendSCP(
const TMotSCP* _scp);
void sendDYL(
const TMotDYL* _dyl);
279 void recvPVP();
void recvSCP();
void recvDYL();
void recvSFW();
304 void setInitialParameters(
double angleOffset,
double angleRange,
int encodersPerCycle,
int encoderOffset,
int rotationDirection);
317 void inc(
int dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
320 void dec(
int dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
323 void mov(
int tar,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
347 void sendSpline(
short targetPosition,
short duration,
short p1,
short p2,
short p3,
short p4);
353 void sendFourSplines(
short targetPosition,
short duration, std::vector<short>& coefficients);
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.
TMotTPS tps
target position
byte maxppwm_nmp
Max. value for positive voltage (0 => 0%, +70 => 100%)
byte kP
prop. factor of pos comp
void setControllerParameters(byte kSpeed, byte kPos, byte kI)
Set the controller parameters.
void decDegrees(double dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS)
Decrements the motor specified by an index postion in degrees.
byte maxcurr_nmp
set the maximal current
@ MCF_OFF
set the motor off
TMotENL _encoderLimits
motor limits in encoder values
byte kD
derivate factor of pos comp
void waitForMotor(int tar, int encTolerance=100, short mode=0, int waitTimeout=TM_ENDLESS)
Waits until the Motor has reached the given targen position.
byte kD_speed
Derivative factor of the speed compensator.
void setDYL(TMotDYL _dyl)
TMotGNL gnl
motor generals
TMotDesc * desc
description[]
@ MCF_FREEZE
freeze the motor
const int GetEncoderTolerance()
void setPwmLimits(byte maxppwm, byte maxnpwm)
Set the PWM limits.
@ MSF_NORMOPSTAT
trying to follow target
int enc_minpos
motor's minimum position in encoder values
byte revision
firmware revision number
TMotCmdFlg mcf
motor flag after calibration
@ MSF_DESPOS
in desired position
void setTolerance(int tolerance)
byte subversion
firmware subversion number
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.
CMotBase * arr
array of motors
void getParameterOrLimit(int subcommand, byte *R1, byte *R2, byte *R3)
Get parameters or limits.
byte maxdecel
max deceleration
byte kspeed_nmp
Proportional factor of speed compensator.
Initial motor parameters.
@ MSF_MECHSTOP
mechanical stopper reached
int enc_maxpos
motor's maximum position in encoder values
[SCP] static controller parameters
TMotSFW sfw
slave firmware
#define TM_ENDLESS
timeout symbol for 'endless' waiting
bool enable
enable/disable
byte pwm
pulse with modulation
short maxnspeed
max. allowed reverse speed; pos!
short maxpspeed
max. allowed forward speed
byte maxaccel_nmp
Maximal acceleration and deceleration.
bool nmp
true if new motor parameters are implemented on the firmware
Calibration structure for single motors.
void setCalibrated(bool calibrated)
void setCrashLimitLinear(int limit_lin)
Set the crash limit linear.
@ MSF_MINPOS
min. position was reached
TMotCmdFlg mcfTPS
motor command flag
bool blocked
true if the motor was blocked due to a crash of the robot
void setCrashLimit(int limit)
Set the crash limit.
TMotStsFlg msf
motor status flag
CCplBase * protocol
protocol interface
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.
@ MSF_NLINMOV
non-linear movement ended
short maxpspeed_nmp
Max. allowed forward speed.
int crash_limit_lin_nmp
Limit of error in position in linear movement.
void setPositionCollisionLimit(int limit)
Set the collision limit.
[ENL] limits in encoder values (INTERNAL STRUCTURE!)
int enc_range
motor's range in encoder values
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 setTPSPDegrees(double tar)
const int GetEncoderMaxPos()
Returns the max Position of the Encoder.
bool freedom
if it is set, it will move on a parallel movement
@ MSF_LINMOV
linear movement ended
void setTPSP(int tar)
parallel movement
byte actcurr
actual current
void setSpeedLimit(short velocity)
TMotSCP scp
static controller parameters
short minpos
not yet active
byte maxnpwm
max. val for neg. voltage; pos!
byte subtype
firmware subtype
const int GetEncoderRange()
Returns Encoder Range of the Encoder.
const TMotInit * GetInitialParameters()
byte maxaccel
max acceleration
TKatGNL gnl
katana general
TMotCLB _calibrationParameters
calibration structure
void setAccelerationLimit(short acceleration)
Set the acceleration limits.
void resetBlocked()
unblock the motor.
byte kP_speed
Proportional factor of the speed compensator.
byte version
firmware version number
bool checkAngleInRange(double angle)
check limits in encoder values
int enc_per_cycle
number of encoder units needed to complete 360 degrees;
void setCalibrationParameters(bool doCalibration, short order, TSearchDir direction, TMotCmdFlg motorFlagAfter, int encoderPositionAfter)
void setSCP(TMotSCP _scp)
TMotAPS aps
actual position
@ MSF_MAXPOS
max. position was reached
@ DIR_POSITIVE
search direction for the meachanical stopper
TSearchDir dir
search direction for mech. stopper
byte kI_nmp
Integral factor (1/kI) of control output added to the final control output.
byte kpos_nmp
Proportional factor of position compensator.
Abstract base class for protocol definiton.
short maxnspeed_nmp
Max. allowed reverse speed.
bool init(CKatBase *_own, const TMotDesc _motDesc, CCplBase *protocol)
const int GetEncoderMinPos()
Returns the min Position of the Encoder.
[MOT] every motor's attributes
void sendFourSplines(short targetPosition, short duration, std::vector< short > &coefficients)
Send four splines to the motor.
CKatBase * own
parent robot
short tarpos
target position
TMotDYL dyl
dynamic limits
TMotCmdFlg mcfAPS
motor command flag
CCplBase * protocol
protocol interface
[PVP] position, velocity, pulse width modulation
void incDegrees(double dif, bool wait=false, int tolerance=100, long timeout=TM_ENDLESS)
Increments the motor specified by an index postion in degrees.
motor description (partly)
void setInitialParameters(double angleOffset, double angleRange, int encodersPerCycle, int encoderOffset, int rotationDirection)
int crash_limit_nmp
Limit of error in position.
@ MSF_NOTVALID
motor data not valid
TMotPVP pvp
reading motor parameters
int enc_tolerance
encoder units of tolerance to accept that a position has been reached
byte maxnpwm_nmp
Max. value for negative voltage (0 => 0%, +70 => 100%)
short actpos
actual position
void setSpeedCollisionLimit(int limit)
Set the collision limit.
bool checkEncoderInRange(int encoder)
byte maxppwm
max. val for pos. voltage
void sendSpline(short targetPosition, short duration, short p1, short p2, short p3, short p4)
Send one spline to the motor.
@ MSF_MOTCRASHED
motor has crashed
void setSpeedLimits(short positiveVelocity, short negativeVelocity)
Set speed limits.
byte kI_speed
Integral factor of the speed compensator.
TMotInit _initialParameters
short order
order in which this motor will be calibrated. range: 0..5