Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Diff: main.cpp
- Revision:
- 118:2b6dab10b69d
- Parent:
- 115:6c1bce07768d
- Child:
- 119:ad7a6af6fba3
--- a/main.cpp Sun Apr 23 07:17:48 2017 +0000 +++ b/main.cpp Mon Apr 24 01:51:16 2017 +0000 @@ -8,6 +8,7 @@ #include "Transforms.h" #include "DQMapper.h" #include "ThrottleMapper.h" +#include "Calibration.h" #include "BREMSStructs.h" #include "BREMSConfig.h" @@ -48,7 +49,7 @@ read.w = update_filter(read.w, w_raw, W_FILTER_STRENGTH); } -void commutate() { +void commutate() { /*safety checks, do we do anything this cycle?*/ if (!control_enabled && io.throttle_in->get_enabled() && io.pos->IsValid() && is_driving()) { go_enabled(); @@ -182,6 +183,13 @@ th = new NullThrottleMapper(); BREMSInit(&io, &read, &foc, &control, false); + /* + for (;;) { + float x = io.throttle_in->get_throttle(); + if (x > 0.5f) calibrate_position(&io); + } + */ + for (;;) { if (ENABLE_LOGGING) { log();