KatanaNativeInterface
$VERSION$
|
Go to the documentation of this file.
252 const int GetEncoderMinPos() {
return _encoderLimits.
enc_minpos; }
253 const int GetEncoderMaxPos() {
return _encoderLimits.
enc_maxpos; }
254 const int GetEncoderRange() {
return _encoderLimits.
enc_range; }
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();
296 void setTPSP(
int tar);
297 void setTPSPDegrees(
double tar);
void resetTPSP();
304 void setInitialParameters(
double angleOffset,
double angleRange,
int encodersPerCycle,
int encoderOffset,
int rotationDirection);
305 void setCalibrationParameters(
bool doCalibration,
short order,
TSearchDir direction,
TMotCmdFlg motorFlagAfter,
int encoderPositionAfter);
306 void setCalibrated(
bool calibrated);
308 void setTolerance(
int tolerance);
312 bool checkAngleInRange(
double angle);
313 bool checkEncoderInRange(
int encoder);
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);
327 void waitForMotor(
int tar,
int encTolerance = 100,
short mode = 0,
int waitTimeout =
TM_ENDLESS);
331 void incDegrees(
double dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
334 void decDegrees(
double dif,
bool wait =
false,
int tolerance = 100,
long timeout =
TM_ENDLESS);
337 void movDegrees(
double 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);
358 void setSpeedLimits(
short positiveVelocity,
short negativeVelocity);
363 void setAccelerationLimit(
short acceleration );
367 void setPwmLimits(
byte maxppwm,
byte maxnpwm);
371 void setControllerParameters(
byte kSpeed,
byte kPos,
byte kI);
377 void setCrashLimitLinear(
int limit_lin);
389 void getParameterOrLimit(
int subcommand,
byte* R1,
byte* R2,
byte* R3);
TMotTPS tps
target position
byte maxppwm_nmp
Max. value for positive voltage (0 => 0%, +70 => 100%)
byte kP
prop. factor of pos comp
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
byte kD_speed
Derivative factor of the speed compensator.
void setDYL(TMotDYL _dyl)
TMotGNL gnl
motor generals
TMotDesc * desc
description[]
virtual bool init(const TKatGNL _gnl, const TKatMOT _mot, const TKatSCT _sct, const TKatEFF _eff, CCplBase *_protocol)
@ MCF_FREEZE
freeze the motor
const int GetEncoderTolerance()
@ 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
byte subversion
firmware subversion number
CMotBase * arr
array of motors
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.
void setSpeedCollisionLimit(long idx, int limit)
set collision speed limits
bool nmp
true if new motor parameters are implemented on the firmware
Calibration structure for single motors.
@ 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
TMotStsFlg msf
motor status flag
CCplBase * protocol
protocol interface
@ 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.
[ENL] limits in encoder values (INTERNAL STRUCTURE!)
int enc_range
motor's range in encoder values
void setCrashLimit(long idx, int limit)
set collision limits
bool freedom
if it is set, it will move on a parallel movement
@ MSF_LINMOV
linear movement ended
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 TMotInit * GetInitialParameters()
byte maxaccel
max acceleration
TKatGNL gnl
katana general
TMotCLB _calibrationParameters
calibration structure
byte kP_speed
Proportional factor of the speed compensator.
byte version
firmware version number
int enc_per_cycle
number of encoder units needed to complete 360 degrees;
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.
void setPositionCollisionLimit(long idx, int limit)
set collision position limits
[MOT] every motor's attributes
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
motor description (partly)
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
byte maxppwm
max. val for pos. voltage
@ MSF_MOTCRASHED
motor has crashed
byte kI_speed
Integral factor of the speed compensator.
TMotInit _initialParameters
short order
order in which this motor will be calibrated. range: 0..5