selective keys in the LM optimizer

54 views
Skip to first unread message

Anusna Chakraborty

unread,
Mar 14, 2023, 10:43:30 PM3/14/23
to gtsam users
Hello All,

I am working with GTSAM to implement a very simple landmark-based localization problem (similar to the localizationExample.cpp file but instead of custom GPS measurements, I want to estimate the 2D robot pose using range/bearing measurements from landmarks). I have used the RangeFactor to add measurements. In order to use the RangeFactor I had to create two different symbols (x for the robot and l for landmarks). Unlike SLAM, I know the exact position of the landmarks and so I do not want their locations to be optimized. 
Is there any way I can only optimize the robot and not the landmarks and still use the RangeFactor?
I would greatly appreciate any help or suggestions you might have on the matter. 

Thanks and regards,
Anusna

Jay Elrod

unread,
Mar 15, 2023, 1:45:50 AM3/15/23
to gtsam users
Hi Anusna,

You can use gtsam::NonlinearEqualityFactor on landmarks instead of gtsam::PriorFactor from the examples, and it should provide much less (or zero) fluctuation on the landmarks' poses during optimization steps.

Jay

Anusna Chakraborty

unread,
Mar 16, 2023, 10:24:30 PM3/16/23
to gtsam users
Hi Jay,

Thanks for your help. It works with the NonlinearEquality factor. 

Thanks and regards,
Anusna

Reply all
Reply to author
Forward
0 new messages