Skip to content

IMUPLUS_MODE and M4G_MODE not properly supported. #75

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

Closed
ViennaMike opened this issue Apr 2, 2021 · 2 comments
Closed

IMUPLUS_MODE and M4G_MODE not properly supported. #75

ViennaMike opened this issue Apr 2, 2021 · 2 comments

Comments

@ViennaMike
Copy link
Contributor

ViennaMike commented Apr 2, 2021

Per the documentation for the BNO055 (section 3.3.3) there are absolute and non-absolute (relative) fusion modes. All 5 of these provide meaningful Euler angle and quaternion outputs, but the code in adafrit_bno055.py does not include IMUPLUS or M4G modes in the mode list to return values and instead always return None's.

Fix needed:
In the code:

@property
def euler(self):
    """Gives the calculated orientation angles, in degrees.
    Returns an empty tuple of length 3 when this property has been disabled by the current mode.
    """
    if self.mode in [0x09, 0x0B, 0x0C]:
        return self._euler
    return (None, None, None)

the values 0x08 and 0x0A need to be added to the list.
The same two values need to be added to the list in:

@property
def quaternion(self):
    """Gives the calculated orientation as a quaternion.
    Returns an empty tuple of length 3 when this property has been disabled by the current mode.
    """
    if self.mode in [0x09, 0x0B, 0x0C, 0x08, 0x0A]:
        return self._quaternion
    return (None, None, None, None)
@ViennaMike
Copy link
Contributor Author

ViennaMike commented Apr 2, 2021

I've submitted a pull request that fixes this problem (and three similar ones I discovered while comparing outputs to what they should be, per the data sheet, for each mode).

I got a "failure test" on the request, but the only issues I see listed are issues with existing code I didn't touch. If I need to fix something, let me know what needs to be done.

@ViennaMike
Copy link
Contributor Author

Fixed by pull request #76.

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

1 participant