Bayley Wang
/
foc-ed_in_the_bot_compact
robot
Diff: main.cpp
- Revision:
- 28:ed9c1ca386fd
- Parent:
- 27:7e073122ddf8
- Child:
- 29:50e6e4e46580
diff -r 7e073122ddf8 -r ed9c1ca386fd main.cpp --- a/main.cpp Sun Nov 06 04:27:40 2016 +0000 +++ b/main.cpp Mon Nov 07 10:56:01 2016 +0000 @@ -89,8 +89,9 @@ } void commutate() { - if(control_enabled && !throttle_in.get_enabled()) go_disabled(); - if(!control_enabled && throttle_in.get_enabled()) go_enabled(); + if (control_enabled && !throttle_in.get_enabled()) go_disabled(); + if (control_enabled && !pos.IsValid()) go_disabled(); + if (!control_enabled && throttle_in.get_enabled()) go_enabled(); update_velocity();