What is the reference frame required for the measurements and the covariance matrix in the GPSFactor constructor?

102 views
Skip to first unread message

Elisa Es

unread,
Jan 17, 2025, 8:44:59 AM1/17/25
to gtsam users
What is the reference frame required for the measurements and the covariance matrix in the GPSFactor constructor?

gtsam::GPSFactor::GPSFactor

(

Key 

key,



const Point3

gpsIn,



const SharedNoiseModel

model 


)


The documentation specifies that the measurements must be in local Cartesian coordinates, but it does not clarify the type of reference frame these coordinates should be based on. Could you provide more details about the expected reference frame?

Thank you

Dellaert, Frank

unread,
Jan 17, 2025, 2:39:29 PM1/17/25
to Elisa Es, gtsam users
There is a little bit of documentation at the top of the .h file, but it is not a lot, I agree. Basically you can choose whatever Cartesian frame you want as long as the measurement and the state are expressed in the same frame. This includes local tangent planes like ENU or NED.

Frank

From: gtsam...@googlegroups.com <gtsam...@googlegroups.com> on behalf of Elisa Es <denichi...@gmail.com>
Sent: Friday, January 17, 2025 8:44:58 AM
To: gtsam users <gtsam...@googlegroups.com>
Subject: [GTSAM] What is the reference frame required for the measurements and the covariance matrix in the GPSFactor constructor?
 
You don't often get email from denichi...@gmail.com. Learn why this is important
--
You received this message because you are subscribed to the Google Groups "gtsam users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gtsam-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gtsam-users/a3577835-b628-4291-be66-3e81cf4884b5n%40googlegroups.com.

John T

unread,
Jan 18, 2025, 10:07:08 AM1/18/25
to gtsam users

Refer to the usage examples in that repo https://github.com/JokerJohn/LIO_SAM_6AXIS/blob/main/LIO-SAM-6AXIS/src/mapOptmizationGps.cpp. You only need to set the latitude, longitude, and altitude of the starting point in your coordinate system, then use the GeographicLib library to convert your GPS observations (LLA) into ENU/UTM coordinates. These coordinates then serve as the inputs for the GPS factors.

As for the noise matrix, most integrated navigation systems provide observation noise, such as planar error in the x and y axes. However, it's hard to guarantee complete accuracy, because satellite distribution typically leads to a higher level of error in the vertical (z) axis compared to the horizontal (x, y). Many factors can affect noise settings, including sensor dimensions and scales.

I recommend selecting GPS readings that are clearly high precision for factor graph optimization. Otherwise, large GPS errors could introduce irreversible issues to the optimization. Also, a few sparse but accurate GPS measurements will easily counteract odometry drift; you don’t need too many GPS factors. (That does take some experience to judge.)

Dellaert, Frank

unread,
Jan 18, 2025, 10:45:46 AM1/18/25
to John T, gtsam users

Thanks John!

 

Note you can use a noiseModel::Diagonal to tell GTSAM you don’t trust z as much.

 

More likely, the zero-mean assumption of the GPS noise model is more problematic. The GPSFactor deals with *zero mean* measurements only. If you want to model the complex errors associated with GPS, you’ll have to do it differently 😊

 

As an aside, I just found out, to my delight (after seeing Grace Gao’s MIT talk on Youtube) that the Google GNNS Decimeter challenge last year was won (for the second time) by “Taro”, who used specialized factors and GTSAM: https://www.kaggle.com/competitions/smartphone-decimeter-2022/discussion/341111

 

Second aside: this year’s competition is still open 😊 https://www.kaggle.com/competitions/smartphone-decimeter-2023/overview

 

Best

Frank

 

 

 

From: gtsam...@googlegroups.com <gtsam...@googlegroups.com> on behalf of John T <huxiangch...@gmail.com>
Date: Saturday, January 18, 2025 at 10:07

AM
To: gtsam users <gtsam...@googlegroups.com>
Subject: [GTSAM] Re: What is the reference frame required for the measurements and the covariance matrix in the GPSFactor constructor?

You don't often get email from huxiangch...@gmail.com. Learn why this is important

--

You received this message because you are subscribed to the Google Groups "gtsam users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to gtsam-users...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages