PaulKemppi / gtsam_fusion

Estimates pose, velocity, and accelerometer / gyroscope biases by fusing GPS position and/or 6DOF pose with IMU data. The fusion is done using GTSAM's sparse nonlinear incremental optimization (ISAM2). The ROS (rospy) node is implemented using GTSAM's python3 inteface.
BSD 3-Clause "New" or "Revised" License
90 stars 17 forks source link

'gtsam.gtsam.ISAM2Params' object has no attribute 'setRelinearizeSkip' #2

Open cmakelabs opened 1 month ago

cmakelabs commented 1 month ago

Thank you for the useful repo, I am trying to run your code, but I encountered the following issue:

    self.__fusion_core = gtsam_fusion_core.GtsamFusionCore(params)
  File "/home/noetic/gtsam_fusion_ws/src/gtsam_fusion/scripts/gtsam_fusion_core.py", line 52, in __init__
    isam2_params.setRelinearizeSkip(params['relinearize_skip'])
AttributeError: 'gtsam.gtsam.ISAM2Params' object has no attribute 'setRelinearizeSkip'

I am using gtsam-4.2, although I have tried it with gtsam-4.1, but It did not work, and the same error still.

I would be really grateful if you could share thoughts on how to fix this issue

PaulKemppi commented 3 weeks ago

Sorry about the late response due to summer vacation. I quickly tested and at least with gtsam 4.1.0 installed with pip works:

import gtsam
p = gtsam.gtsam.ISAM2Params()
p.setRelinearizeSkip(10)
print(p)

Output:

type:              ISAM2GaussNewtonParams
wildfireThreshold: 0.001
relinearizeThreshold:              0.1
relinearizeSkip:                   10
enableRelinearization:             1
evaluateNonlinearError:            0
factorization:                     CHOLESKY
cacheLinearizedFactors:            1
enableDetailedResults:             0
enablePartialRelinearizationCheck: 0
findUnusedFactorSlots:             0