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

feature: request and parse HNR-ATT messages to get the attitude solution (pitch/roll/heading) #16

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

sarfata
Copy link

@sarfata sarfata commented Jan 28, 2023

I wanted to get Pitch/Roll/Heading calculated by the GPS in my trackerone application. Here is a small patch to parse the HNR-ATT message from the ublox module.

Let me know what you think!

@@ -449,6 +460,11 @@ int ubloxGPS::setOn(lib_config_t &config)
return SYSTEM_ERROR_NONE;
}

void ubloxGPS::getAttitude(ubx_attitude_t *o)
{
memcpy(o, &this->attitude, sizeof(ubx_attitude_t));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two requests:

  1. Check o is nonzero first.
  2. Use sizeof(*o) so that if the type of o changes, the statement is still valid.

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.

2 participants