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: bno055_use.h
- Revision:
- 1:943ebeac19f7
- Parent:
- 0:4092428e9e15
- Child:
- 2:a7fa5c448703
--- a/bno055_use.h Wed Feb 13 14:56:26 2019 +0000
+++ b/bno055_use.h Fri Mar 15 09:16:23 2019 +0000
@@ -17,6 +17,7 @@
.getYaw180() //Yaw(-180~0~180) 値取得 (返り値 float)
.getYaw360() //Yaw(0~360)(時計回り) 値取得 (返り値 float)
.getYaw360Rev() //Yaw(0~360)(反時計回り) 値取得 (返り値 float)
+ .getYawRad360() //yaw(-360~0~360) 値取得 (返り値 float)
**************************************************/
//p28 p27 or p9 p10
@@ -112,6 +113,37 @@
return data_yaw360Rev;
}
+ /***************************************自作BNO055関数**********************************/
+ /************************
+ ロボットの回転方向から+360 ~ 0 ~ -360の値を推定して返す
+ *************************/
+ float getYawRad360() {
+ float calculate_yawRad;
+ /*
+ if(data_yawRad > 360.0f) {
+ if(count == 1) {
+ calculate_yawRad = data_yawRad - 360.0f * 1.0f;
+ }
+
+ } else if(data_yawRad < -360.0f) {
+ if(count == -1) {
+ calculate_yawRad = data_yawRad - 360.0f * -1.0f;
+ /
+ } else {
+ calculate_yawRad = data_yawRad;
+ }*/
+ if(data_yawRad >= 360.0f) {
+ calculate_yawRad = 360.0f;
+ } else if(data_yawRad <= -360.0f) {
+ calculate_yawRad = -360.0f;
+ } else {
+ calculate_yawRad = data_yawRad;
+ }
+
+ return -calculate_yawRad;
+ }
+
+
float getYawRad(){
return data_yawRad;
}