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

Added setAxisRemap and setAxisSign functions #38

Merged
merged 2 commits into from
Jan 11, 2018

Conversation

mrkaroshi
Copy link
Contributor

@mrkaroshi mrkaroshi commented Mar 1, 2017

Added these two functions to allow remapping of the axis and reversal of their direction also. The developer can then use the macros already provided in the original header.

Added these two functions to allow remapping of the axis and reversal of their direction also. The developer can then use the macros already provided in the original header.
@mrkaroshi
Copy link
Contributor Author

Argh just realised this was already implemented!

@ronzeiller
Copy link

Axis and sign remapping is implemented, but how to call it as write8 is private?

@mrkaroshi
Copy link
Contributor Author

@ronzeiller are you having a problem with a specific function? Can you give a code snippet or example?

@ronzeiller
Copy link

ronzeiller commented Dec 13, 2017

@mrkaroshi
Thank You for answering.
You wrote:

Added these two functions to allow remapping of the axis and reversal of their direction also. The developer can then use the macros already provided in the original header.

This is perfect and exactly what I was looking for:
void Adafruit_BNO055::setAxisRemap( adafruit_bno055_axis_remap_config_t remapcode )

Argh just realised this was already implemented!

but I cannot find these functions in the official library. And nothing similar?

And, btw do you know if other axis remappings e.g. for upright use of the sensor are also ok?

@mrkaroshi
Copy link
Contributor Author

@ronzeiller if by 'upright' you mean remapping, say X to Z and Z to X, then the datasheet (on page 25) implies you can only have the sensor face down or face up.

Technically, if you imagine rotating the sensor around the X axis, you could just read the data from the Y axis into your Z variable, then invert the Z axis values before putting them into your Y variable.

If you do something like that, however, remember to apply offsets to your accelerometer accordingly (page 31) so that gravity is removed from Y instead of Z (for my specific example).

Does that answer your question ok?

@ronzeiller
Copy link

@mrkaroshi

@ronzeiller if by 'upright' you mean remapping, say X to Z and Z to X, then the datasheet (on page 25) implies you can only have the sensor face down or face up.

Agree with this

Technically, if you imagine rotating the sensor around the X axis, you could just read the data from the Y axis into your Z variable, then invert the Z axis values before putting them into your Y variable.

OK, this is clear so far

If you do something like that, however, remember to apply offsets to your accelerometer accordingly (page 31) so that gravity is removed from Y instead of Z (for my specific example).

This I do not understand. I thought the offsets are done automatically by the sensor fusion.

Thank You for your effort, but even in the Bosch default's position this sensor does not work for me. Wanted to use it as compass for boating, but the heading is inferior and even when laying somewhere without any movement you can watch the value turning.....

@mrkaroshi
Copy link
Contributor Author

@ronzeiller which axis drifts? Is the sensor near any sources of interference? Have you tried putting the BNO into Compass mode? I know magnetometers are mainly used for heading, depending on the sensor fusion balance, but they can be influenced by electromagnetic fields etc

That last part is about compensating the accelerometer to account for an orientation the BNO isn’t really designed for, even though it has a pretty robust fusion algorithm it’s still getting data from three sensors simultaneously - if one of them is accumulating noise, or worse drifting, your final orientation value will shift over time also. Page 43 of the datasheet explains a calibration procedure you can go through to get the best from the individual sensors, but also a register you can check to make sure the device has finished calibrating before you start using it's data.

This video shows a few examples of interference and their effect on a hobbyist-grade navigation system.

@ronzeiller
Copy link

@mrkaroshi

which axis drifts?
Mainly the heading (personally I am using the sensor in default mounting position).
One thing is drift over time.
The other thing is that north is most of the time not north, compared to a magnetic compass, even if sensor is fully calibrated.
After each power on and careful calibration it shows slightly in another direction.

Is the sensor near any sources of interference?
No, today I even took it out of the case with Teensy and WiFi and put it into a separate box (plastic, no screws, nothing)

Have you tried putting the BNO into Compass mode?
No, because we need tilt compensation, roll and pitch too.

Now the sensor was laying without any movement, fully calibrated, without any changes of things nearby.
After 5 hours it was showing a drift of 2 degrees, full calibration, at constant room temperature.
When I moved the sensor a little bit it, suddenly it lost fully calibrated status (sysCal went to 0, magCal still on 3, accCal went to 1)

Any ideas what is wrong with 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

Successfully merging this pull request may close these issues.

4 participants