Skip to content

code error in getGravity, X values used for Y and Z #31

@bradcar

Description

@bradcar

Fouind a coding error in lines 510-516. This is likely a copy-paste error, as the X quatity is given to X, as well as Y and Z.

void BNO08x::getGravity(float &x, float &y, float &z, uint8_t &accuracy)
{
	x = qToFloat(gravityX, gravity_Q1);
	y = qToFloat(gravityX, gravity_Q1);
	z = qToFloat(gravityX, gravity_Q1);
	accuracy = gravityAccuracy;
}

Likely this should be:

void BNO08x::getGravity(float &x, float &y, float &z, uint8_t &accuracy)
{
	x = qToFloat(gravityX, gravity_Q1);
	y = qToFloat(gravityY, gravity_Q1);
	z = qToFloat(gravityZ, gravity_Q1);
	accuracy = gravityAccuracy;
}

Sorry, I do not have any way of testing this code, so I can not do a PR.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions