Bayley Wang
/
foc-ed_in_the_bot_compact
robot
DQMapper/DQMapper.h
- Committer:
- bwang
- Date:
- 2017-04-11
- Revision:
- 98:1051c4103900
- Parent:
- 45:cf8ad81fb0f0
- Child:
- 124:e70ca81676fc
File content as of revision 98:1051c4103900:
#ifndef __DQ_MAPPER_H #define __DQ_MAPPER_H class DQMapper { public: virtual void map(float torque_percent, float w, float *d, float *q) = 0; }; class QOnlyMapper : public DQMapper { public: QOnlyMapper(float kt, float tmax) {_kt = kt; _tmax = tmax;} virtual void map(float torque_percent, float w, float *d, float *q) {*d = 0; *q = torque_percent * _tmax / _kt;} private: float _kt; float _tmax; }; class LinearNoFWMapper : public DQMapper { public: LinearNoFWMapper(float kt, float tmax, float lambda) {_kt = kt; _tmax = tmax; _lambda = lambda;} virtual void map(float torque_percent, float w, float *d, float *q); private: float _kt; float _tmax; float _lambda; }; class LutMapper : public DQMapper { public: virtual void map(float torque_percent, float w, float *d, float *q); }; class AngleMapper : public DQMapper { public: AngleMapper(float theta, float is) {_theta = theta; _is = is;} virtual void map(float torque_percent, float w, float *d, float *q); private: float _is; float _theta; }; #endif