Hello!
I started running the LocalizationExample.cpp and now I'd like to adapt it on my use case of position estimation using GPS measurements (I have them in lat/lon but I transform them in x/y coordinates before using GTSAM). I basically kept the same structure of the code as the LocalizationExample.cpp, the only difference is that I use a loop that iterates over the nodes (around 500) while building the graph. Thus my states are (x,y,theta) and my GPS measurements (x,y).
I have tried different use cases:
- for odometry: Pose2(0,0,0), Pose2(delta_x, delta_y, 0) with delta_x and delta_y calculated from x/y measurements, Pose2(delta_x, delta_y, delta_theta) with delta_theta calculated geometrically from x/y measurements
- for initial estimates: Pose2(x, y, 0), Pose2(x, y, theta)with theta calculated geometrically from x/y measurements
- for noise: I tried adding high noise for odometry and low noise for measurements, and the opposite
- for the Hessian: the initial Hessian from the LocalizationExample.cpp and also (Matrix(2,3) << 1.0,0.0,0.0, 0.0,1.0,0.0) (given the measurement function of the GPS measurement)
After optimizing and transforming back to lat/lon space, I am plotting the results vs the initial trace (see the image attached). I was expecting a smoothing effect from the result of FGO but instead I get this chainsaw effect on my original trajectory.
Is this the expected effect (as it goes a bit against my intuition of how the error function is working)? How can I improve it?
I am new to GTSAM and any help is greatly appreciated.