Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Diff: DQMapper/DQMapper.h
- Revision:
- 171:3f1d1792757c
- Parent:
- 160:6948bb7bcabd
- Child:
- 185:5c102874b490
--- a/DQMapper/DQMapper.h Sat Dec 02 19:24:56 2017 +0000 +++ b/DQMapper/DQMapper.h Sun Dec 03 01:28:51 2017 +0000 @@ -1,6 +1,8 @@ #ifndef __DQ_MAPPER_H #define __DQ_MAPPER_H +#include "config_table.h" + class DQMapper { public: virtual void map(float torque_percent, float w, float *d, float *q) = 0; @@ -30,6 +32,16 @@ virtual void map(float torque_percent, float w, float *d, float *q); }; +class InterpolatingLutMapper : public DQMapper { +public: + virtual void map(float torque_percent, float w, float *d, float *q); +private: + static float lookup(short table[][COLUMNS], int row, int col); + static float lookup(short *table, int index); + static float interp(float a, float b, float eps); + static float interp(float a, float b, float c, float eps_row, float eps_col); +}; + class AngleMapper : public DQMapper { public: AngleMapper(float theta, float is) {_theta = theta; _is = is;}