-
Notifications
You must be signed in to change notification settings - Fork 14.6k
Add RTK lat/lon/alt High Precision components to SensorGps.msg for centimeter level GPS accuracy #21678
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
Conversation
|
I understand the motivation, but if this is needed I'd rather just take the hit and switch lat/lon to double precision floating point (degrees or radians?) and update the consumers. PX4-Autopilot/msg/VehicleGlobalPosition.msg Lines 11 to 12 in c468266
|
|
I do agree that converting the lat, lon, alt and alt_ellipsoid fields in SensorGps.msg makes the most sense. From what I see in the code, degrees in WGS84 for lat/lon and meters for alt seems to be a standard. To feel the extent of the changes I did a quick experiment - renamed the four fields (adding a _dbl postfix and making them float64) and went through all files which broke the compile (I used "make emlid_navio2" and "make px4_sitl gazebo-classic_r1_rover"). I just hacked the code to compile, not even trying to make calculations correct. Here is the list of files I had to modify in the process: From what I saw so far, the EKF2 has its own struct gpsMessage (...PX4-Autopilot/src/modules/ekf2/EKF/common.h:158) with int32_t members - this might lead to deeper dive in the rabbit hole. Mavlink is a bit tricky too. Other areas seem to be rather trivial. In any case, this is way above my head - while I can prepare a draft PR (changing the files above to have correct conversions), I cannot test it to full extent. It will also require coordination with at least GPS and EKF2 submodules maintainers. Let me know how I can help. |
|
Thanks @slgrobotics, if you want to get it started in a pull request I can jump in and help with the remaining pieces. Naming these new fields differently (eg full latitude/longitude?) might also make it slightly easier to update Flight Review and any other random usage. |
|
Thanks, @dagar - I'll start on the PR ASAP. I just need a decision from you - on the naming and on what we do with the altitudes.
Let me know what you've decided, I am fine with any choice. |
|
@dagar - please review the above, I need your input on naming and alt handling to proceed. Thanks! |
|
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: https://discuss.px4.io/t/px4-community-q-a-june-21-2023/32764/1 |
|
@dagar - I checked in all changes related to renaming lon/lat/alt It compiles fine under "make emlid_navio2" and "make px4_sitl gazebo-classic_r1_rover" Related GPSDriver changes are now in new PR: PX4/PX4-GPSDrivers#136 I wasn't able to compile with UAVCAN enabled, so there are places where verification and more changes might be needed: I am pretty sure there are some more places that need a little touch, and, of course, testing. |
|
I will go through "checks" and fix the errors where possible. |
|
@dagar - here is the status:
Let me know what else can I do. |
|
I fixed errors related to double/float promotion in CLANG (make clang-tidy-quiet) and all other checks. "make tests-coverage" succeeded on my Ubuntu 20.04 PC, all 138 tests passed, created coverage/lcov.info (11MB file) I'd guess we need another full build done. |
|
This pull request has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: https://discuss.px4.io/t/px4-maintainers-call-july-04-2023/32943/1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for going through this.
Can you increase the data version to 2 in
PX4-Autopilot/src/modules/logger/logger.cpp
Line 2106 in dccfcb8
| write_info(type, "ver_data_format", static_cast<uint32_t>(1)); |
And can you provide a log after all the updates (using the rover is fine)?
I can then update flight review accordingly.
|
@bkueng - I uploaded log file from my full size gas-powered zero-turn lawnmower: https://review.px4.io/plot_app?log=6c95bdf7-57a8-4e1b-b292-1d2e1d4362a7 I fixed all I could, need your decision on src/drivers/osd/msp_osd/uorb_to_msp.cpp Thanks! |
|
Thanks @slgrobotics. Does this include my comments from the GPS submodule as well? |
|
sorry, missed that - working on it. |
|
@bkueng - Updated as you suggested, including GPSDrivers. Let me know if I understood your suggestions correctly. Thanks! |
|
Just in case - a fresh log here: https://review.px4.io/plot_app?log=b835e623-eb13-4720-b964-a3562e1d7ce5 |
|
PR for flight review: PX4/flight_review#263 |
|
I updated the gps submodule and reverted .gpsmodules, but when it came to rebasing and squashing - things got messy. I am relatively new to github, and this is my first attempt on squashing (rebase -i RTK-HPPOSLLH~35) - so, when I got through it I found many strangely squashed commits. Here I had to do "git reset --hard e3ba98c145" and push -f, to get back to a nice state (i.e. .gitmodules updated and then Will try to squash again, but just in case - invited @bkueng as collaborator with, I hope, full rights to this branch. |
|
@bkueng -- Ok, squashing seems to be "above my pay grade" ;-) I tried to squash only my changes, and removed lines with others - here's what I've got on a guinea pig branch: https://github.com/slgrobotics/PX4-Autopilot/tree/RTK-HPPOSLLH-2 This was result of the following: I can force push of the same to this branch (RTK-HPPOSLLH) - just feel uncomfortable with submodules changes and possible difficulty in merging. The branch in its current state can be easily merged though. Basically I need either a direction (what exactly the purpose of the squashing - to squash only my changes and ignore others, or to bring everything up in sync with main and then apply my changes in one squash?) - or I'd give a more qualified person full access to the RTK-HPPOSLLH branch to do remaining conversions. |
To match PX4/PX4-GPSDrivers#132 - adding high precision RTK lat/lon/alt components
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Apart from the submodule changes that slipped in your rebase looks correct. I did it now for your branch.
We generally want to make sure every commit compiles, and having a clean history while splitting independent changes into separate commits. As in this case everything is related, it makes sense to keep it all in one.
Let's wait for CI, otherwise it's good to merge.
|
I just cloned the "main" and my RTK-HPPOSLLH locally and compared the trees. I see my changes and some changes related to latest main check-ins (like UWB stuff) - but nothing in the submodules (rather than GPSDrivers of course). So, I'd guess, the squashed RTK-HPPOSLLH branch is as good as it gets for the merge. |
This PR seeks to match PX4/PX4-GPSDrivers#136 - adding high precision RTK lat/lon/alt components from MSG_NAV_HPPOSLLH
Solved Problem
This creates a possibility to operate coordinates with precision necessary to drive land based Rovers, for example, agricultural machines.
Solution
please follow the link above for details
Note:
once 1e-9 precision is available in _gps_position ORB message, it can be used in the following modules, as far as I know:
For my Rover project, I modified RoverPositionControl.cpp to subscribe to ORB_ID(sensor_gps) and use precise lat/lon for course planning. This won't be necessary if EKF2 could deliver centimeter level precision coordinates.