Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttitudeEngine #2

Open
LazaroFilm opened this issue Jul 15, 2023 · 8 comments
Open

AttitudeEngine #2

LazaroFilm opened this issue Jul 15, 2023 · 8 comments

Comments

@LazaroFilm
Copy link

Has anyone manage to get the AttitudeEngine working?

@PhilippMolitor
Copy link
Owner

I had a look at the datasheet describing the AttitudeEngine, but as I am not very fond of the purpose it fulfills I didnt bother implementing it.

It should not be too hard to implement tho. If you would try to do that, I would

  • Implement some kind of enum state for the driver to switch between default and AE mode
  • Implement the switching logic with a class method to safely switch between those two modes
  • Add some safety checks so AE relevant setters and getters only do stuff when AE is active
  • Implement configuration methods for AE mode
  • Add getters for AE data (also with proper handling of AE mode differences)

Please feel free to try it and submit a PR! :)

@LazaroFilm
Copy link
Author

I've been trying to activate the AttitudeEngine, but the bits referring to the quaternion don't return anything, no matter what settings I try.

@PhilippMolitor
Copy link
Owner

Can you describe what registers you tried to modify in order to set up the IMU configuration?

@LazaroFilm
Copy link
Author

LazaroFilm commented Jul 26, 2023

Reg7 to 0b00001011 / 0x0B as per p29 and 33 of data sheet (CTRL7, sEN =1, aEN=1, gEN=1)
them read the quaternions at 0x49 to 0x50 p38 of data sheet

Edit: I also tried different values for Reg6 still get all zeros on que quat.

@PhilippMolitor
Copy link
Owner

Hmm, that is indeed weird. I didn't find too much precise information on how to switch to AE mode from normal mode, but i saw this table:
image
Did you go through this table as well?
Also, did you check if you still get updated "normal" IMU data with your current register setup? If so, seems like something is not enabled quite right yet. If not, AE probably lacks some setup params to get running properly..

@PhilippMolitor
Copy link
Owner

Also, did you set the ODR for AE mode? I had a look at the waveshare example driver, they have a function to set it up (up to 128Hz) or a last value for MoD mode. I think it wouldnt start measuring values unless provided with an AE ODR configuration.

@LazaroFilm
Copy link
Author

I did go through that chart (I actually printed it because I was done scrolling it).
I'm still getting Acc and Gyro values so indeed something is aloof. I'm now trying with the Touch version of the board (the other one.. fell down...) using WaveShare's demo code and modifying it. But I'm not getting any results. I'm starting to lose hope...

@PhilippMolitor
Copy link
Owner

I am sure we are just missing on a very small detail, like setting one specific register. Unfortunately I am not able to work on this code myself at the moment. I will try to think on it though! Maybe I can have a look at the datasheet soon again, and maybe work out a strategy. At this point, I am not even sure anymore if AE mode runs parallel to the normal mode or if it replaces it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants