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

NAV - Use raw GPS velocity in calculations #14

Closed
digitalentity opened this issue Jun 20, 2015 · 13 comments
Closed

NAV - Use raw GPS velocity in calculations #14

digitalentity opened this issue Jun 20, 2015 · 13 comments

Comments

@digitalentity
Copy link
Member

Current code calculates GPS velocity from coordinate difference. @bubi-007 suggested that raw velocity from GPS unit should be used instead. I think it's worth trying out.

@digitalentity
Copy link
Member Author

This can be done by using GPS_speed and GPS_ground_course, but code MUST check that GPS unit provide these values - it is not a GGA message, it's a RMC message and it can be disabled in GPS module for some reason.

@digitalentity
Copy link
Member Author

GPS data validity addressed in 6375c485a53eea080cd23bf85c0b0b3a75548305

@bubi-007
Copy link
Contributor

you 'can' disable everything.
but you can subscribe for the velocities in the ned frame:
0xB5,0x62, // Header Turn On UBLOX NAV-VELNED Msg
0x06,0x01, // ID
0x03,0x00, // Length
0x01, // Msg Class NAV
0x12, // Msg ID VELNED
0x01, // Rate 1
0x1E,0x67, // CK_A, CK_B

depends on what you like.

@digitalentity
Copy link
Member Author

The navigation code should not depend on a specific hardware feature (in your example an UBLOX GPS module). If GPS for whatever reason does not provide velocity information, navigation code must still function properly.

@bubi-007
Copy link
Contributor

i just take what works - ublox does and the rest is not so reliable.

@digitalentity
Copy link
Member Author

Sticking with ublox-specific features would effectively remove support for nmea-only gps receivers. We can detect provided information and use what's best - that would be velocity info if available and coordinate difference as a fallback. This will improve things for ublox users and will not break anything for others.

@digitalentity
Copy link
Member Author

Done in 05c115ba6edb79f5f64f8c756c2787d14e1336d0. Untested.
Edit: It just occured to me that this patch also prevents a possible bug with polled GPS (i.e.I2C-NAV). When no new data is available a polled gps module would return previous data, Coordinate difference would then yield zero velocity which will probably be incorrect. Using last known velocity is a better option IMO.

This was referenced Jun 28, 2015
@digitalentity
Copy link
Member Author

Did a test today. Didn't work as good as I thought it will be. However the test was done on poorly tuned copter, so it could be vibration messing up with velocity calculation from accelerometer. Need to re-tune and re-test. If it will work less reliable than coordinate derivative - this will be removed.

@digitalentity
Copy link
Member Author

Did another test today. Was working MUCH worse than plain old coordinate derivative. Closing.

@bubi-007
Copy link
Contributor

the current approach sucks.
bf and cf need a complete rewrite on this subject.

@digitalentity
Copy link
Member Author

@bubi-007
Please assist in getting this working,

@bubi-007
Copy link
Contributor

first i am integrating altitude hold using gps and accelerometer.
then i go into navigation.

@digitalentity
Copy link
Member Author

@bubi-007
Can you please share your code?

digitalentity pushed a commit that referenced this issue Oct 22, 2015
Timeout issue at exit/switch ESC channel fixed
DzikuVx pushed a commit that referenced this issue Apr 5, 2021
DzikuVx pushed a commit that referenced this issue May 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants