M5Unified icon indicating copy to clipboard operation
M5Unified copied to clipboard

AtomS3R IMU

Open patfelst opened this issue 1 year ago • 4 comments

Hi there, I tried the IMU example on a AtomS3R but it says the IMU is not found.

Are there any plans to update the library to work with the AtomS3R's BMM150 geomagnetic sensor and BMI270 attitude sensor?

Thankyou!

patfelst avatar Oct 10 '24 10:10 patfelst

Apologies I see release 0.1.17 has added support for AtomS3R.

Can you think of a reason that the IMU init retuns as imu_none? I am running this example https://github.com/m5stack/M5Unified/blob/master/examples/Basic/Imu/Imu.ino

patfelst avatar Oct 10 '24 11:10 patfelst

Hello, @patfelst Sorry, the current release version doesn't work properly. Please try the develop branch version.

lovyan03 avatar Oct 11 '24 06:10 lovyan03

geat thank you, it's working now!

patfelst avatar Oct 11 '24 08:10 patfelst

Hi again, I got the Madgwick library to calculate roll, pitch and yaw (heading).

I notice that the heading rotation is reversed to what I exptected, i.e. turning the AtomS3R clockwise (screen facing up) results in heading angle reducing. Can one of the following functions be used to reverse that behaviour? i.e. Clockwise rotation increases heading?

    // 軸の順序を右手系で指定する。最初の2軸のみ指定し、3軸目は省略
    bool setAxisOrderRightHanded(axis_t axis0, axis_t axis1);

    // 軸の順序を左手系で指定する。最初の2軸のみ指定し、3軸目は省略
    bool setAxisOrderLeftHanded(axis_t axis0, axis_t axis1);

I'm not sure how to call this from the arduino setup() function. Can you please help?

patfelst avatar Oct 12 '24 06:10 patfelst

Sorry for the late reply.

Thank you for providing important information. I overlooked that the orientation of the IMU of the AtomS3R series is different from the conventional model. I have updated the develop branch now and changed the axis orientation. If you want to try it immediately, please use the latest develop branch for both M5GFX and M5Unified.

Also, if you want to call the axis setting function, do it as follows.

  M5.Imu.setAxisOrderLeftHanded(m5::IMU_Class::axis_t::axis_x_pos, m5::IMU_Class::axis_t::axis_y_pos);

lovyan03 avatar Nov 05 '24 10:11 lovyan03

I will test this very soon, thank you

patfelst avatar Nov 08 '24 10:11 patfelst

hi again apologies for the long delay.

Is the new AtomS3R orientation code now in the latest release v0.2.2? The orentation seems the same to me.

If I use the function below, the orientation is correct (i.e. heading increases when AtomS3R is turned clockwise). M5.Imu.setAxisOrderLeftHanded(m5::IMU_Class::axis_t::axis_x_pos, m5::IMU_Class::axis_t::axis_y_pos);

I think we can probably close this issue now.

patfelst avatar Dec 28 '24 03:12 patfelst

In the currently released version, the IMU orientation of AtomS3 and AtomS3R has been adjusted to be the same. As far as I understand, there are no compatibility issues at this stage. If you are having any issues, please let me know the details.

lovyan03 avatar Jan 27 '25 03:01 lovyan03

I'm no longer working on this project. But like I saide the function setAxisOrderLeftHanded worked for me.

patfelst avatar Jan 27 '25 10:01 patfelst