Merge pull request #1340 from ulterzlw/develop

Fixed Jacobian in python CustomFactorExample
release/4.3a0
Fan Jiang 2022-12-13 00:02:19 -05:00 committed by GitHub
commit 7f19e3f43d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -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