Skip to content

Commit 039f5cf

Browse files
authored
Update CustomFactorExample.py with comments to explain typing
1 parent 8611aec commit 039f5cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

python/gtsam/examples/CustomFactorExample.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
import gtsam
1616
import numpy as np
1717

18-
I = np.eye(1)
18+
I = np.eye(1) # Creates a 1-element, 2D array
1919

2020

2121
def simulate_car() -> List[float]:
@@ -44,7 +44,7 @@ def error_gps(measurement: np.ndarray, this: gtsam.CustomFactor,
4444
if jacobians is not None:
4545
jacobians[0] = I
4646

47-
return error
47+
return error # with input types this is a 1D np.ndarray
4848

4949

5050
def error_odom(measurement: np.ndarray, this: gtsam.CustomFactor,

0 commit comments

Comments
 (0)