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:
- 5:9a1ec02229dd
- Parent:
- 4:650af94bf062
- Child:
- 6:0d9fa7152934
diff -r 650af94bf062 -r 9a1ec02229dd Control/ControllerManager.cpp --- a/Control/ControllerManager.cpp Tue Sep 29 18:23:29 2015 +0000 +++ b/Control/ControllerManager.cpp Fri Oct 09 14:29:32 2015 +0000 @@ -9,13 +9,19 @@ *(ニュートラルが0.5からずれているかもしれない)、サーボの角度に変換してglobalに値をセットする */ +//次の目標はlocalメモリ上にニュートラル等の情報を保持し、リセットされる度に、そこから値を取得する +//globalのinitializeを作って、起動毎に呼び出す + +//動的なニュートラルの設定と両立したい +//initialize値の変更はinitializeタスクで行う + + ControllerManager::ControllerManager(PinName b, PinName h, PinName v) : controller(b, h, v){ - maxpitch = Global::getmaxpitch();// - minpitch = Global::getminpitch();// - maxyaw = Global::getmaxyaw();// - minyaw = Global::getminyaw();// - + maxpitch = Global::getmaxpitch(); + minpitch = Global::getminpitch(); + maxyaw = Global::getmaxyaw(); + minyaw = Global::getminyaw(); maxpitchdegree=Global::getmaxpitchdegree(); neutralpitchdegree=Global::getneutralpitchdegree(); @@ -156,10 +162,20 @@ }*/ void ControllerManager::update(){ + maxpitch = Global::getmaxpitch(); + minpitch = Global::getminpitch(); + maxyaw = Global::getmaxyaw(); + minyaw = Global::getminyaw(); + maxpitchdegree=Global::getmaxpitchdegree(); + neutralpitchdegree=Global::getneutralpitchdegree(); + minpitchdegree=Global::getminpitchdegree(); + maxyawdegree=Global::getmaxyawdegree(); + neutralyawdegree=Global::getneutralyawdegree(); + minyawdegree=Global::getminyawdegree(); + Global::setpitch(getpitch()); Global::setyaw(getyaw()); // printf("%f %f\n", getpitch(), getyaw()); - }