加速度・ジャイロセンサのセッティング
Dependents: Aigamozu_Robot_March
Diff: setting.cpp
- Revision:
- 3:00c23c8ff4d8
- Parent:
- 2:b03a80d9eade
--- a/setting.cpp Wed Jan 27 12:15:05 2016 +0000 +++ b/setting.cpp Tue Feb 16 09:38:53 2016 +0000 @@ -31,14 +31,8 @@ void setting::setAngle(double angle){ - if(changeFlag != 0){ - pastGpsAngle = gpsAngle; + gpsAngle = angle; - difAngle = gpsAngle - pastGpsAngle; - } - else{ - gpsAngle = angle; - } } @@ -76,15 +70,15 @@ */ - if(flag <= 20){ +/* if(flag <= 20){ caribCmp.x += x; caribCmp.y += y; caribCmp.z += z; - + */ agzCmp.x = x; agzCmp.y = y; agzCmp.z = z; - } +/* } else{ @@ -99,7 +93,7 @@ caribCmp.y /= 20; caribCmp.z /= 20; } - + */ } @@ -174,7 +168,7 @@ } } */ - if(flag <= 20){ +/* if(flag <= 20){ caribGyr.x += x; caribGyr.y += y; caribGyr.z += z; @@ -201,5 +195,9 @@ caribGyr.y /= 20; caribGyr.z /= 20; } - +*/ + agzGyr.x = x; + agzGyr.y = y; + agzGyr.z = z; + }