You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a GenericProjectionFactor is filled with serialized data and Cauchy robust loss it returns wrong error, using python wrapper.
I tested with Huber loss and it works fine. also notice that unweightenedError returns correct result.
Steps to reproduce
see the attached python code:
import gtsam
import numpy as np
point_noise = gtsam.noiseModel.Diagonal.Sigmas(np.ones(2))
point_noise = gtsam.noiseModel.Robust.Create(gtsam.noiseModel.mEstimator.Cauchy.Create(1), point_noise)
factor = gtsam.GenericProjectionFactorCal3_S2(np.ones(2), point_noise, 0, 1, gtsam.Cal3_S2())
values = gtsam.Values()
values.insert(0, gtsam.Pose3())
values.insert(1, np.array([2, 0, 15]))
#init new factor with something, since there is no empty constructor for GenerincProjectionFactor
factor1 = gtsam.GenericProjectionFactorCal3_S2(np.ones(2), point_noise, 0, 2, gtsam.Cal3_S2())
factor1.deserialize(factor.serialize())
print(f"original factor error: {factor.error(values)}, deserialized factor error: {factor1.error(values)}")
output:
original factor error: 0.24628311578204365, deserialized factor error: 0.003451520129521184
Expected behavior
The error returned will be similar
Environment
tested on ubuntu 18.04 with python 3.7 and gtsam pip package version 4.2a5
The text was updated successfully, but these errors were encountered:
Description
When a GenericProjectionFactor is filled with serialized data and Cauchy robust loss it returns wrong error, using python wrapper.
I tested with Huber loss and it works fine. also notice that unweightenedError returns correct result.
Steps to reproduce
output:
original factor error: 0.24628311578204365, deserialized factor error: 0.003451520129521184
Expected behavior
The error returned will be similar
Environment
tested on ubuntu 18.04 with python 3.7 and gtsam pip package version 4.2a5
The text was updated successfully, but these errors were encountered: