Open mhkabir opened 7 years ago
I agree it should be more precise & consistent. s_variance_m_s
& c_variance_rad
come directly from the ublox gps. The protocol spec just says it's the 'Speed accuracy estimate' in [m/s] and 'Heading accuracy estimate (both motion and vehicle)' in [rad]. So it should be standard deviation.
@bkueng What fix would you recommend here? Renaming the field and comment to be more precise?
Or as I think is probably much better - go directly to my third suggestion :
Is there an objection to switching the vehicle_gps_position topic to covariances only (pos_cov and vel_cov), and derive the other uncertainty fields where needed? Seems kinda unnecessary to transport hdop, vdop, epv, eph, s_variance_m_s, c_variance_rad, etc. Also, modern estimators and any cascaded setup will benefit from the covariance availability.
e.g the UAVCAN GPS driver already has all the covariance information, but it is not utilized fully: https://github.com/PX4/Firmware/blob/master/src/modules/uavcan/sensors/gnss.cpp#L119-L120
Yes renaming and commenting is a first step. Don't know if covariances make sense as it would add values if you have a whole covariance matrix. Most of the code seems to use eph & epv (and so do the log analysis tools), and not vdop & hdop. One usage however is here: https://github.com/PX4/Firmware/blob/master/src/modules/mavlink/mavlink_messages.cpp#L1103. Very confusing, but it seems to be really hdop, as the mavlink field doc says 'GPS HDOP horizontal dilution of position (unitless)'.
@LorenzMeier Comments?
@bkueng the GPS mavlink message just has the field name wrong but it is hdop according to the spec http://mavlink.org/messages/common#GPS_RAW_INT.
@julianoes Actually - I remember that the mavlink spec was changed to make it DOPs at some point, because we wanted QGC to display the HDOP/VDOP rather than the EPH/EPV. The original message spec had EPH/EPV. We just kept using the fieldnames to maintain compatibility.
@bkueng @julianoes I have made the necessary changes here: https://github.com/mhkabir/Firmware/tree/gps_refactor
Most important changes in the GPS topic: https://github.com/PX4/Firmware/commit/2971a69ed79ffe8d9424be562483fe2388af0a8d
Please review, and let me know if you want anything to be done differently.
Hey, this issue has been closed because the label status/STALE
is set and there were no updates for 30 days. Feel free to reopen this issue if you deem it appropriate.
(This is an automated comment from GitMate.io.)
@mhkabir did you want to open a PR for this?
Kabir vs. the Bot -- who would win?
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
I hope we don't lose against these bots!
@mhkabir can you continue that? I had the same confusion between variance and std dev of the speed accuracy today.
The value currently being passed through for the UBlox receivers is a speed accuracy with units of m/s, not a variance with units of (m/s)**2 and the EKF and other consumers are using it as such. The use of 'variance' in the name is misleading, however the description is correct and the name contains the units. If we either change name or units, then we will break replay of logs gathered using the legacy topic definition. I think what we should do here is add a note above the s_variance_m_s and c_variance_rad variables to make it clear.
What if we create a new sensor_gps
topic with correct everything and support the old one in parallel for one or two releases?
This issue has been automatically marked as stale because it has not had recent activity. Thank you for your contributions.
Couple of issues and concerns which I had while upstreaming the GPS-VIO interface which will also allow an offboard estimator to use the GPS accuracy information:
1 . This is from the
vehicle_gps_position
topic :For velocity, variance should be in (m/s)^2 and for course, in rad^2. The comment and field name are both incorrect, and it is not understandable whether we want variance or standard deviation here.
GPS_INPUT
:The units suggest that these are standard deviations, however field spec is not clear from the word "accuracy". Judging from other messages with better docs e.g
WIND_COV
(horiz_accuracy float Horizontal speed 1-STD accuracy), it means sqrt variance.vehicle_gps_position
topic to covariances only (pos_cov
andvel_cov
), and derive the other uncertainty fields where needed? Seems kinda unnecessary to transporthdop
,vdop
,epv
,eph
,s_variance_m_s
,c_variance_rad
, etc. Also, modern estimators and any cascaded setup will benefit from the covariance availability. @LorenzMeierI will send in a PR with the fixes and the new interface when as my concerns are confirmed by another pair of eyes.