I have a F9R-03B GPS module, and I am looking to input my own configurations for the mount alignment. My understanding is that this will make my IMU calibrations a lot “quicker” as it already knows the position and relative angles on how it is mounted. I am trying to change my yaw value to test if my configurations are successful but it does not seem like my changes are being applied. Please let me know if this is how you apply the configuration changes.
Currently for testing I have mounted the front X to point towards the left by 90 degrees. But when I accelerate my Y value changes instead of X. Please help me understand where I am going wrong. I am inputting 90 for my mntalg_yaw value.
The Integration Manual has a whole section on the Installation configuration (section 3.2.4). That’s your reference.
There is also this excellent video which describes the alignment angles in full detail. Pay special attention to the rotations, and the order in which you apply them.
Be careful with your VALSET types. CFG-SFIMU-IMU_MNTALG_YAW is expecting U4 (32-bit unsigned integer). CFG-SFIMU-IMU_MNTALG_PITCH and CFG-SFIMU-IMU_MNTALG_ROLL are expecting I2 (16-bit signed integer). Likewise, CFG-SFIMU-IMU2ANT_LA_X / Y / Z are expecting I2.
I see return static_cast<uint64_t> in your code for i16_bits. Are you sure that’s what you want? Are you not then converting your int16_t and uint32_t to 64-bit? Do you have other code which converts uint64_t back to the correct type for the VALSET? Also, are you checking that the VALSET is successful (ACK’d)? Maybe it is being NACK’d…? You will need to share the source code for your CFG-VALSET functions if you need more suggestions.
You can look at my own project (forked from Paul) : F9x logger.
There are two parts, alignment and calibration. Calibration is done at each startup. Alignment can be provided manually or can be done automatically. Auto-alignment needs a specific driving sequence, typically making 8 loops and, then driving fast (>50 km/h). It is better to not do auto-alignment at each startup, as indicated in your message.
So, at startup, the logger checks if alignment file is available on the SD card. If yes, load it to F9R. If no, start auto-alignment. At shut down after auto-alignment, save alignment values to SD card.
PS: I also added support for arm lever parameters but didn’t uploaded it to github.
There’s also UBX-MGA-INI-ATT, UBX-MGA-SF-INI, UBX-MGA-SF-INI2 which might help boot-strap a restarting system. Docs hint at M10/ADR support, but might want to review MGA dump to see if this data is exported.