![](/media/cache/img/default_profile.jpg.50x50_q85.jpg)
bio robot
Dependencies: MPU6050-DMP QEI_hw mbed-rpc mbed
Fork of MPU6050_Example by
Diff: Comm/Comm.cpp
- Revision:
- 17:8a0e647cf551
- Parent:
- 14:d620415259b1
- Child:
- 19:270735e44c98
diff -r 5b19be27f08a -r 8a0e647cf551 Comm/Comm.cpp --- a/Comm/Comm.cpp Thu Dec 10 10:55:35 2015 +0000 +++ b/Comm/Comm.cpp Fri Dec 11 00:44:45 2015 +0000 @@ -56,6 +56,28 @@ _controls->setSwingUpD(d); printGains(); } + + +void Comm::setTargetingK(Arguments* input, Reply* output){ + if (input->argc < 1){ + throwNotEnoughArgsError(); + return; + } + float k = input->getArg<float>(); + _controls->setTargetingK(k); + printGains(); +} +void Comm::setTargetingD(Arguments* input, Reply* output){ + if (input->argc < 1){ + throwNotEnoughArgsError(); + return; + } + float d = input->getArg<float>(); + _controls->setTargetingD(d); + printGains(); +} + + void Comm::setDesiredThetaP(Arguments* input, Reply* output){ if (input->argc < 1){ throwNotEnoughArgsError(); @@ -74,6 +96,10 @@ _json.print("swingUpD", _controls->getSwingUpD()); _json.sepItem(); _json.print("desiredThetaP", _controls->getDesiredThetaP()); + _json.sepItem(); + _json.print("targetingK", _controls->getTargetingK()); + _json.sepItem(); + _json.print("targetingD", _controls->getTargetingD()); _json.close(); }