Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: Control/ControllerManager.cpp
- Revision:
- 2:e0f1e8662b8c
- Parent:
- 0:2a15bd367891
- Child:
- 3:e3c41153e5fe
--- a/Control/ControllerManager.cpp Mon Sep 07 21:56:25 2015 +0000 +++ b/Control/ControllerManager.cpp Mon Sep 28 10:33:07 2015 +0000 @@ -167,7 +167,7 @@ - +//設定した最大、最小値を超えない値を返す static float clamp(float value, float min, float max) { if(value < min) { return min; @@ -177,6 +177,7 @@ return value; } } +//ニュートラル基準でピッチ、ヨーともに[-1.0,1.0]の範囲で値を返す(maxpitchdegree=1.0;neutralpitchdegree=0.5;minpitchdegree=0.0;のとき) double ControllerManager::pitchratio(){ return 2.0*(controller.getV() - neutralpitchdegree)/(maxpitchdegree-minpitchdegree); } @@ -188,7 +189,7 @@ - +//pitchratioを設定したmaxpitch,minpitch倍にする double ControllerManager::doublepitch(double pitchratio){ if(pitchratio<0){ return clamp(-pitchratio*minpitch,minpitch,maxpitch);