SmartFactorBase(const SharedNoiseModel& sharedNoiseModel, boost::optional<Pose3> body_P_sensor = boost::none, size_t expectedNumberCameras = 10) : body_P_sensor_(body_P_sensor), Fs(expectedNumberCameras) {
if (!sharedNoiseModel) throw std::runtime_error("SmartFactorBase: sharedNoiseModel is required");
SharedIsotropic sharedIsotropic = boost::dynamic_pointer_cast< noiseModel::Isotropic>(sharedNoiseModel);
if (!sharedIsotropic) throw std::runtime_error("SmartFactorBase: needs isotropic");
noiseModel_ = sharedIsotropic; }
About inverse depth: I believe we have something in unstable, do a global search ?
I don’t see an “above”.
A SmartProjectionFactor takes a sharedNoiseModel right? What happens when you give it a Huber model? I seem to remember something but if you point me to the code it will be faster.
F
--
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 on the web visit
https://groups.google.com/d/msgid/gtsam-users/c37d654d-75b4-4f67-87b9-63f89fceca80n%40googlegroups.com.
Thanks!
I remember this now. At the time we wrote smart factors with that assumption. Unfortunately removing that assumption and validating that things keep working is probably a project, not a quick fix. If you are motivated to do it, you could read up on the source code and we can meet to brainstorm about solutions. I will not be able to devote a lot of time to it, though, it’ be up to you (or anyone on this thread who’s motivated and has the time).
BTW I was thinking, separately, about the ability to provide a “batch dimension” to any type of factor, which would replace smartfactors/extend it to other types. That is a larger project, and again, looking for collaborators here.
Before you commit, though, make sure you can devote the time and have the stamina to finish it 😊
Frank
Before answering this, I generated some docs to refresh my memory. They are here. Let me know if you find any issues.
Regarding the noise model, the current implementation of SmartFactorBase (and therefore its derivatives like SmartProjectionFactor and SmartProjectionPoseFactor) requires a single, shared, isotropic noise model (like noiseModel::Isotropic::Sigma or noiseModel::Unit::Create) for all measurements associated with that factor instance.
I commented in 2015:
/**
* As of Feb 22, 2015, the noise model is the same for all measurements and
* is isotropic. This allows for moving most calculations of Schur complement
* etc. to be easily moved to CameraSet, and also agrees pragmatically
* with what is normally done.
*/
This restriction simplifies the implementation and math, particularly the whitening process applied during the Schur complement calculation. I’m honestly not sure how to fix this, but if you want to do a deeper dive based on the docs and my comments above, go for it.
Frank
To view this discussion visit https://groups.google.com/d/msgid/gtsam-users/f2f9a18d-b1f5-4c26-8b91-e0d8e3d4e0aen%40googlegroups.com.
Thanks again to the GTSAM community for all the great work.
Best regards,
Bart
You received this message because you are subscribed to a topic in the Google Groups "gtsam users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/gtsam-users/qHXl9RLRxRs/unsubscribe.
To unsubscribe from this group and all its topics, send an email to gtsam-users...@googlegroups.com.
To view this discussion visit https://groups.google.com/d/msgid/gtsam-users/SJ0PR07MB9074142F563453FA63AE48CECF8BA%40SJ0PR07MB9074.namprd07.prod.outlook.com.
Hi Bart
We actually have Huber in GTSAM, as well as many other models: https://github.com/borglab/gtsam/blob/develop/gtsam/linear/LossFunctions.h
They are designed to be used with noiseModel::Robust.
If you only changed the totalReprojectionError methods, you would not be applying the correct Jacobians for the optimization. But, if it works for you, that’s empirical evidence that approximate gradients are fine in practice.