From 1ea655355041adf66e15c60dc6a67f157f2c3a38 Mon Sep 17 00:00:00 2001 From: ulterzlw Date: Wed, 7 Dec 2022 14:53:32 +0800 Subject: [PATCH] Fixed Jacobian in python CustomFactorExample --- python/gtsam/examples/CustomFactorExample.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/python/gtsam/examples/CustomFactorExample.py b/python/gtsam/examples/CustomFactorExample.py index 36c1e003d..c7ae8ad21 100644 --- a/python/gtsam/examples/CustomFactorExample.py +++ b/python/gtsam/examples/CustomFactorExample.py @@ -60,10 +60,10 @@ def error_odom(measurement: np.ndarray, this: gtsam.CustomFactor, key1 = this.keys()[0] key2 = this.keys()[1] pos1, pos2 = values.atVector(key1), values.atVector(key2) - error = measurement - (pos1 - pos2) + error = (pos2 - pos1) - measurement if jacobians is not None: - jacobians[0] = I - jacobians[1] = -I + jacobians[0] = -I + jacobians[1] = I return error