gtsam-develop 4.3a0.dev202505281326__cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl → 4.3a0.dev202505281542__cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of gtsam-develop might be problematic. Click here for more details.
- gtsam/__init__.pyi +14 -14
- gtsam/gtsam/__init__.pyi +161 -0
- gtsam/gtsam.cpython-311-aarch64-linux-gnu.so +0 -0
- gtsam/tests/test_HybridValues.py +210 -14
- {gtsam_develop-4.3a0.dev202505281326.dist-info → gtsam_develop-4.3a0.dev202505281542.dist-info}/METADATA +1 -1
- {gtsam_develop-4.3a0.dev202505281326.dist-info → gtsam_develop-4.3a0.dev202505281542.dist-info}/RECORD +11 -11
- gtsam_develop.libs/{libgtsam-ab7f7833.so.4.3a0.dev202505281326 → libgtsam-d5b5c340.so.4.3a0.dev202505281542} +0 -0
- gtsam_develop.libs/{libgtsam_unstable-9cc685c5.so.4.3a0.dev202505281326 → libgtsam_unstable-9cc685c5.so.4.3a0.dev202505281542} +0 -0
- gtsam_unstable/gtsam_unstable.cpython-311-aarch64-linux-gnu.so +0 -0
- {gtsam_develop-4.3a0.dev202505281326.dist-info → gtsam_develop-4.3a0.dev202505281542.dist-info}/WHEEL +0 -0
- {gtsam_develop-4.3a0.dev202505281326.dist-info → gtsam_develop-4.3a0.dev202505281542.dist-info}/top_level.txt +0 -0
gtsam/__init__.pyi
CHANGED
|
@@ -2,28 +2,28 @@
|
|
|
2
2
|
Module definition file for GTSAM
|
|
3
3
|
"""
|
|
4
4
|
from __future__ import annotations
|
|
5
|
-
from builtins import dict as KeyPairDoubleMap
|
|
6
|
-
from builtins import dict as IndexPairSetMap
|
|
7
5
|
from builtins import dict as MatchIndicesMap
|
|
8
|
-
from builtins import
|
|
9
|
-
from builtins import
|
|
10
|
-
from builtins import list as SfmCameras
|
|
11
|
-
from builtins import list as Point2Vector
|
|
6
|
+
from builtins import dict as IndexPairSetMap
|
|
7
|
+
from builtins import dict as KeyPairDoubleMap
|
|
12
8
|
from builtins import list as SfmTracks
|
|
13
|
-
from builtins import list as
|
|
9
|
+
from builtins import list as BetweenFactorPose2s
|
|
14
10
|
from builtins import list as KeyVector
|
|
11
|
+
from builtins import list as Pose3Vector
|
|
15
12
|
from builtins import list as SfmTrack2dVector
|
|
16
|
-
from builtins import list as
|
|
13
|
+
from builtins import list as BinaryMeasurementsUnit3
|
|
14
|
+
from builtins import list as SfmCameras
|
|
15
|
+
from builtins import list as Point2Pairs
|
|
16
|
+
from builtins import list as SfmMeasurementVector
|
|
17
|
+
from builtins import list as Rot3Vector
|
|
18
|
+
from builtins import list as BinaryMeasurementsPoint3
|
|
19
|
+
from builtins import list as BinaryMeasurementsRot3
|
|
20
|
+
from builtins import list as Point2Vector
|
|
17
21
|
from builtins import list as Point3Pairs
|
|
22
|
+
from builtins import list as Pose3Pairs
|
|
18
23
|
from builtins import list as IndexPairVector
|
|
19
|
-
from builtins import list as Pose3Vector
|
|
20
|
-
from builtins import list as SfmMeasurementVector
|
|
21
24
|
from builtins import list as Pose2Pairs
|
|
22
25
|
from builtins import list as BetweenFactorPose3s
|
|
23
|
-
from builtins import list as
|
|
24
|
-
from builtins import list as BinaryMeasurementsRot3
|
|
25
|
-
from builtins import list as Pose3Pairs
|
|
26
|
-
from builtins import list as Point2Pairs
|
|
26
|
+
from builtins import list as KeypointsVector
|
|
27
27
|
from gtsam.gtsam import AHRSFactor
|
|
28
28
|
from gtsam.gtsam import AcceleratingScenario
|
|
29
29
|
from gtsam.gtsam import BarometricFactor
|
gtsam/gtsam/__init__.pyi
CHANGED
|
@@ -6173,6 +6173,9 @@ class HybridValues:
|
|
|
6173
6173
|
@typing.overload
|
|
6174
6174
|
def __init__(self, cv: VectorValues, dv: DiscreteValues) -> None:
|
|
6175
6175
|
...
|
|
6176
|
+
@typing.overload
|
|
6177
|
+
def __init__(self, cv: VectorValues, dv: DiscreteValues, v: Values) -> None:
|
|
6178
|
+
...
|
|
6176
6179
|
def __repr__(self, s: str = 'HybridValues', keyFormatter: typing.Callable[[int], str] = ...) -> str:
|
|
6177
6180
|
...
|
|
6178
6181
|
def at(self, j: int) -> numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]:
|
|
@@ -6195,6 +6198,22 @@ class HybridValues:
|
|
|
6195
6198
|
"""
|
|
6196
6199
|
equals required byTestablefor unit testing
|
|
6197
6200
|
"""
|
|
6201
|
+
def exists(self, j: int) -> bool:
|
|
6202
|
+
"""
|
|
6203
|
+
Check whether a variable with keyjexists.
|
|
6204
|
+
"""
|
|
6205
|
+
def existsDiscrete(self, j: int) -> bool:
|
|
6206
|
+
"""
|
|
6207
|
+
Check whether a variable with keyjexists inDiscreteValues.
|
|
6208
|
+
"""
|
|
6209
|
+
def existsNonlinear(self, j: int) -> bool:
|
|
6210
|
+
"""
|
|
6211
|
+
Check whether a variable with keyjexists in values.
|
|
6212
|
+
"""
|
|
6213
|
+
def existsVector(self, j: int) -> bool:
|
|
6214
|
+
"""
|
|
6215
|
+
Check whether a variable with keyjexists inVectorValues.
|
|
6216
|
+
"""
|
|
6198
6217
|
@typing.overload
|
|
6199
6218
|
def insert(self, j: int, value: int) -> None:
|
|
6200
6219
|
"""
|
|
@@ -6228,6 +6247,13 @@ class HybridValues:
|
|
|
6228
6247
|
Throws an invalid_argument exception if any keys to be inserted are already used.
|
|
6229
6248
|
"""
|
|
6230
6249
|
@typing.overload
|
|
6250
|
+
def insert(self, values: Values) -> None:
|
|
6251
|
+
"""
|
|
6252
|
+
Insert all values fromvalues.
|
|
6253
|
+
|
|
6254
|
+
Throws an invalid_argument exception if any keys to be inserted are already used.
|
|
6255
|
+
"""
|
|
6256
|
+
@typing.overload
|
|
6231
6257
|
def insert(self, values: HybridValues) -> None:
|
|
6232
6258
|
"""
|
|
6233
6259
|
Insert all values fromvalues.
|
|
@@ -6235,6 +6261,123 @@ class HybridValues:
|
|
|
6235
6261
|
Throws an invalid_argument exception if any keys to be inserted are already used.
|
|
6236
6262
|
"""
|
|
6237
6263
|
@typing.overload
|
|
6264
|
+
def insertNonlinear(self, j: int, vector: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
|
|
6265
|
+
...
|
|
6266
|
+
@typing.overload
|
|
6267
|
+
def insertNonlinear(self, j: int, matrix: numpy.ndarray[tuple[M, N], numpy.dtype[numpy.float64]]) -> None:
|
|
6268
|
+
...
|
|
6269
|
+
@typing.overload
|
|
6270
|
+
def insertNonlinear(self, j: int, point2: numpy.ndarray[tuple[typing.Literal[2], typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
|
|
6271
|
+
...
|
|
6272
|
+
@typing.overload
|
|
6273
|
+
def insertNonlinear(self, j: int, point3: numpy.ndarray[tuple[typing.Literal[3], typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
|
|
6274
|
+
...
|
|
6275
|
+
@typing.overload
|
|
6276
|
+
def insertNonlinear(self, j: int, rot2: Rot2) -> None:
|
|
6277
|
+
...
|
|
6278
|
+
@typing.overload
|
|
6279
|
+
def insertNonlinear(self, j: int, pose2: Pose2) -> None:
|
|
6280
|
+
...
|
|
6281
|
+
@typing.overload
|
|
6282
|
+
def insertNonlinear(self, j: int, R: SO3) -> None:
|
|
6283
|
+
...
|
|
6284
|
+
@typing.overload
|
|
6285
|
+
def insertNonlinear(self, j: int, Q: SO4) -> None:
|
|
6286
|
+
...
|
|
6287
|
+
@typing.overload
|
|
6288
|
+
def insertNonlinear(self, j: int, P: SOn) -> None:
|
|
6289
|
+
...
|
|
6290
|
+
@typing.overload
|
|
6291
|
+
def insertNonlinear(self, j: int, rot3: Rot3) -> None:
|
|
6292
|
+
...
|
|
6293
|
+
@typing.overload
|
|
6294
|
+
def insertNonlinear(self, j: int, pose3: Pose3) -> None:
|
|
6295
|
+
...
|
|
6296
|
+
@typing.overload
|
|
6297
|
+
def insertNonlinear(self, j: int, similarity2: Similarity2) -> None:
|
|
6298
|
+
...
|
|
6299
|
+
@typing.overload
|
|
6300
|
+
def insertNonlinear(self, j: int, similarity3: Similarity3) -> None:
|
|
6301
|
+
...
|
|
6302
|
+
@typing.overload
|
|
6303
|
+
def insertNonlinear(self, j: int, unit3: Unit3) -> None:
|
|
6304
|
+
...
|
|
6305
|
+
@typing.overload
|
|
6306
|
+
def insertNonlinear(self, j: int, cal3bundler: Cal3Bundler) -> None:
|
|
6307
|
+
...
|
|
6308
|
+
@typing.overload
|
|
6309
|
+
def insertNonlinear(self, j: int, cal3f: Cal3f) -> None:
|
|
6310
|
+
...
|
|
6311
|
+
@typing.overload
|
|
6312
|
+
def insertNonlinear(self, j: int, cal3_s2: Cal3_S2) -> None:
|
|
6313
|
+
...
|
|
6314
|
+
@typing.overload
|
|
6315
|
+
def insertNonlinear(self, j: int, cal3ds2: Cal3DS2) -> None:
|
|
6316
|
+
...
|
|
6317
|
+
@typing.overload
|
|
6318
|
+
def insertNonlinear(self, j: int, cal3fisheye: Cal3Fisheye) -> None:
|
|
6319
|
+
...
|
|
6320
|
+
@typing.overload
|
|
6321
|
+
def insertNonlinear(self, j: int, cal3unified: Cal3Unified) -> None:
|
|
6322
|
+
...
|
|
6323
|
+
@typing.overload
|
|
6324
|
+
def insertNonlinear(self, j: int, E: EssentialMatrix) -> None:
|
|
6325
|
+
...
|
|
6326
|
+
@typing.overload
|
|
6327
|
+
def insertNonlinear(self, j: int, F: FundamentalMatrix) -> None:
|
|
6328
|
+
...
|
|
6329
|
+
@typing.overload
|
|
6330
|
+
def insertNonlinear(self, j: int, F: SimpleFundamentalMatrix) -> None:
|
|
6331
|
+
...
|
|
6332
|
+
@typing.overload
|
|
6333
|
+
def insertNonlinear(self, j: int, plane: OrientedPlane3) -> None:
|
|
6334
|
+
...
|
|
6335
|
+
@typing.overload
|
|
6336
|
+
def insertNonlinear(self, j: int, camera: PinholeCameraCal3Bundler) -> None:
|
|
6337
|
+
...
|
|
6338
|
+
@typing.overload
|
|
6339
|
+
def insertNonlinear(self, j: int, camera: PinholeCameraCal3f) -> None:
|
|
6340
|
+
...
|
|
6341
|
+
@typing.overload
|
|
6342
|
+
def insertNonlinear(self, j: int, camera: PinholeCameraCal3_S2) -> None:
|
|
6343
|
+
...
|
|
6344
|
+
@typing.overload
|
|
6345
|
+
def insertNonlinear(self, j: int, camera: PinholeCameraCal3DS2) -> None:
|
|
6346
|
+
...
|
|
6347
|
+
@typing.overload
|
|
6348
|
+
def insertNonlinear(self, j: int, camera: PinholeCameraCal3Fisheye) -> None:
|
|
6349
|
+
...
|
|
6350
|
+
@typing.overload
|
|
6351
|
+
def insertNonlinear(self, j: int, camera: PinholeCameraCal3Unified) -> None:
|
|
6352
|
+
...
|
|
6353
|
+
@typing.overload
|
|
6354
|
+
def insertNonlinear(self, j: int, camera: PinholePoseCal3Bundler) -> None:
|
|
6355
|
+
...
|
|
6356
|
+
@typing.overload
|
|
6357
|
+
def insertNonlinear(self, j: int, camera: ...) -> None:
|
|
6358
|
+
...
|
|
6359
|
+
@typing.overload
|
|
6360
|
+
def insertNonlinear(self, j: int, camera: PinholePoseCal3_S2) -> None:
|
|
6361
|
+
...
|
|
6362
|
+
@typing.overload
|
|
6363
|
+
def insertNonlinear(self, j: int, camera: PinholePoseCal3DS2) -> None:
|
|
6364
|
+
...
|
|
6365
|
+
@typing.overload
|
|
6366
|
+
def insertNonlinear(self, j: int, camera: PinholePoseCal3Fisheye) -> None:
|
|
6367
|
+
...
|
|
6368
|
+
@typing.overload
|
|
6369
|
+
def insertNonlinear(self, j: int, camera: PinholePoseCal3Unified) -> None:
|
|
6370
|
+
...
|
|
6371
|
+
@typing.overload
|
|
6372
|
+
def insertNonlinear(self, j: int, constant_bias: imuBias.ConstantBias) -> None:
|
|
6373
|
+
...
|
|
6374
|
+
@typing.overload
|
|
6375
|
+
def insertNonlinear(self, j: int, nav_state: NavState) -> None:
|
|
6376
|
+
...
|
|
6377
|
+
@typing.overload
|
|
6378
|
+
def insertNonlinear(self, j: int, c: float) -> None:
|
|
6379
|
+
...
|
|
6380
|
+
@typing.overload
|
|
6238
6381
|
def insert_or_assign(self, j: int, value: numpy.ndarray[tuple[M, typing.Literal[1]], numpy.dtype[numpy.float64]]) -> None:
|
|
6239
6382
|
"""
|
|
6240
6383
|
insert_or_assign(), similar toValues.h
|
|
@@ -6244,10 +6387,21 @@ class HybridValues:
|
|
|
6244
6387
|
"""
|
|
6245
6388
|
insert_or_assign(), similar toValues.h
|
|
6246
6389
|
"""
|
|
6390
|
+
def nonlinear(self) -> Values:
|
|
6391
|
+
"""
|
|
6392
|
+
Return the nonlinear values.
|
|
6393
|
+
"""
|
|
6247
6394
|
def print(self, s: str = 'HybridValues', keyFormatter: typing.Callable[[int], str] = ...) -> None:
|
|
6248
6395
|
"""
|
|
6249
6396
|
print required byTestablefor unit testing
|
|
6250
6397
|
"""
|
|
6398
|
+
def retract(self, delta: VectorValues) -> HybridValues:
|
|
6399
|
+
"""
|
|
6400
|
+
Add a delta config to current config and returns a new config.
|
|
6401
|
+
|
|
6402
|
+
Args:
|
|
6403
|
+
delta: The delta to be added.
|
|
6404
|
+
"""
|
|
6251
6405
|
@typing.overload
|
|
6252
6406
|
def update(self, values: VectorValues) -> None:
|
|
6253
6407
|
"""
|
|
@@ -6263,6 +6417,13 @@ class HybridValues:
|
|
|
6263
6417
|
Throws std::out_of_range if any keys in values are not present in this object.
|
|
6264
6418
|
"""
|
|
6265
6419
|
@typing.overload
|
|
6420
|
+
def update(self, values: Values) -> None:
|
|
6421
|
+
"""
|
|
6422
|
+
For all key/value pairs invalues, replace nonlinear values with corresponding keys in this object with those invalues.
|
|
6423
|
+
|
|
6424
|
+
Throws std::out_of_range if any keys in values are not present in this object.
|
|
6425
|
+
"""
|
|
6426
|
+
@typing.overload
|
|
6266
6427
|
def update(self, values: HybridValues) -> None:
|
|
6267
6428
|
"""
|
|
6268
6429
|
For all key/value pairs invalues, replace all values with corresponding keys in this object with those invalues.
|
|
Binary file
|
gtsam/tests/test_HybridValues.py
CHANGED
|
@@ -6,16 +6,15 @@ All Rights Reserved
|
|
|
6
6
|
See LICENSE for the license information
|
|
7
7
|
|
|
8
8
|
Unit tests for Hybrid Values.
|
|
9
|
-
Author: Shangjie Xue
|
|
9
|
+
Author: Shangjie Xue, Varun Agrawal, Frank Dellaert
|
|
10
10
|
"""
|
|
11
|
-
# pylint: disable=invalid-name, no-name-in-module, no-member
|
|
12
11
|
|
|
13
|
-
|
|
12
|
+
# pylint: disable=invalid-name, no-name-in-module, no-member
|
|
14
13
|
|
|
15
14
|
import unittest
|
|
16
15
|
|
|
17
16
|
import numpy as np
|
|
18
|
-
from gtsam.symbol_shorthand import
|
|
17
|
+
from gtsam.symbol_shorthand import D, V, M
|
|
19
18
|
from gtsam.utils.test_case import GtsamTestCase
|
|
20
19
|
|
|
21
20
|
import gtsam
|
|
@@ -24,19 +23,216 @@ import gtsam
|
|
|
24
23
|
class TestHybridValues(GtsamTestCase):
|
|
25
24
|
"""Unit tests for HybridValues."""
|
|
26
25
|
|
|
27
|
-
def
|
|
28
|
-
"""
|
|
26
|
+
def setUp(self):
|
|
27
|
+
"""Set up common objects for tests."""
|
|
28
|
+
self.vector_values = gtsam.VectorValues()
|
|
29
|
+
self.vector_values.insert(V(0), np.array([1.0, 2.0]))
|
|
30
|
+
self.vector_values.insert(V(1), np.array([3.0]))
|
|
31
|
+
|
|
32
|
+
self.discrete_values = gtsam.DiscreteValues()
|
|
33
|
+
self.discrete_values[D(0)] = 1
|
|
34
|
+
self.discrete_values[D(1)] = 0
|
|
35
|
+
|
|
36
|
+
self.nonlinear_values = gtsam.Values()
|
|
37
|
+
self.nonlinear_values.insert(M(5), gtsam.Pose2(1, 2, 0.3))
|
|
38
|
+
|
|
39
|
+
def test_constructors(self):
|
|
40
|
+
"""Test various constructors."""
|
|
41
|
+
hv_empty = gtsam.HybridValues()
|
|
42
|
+
self.assertEqual(hv_empty.continuous().size(), 0)
|
|
43
|
+
self.assertEqual(len(hv_empty.discrete()), 0)
|
|
44
|
+
self.assertEqual(hv_empty.nonlinear().size(), 0)
|
|
45
|
+
|
|
46
|
+
hv_vd = gtsam.HybridValues(self.vector_values, self.discrete_values)
|
|
47
|
+
self.assertEqual(hv_vd.continuous().size(), 2)
|
|
48
|
+
self.assertEqual(len(hv_vd.discrete()), 2)
|
|
49
|
+
self.assertEqual(hv_vd.nonlinear().size(), 0)
|
|
50
|
+
self.assertTrue(hv_vd.continuous().equals(self.vector_values, 1e-9))
|
|
51
|
+
# DiscreteValues comparison needs to be element-wise or via string
|
|
52
|
+
self.assertEqual(hv_vd.discrete()[D(0)], self.discrete_values[D(0)])
|
|
53
|
+
|
|
54
|
+
hv_all = gtsam.HybridValues(
|
|
55
|
+
self.vector_values, self.discrete_values, self.nonlinear_values
|
|
56
|
+
)
|
|
57
|
+
self.assertEqual(hv_all.continuous().size(), 2)
|
|
58
|
+
self.assertEqual(len(hv_all.discrete()), 2)
|
|
59
|
+
self.assertEqual(hv_all.nonlinear().size(), 1)
|
|
60
|
+
self.assertTrue(hv_all.nonlinear().equals(self.nonlinear_values, 1e-9))
|
|
61
|
+
|
|
62
|
+
def test_accessors(self):
|
|
63
|
+
"""Test accessing underlying containers."""
|
|
64
|
+
hv_all = gtsam.HybridValues(
|
|
65
|
+
self.vector_values, self.discrete_values, self.nonlinear_values
|
|
66
|
+
)
|
|
67
|
+
|
|
68
|
+
self.assertTrue(hv_all.continuous().equals(self.vector_values, 1e-9))
|
|
69
|
+
# Compare DiscreteValues content
|
|
70
|
+
retrieved_dv = hv_all.discrete()
|
|
71
|
+
self.assertEqual(len(retrieved_dv), len(self.discrete_values))
|
|
72
|
+
for k, v in self.discrete_values.items():
|
|
73
|
+
self.assertEqual(retrieved_dv[k], v)
|
|
74
|
+
self.assertTrue(hv_all.nonlinear().equals(self.nonlinear_values, 1e-9))
|
|
75
|
+
|
|
76
|
+
# Test at methods
|
|
77
|
+
self.gtsamAssertEquals(hv_all.at(V(0)), self.vector_values.at(V(0)), 1e-9)
|
|
78
|
+
self.assertEqual(hv_all.atDiscrete(D(0)), self.discrete_values[D(0)])
|
|
79
|
+
# For nonlinear, access via nonlinear().atTYPE()
|
|
80
|
+
self.assertTrue(
|
|
81
|
+
hv_all.nonlinear()
|
|
82
|
+
.atPose2(M(5))
|
|
83
|
+
.equals(self.nonlinear_values.atPose2(M(5)), 1e-9)
|
|
84
|
+
)
|
|
85
|
+
|
|
86
|
+
def test_exists(self):
|
|
87
|
+
"""Test existence checks."""
|
|
88
|
+
hv_all = gtsam.HybridValues(
|
|
89
|
+
self.vector_values, self.discrete_values, self.nonlinear_values
|
|
90
|
+
)
|
|
91
|
+
|
|
92
|
+
self.assertTrue(hv_all.existsVector(V(0)))
|
|
93
|
+
self.assertFalse(hv_all.existsVector(D(0))) # Key for discrete
|
|
94
|
+
self.assertFalse(hv_all.existsVector(M(5))) # Key for nonlinear
|
|
95
|
+
|
|
96
|
+
self.assertTrue(hv_all.existsDiscrete(D(1)))
|
|
97
|
+
self.assertFalse(hv_all.existsDiscrete(V(0))) # Key for vector
|
|
98
|
+
|
|
99
|
+
self.assertTrue(hv_all.existsNonlinear(M(5)))
|
|
100
|
+
self.assertFalse(hv_all.existsNonlinear(V(0))) # Key for vector
|
|
101
|
+
|
|
102
|
+
# General exists (checks nonlinear, then vector, then discrete)
|
|
103
|
+
self.assertTrue(hv_all.exists(V(0))) # Vector
|
|
104
|
+
self.assertTrue(hv_all.exists(D(0))) # Discrete
|
|
105
|
+
self.assertTrue(hv_all.exists(M(5))) # Nonlinear
|
|
106
|
+
self.assertFalse(hv_all.exists(D(7))) # Non-existent key
|
|
107
|
+
|
|
108
|
+
def test_equals(self):
|
|
109
|
+
"""Test equals method."""
|
|
110
|
+
hv1 = gtsam.HybridValues(
|
|
111
|
+
self.vector_values, self.discrete_values, self.nonlinear_values
|
|
112
|
+
)
|
|
113
|
+
hv2 = gtsam.HybridValues(
|
|
114
|
+
self.vector_values, self.discrete_values, self.nonlinear_values
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
self.assertTrue(hv1.equals(hv2, 1e-9))
|
|
118
|
+
|
|
119
|
+
def test_insert_individual(self):
|
|
120
|
+
"""Test inserting individual values."""
|
|
121
|
+
hv = gtsam.HybridValues()
|
|
122
|
+
hv.insert(V(10), np.array([1.0]))
|
|
123
|
+
hv.insert(D(10), 1)
|
|
124
|
+
hv.insertNonlinear(M(11), gtsam.Pose2())
|
|
125
|
+
|
|
126
|
+
self.assertTrue(hv.existsVector(V(10)))
|
|
127
|
+
self.gtsamAssertEquals(hv.at(V(10)), np.array([1.0]))
|
|
128
|
+
self.assertTrue(hv.existsDiscrete(D(10)))
|
|
129
|
+
self.assertEqual(hv.atDiscrete(D(10)), 1)
|
|
130
|
+
|
|
131
|
+
def test_insert_containers(self):
|
|
132
|
+
"""Test inserting from other Values containers."""
|
|
133
|
+
hv = gtsam.HybridValues()
|
|
134
|
+
|
|
135
|
+
hv.insert(self.vector_values)
|
|
136
|
+
self.assertEqual(hv.continuous().size(), 2)
|
|
137
|
+
self.assertTrue(hv.continuous().equals(self.vector_values, 1e-9))
|
|
138
|
+
|
|
139
|
+
hv.insert(self.discrete_values)
|
|
140
|
+
self.assertEqual(len(hv.discrete()), 2)
|
|
141
|
+
# Check discrete values equality
|
|
142
|
+
retrieved_dv = hv.discrete()
|
|
143
|
+
for k, v in self.discrete_values.items():
|
|
144
|
+
self.assertEqual(retrieved_dv[k], v)
|
|
145
|
+
|
|
146
|
+
hv.insert(self.nonlinear_values)
|
|
147
|
+
self.assertEqual(hv.nonlinear().size(), 1)
|
|
148
|
+
self.assertTrue(hv.nonlinear().equals(self.nonlinear_values, 1e-9))
|
|
149
|
+
|
|
150
|
+
hv_copy = gtsam.HybridValues()
|
|
151
|
+
hv_copy.insert(hv) # Test insert(HybridValues)
|
|
152
|
+
self.assertTrue(hv_copy.equals(hv, 1e-9))
|
|
153
|
+
|
|
154
|
+
def test_insert_or_assign(self):
|
|
155
|
+
"""Test insert_or_assign method."""
|
|
156
|
+
hv = gtsam.HybridValues()
|
|
157
|
+
hv.insert(V(0), np.array([1.0]))
|
|
158
|
+
hv.insert(D(0), 0)
|
|
159
|
+
|
|
160
|
+
# Test insert_or_assign for vector
|
|
161
|
+
hv.insert_or_assign(V(0), np.array([2.0])) # Update existing
|
|
162
|
+
self.gtsamAssertEquals(hv.at(V(0)), np.array([2.0]))
|
|
163
|
+
hv.insert_or_assign(V(1), np.array([3.0])) # Insert new
|
|
164
|
+
self.gtsamAssertEquals(hv.at(V(1)), np.array([3.0]))
|
|
165
|
+
|
|
166
|
+
# Test insert_or_assign for discrete
|
|
167
|
+
hv.insert_or_assign(D(0), 1) # Update existing
|
|
168
|
+
self.assertEqual(hv.atDiscrete(D(0)), 1)
|
|
169
|
+
hv.insert_or_assign(D(1), 2) # Insert new
|
|
170
|
+
self.assertEqual(hv.atDiscrete(D(1)), 2)
|
|
171
|
+
|
|
172
|
+
def test_update(self):
|
|
173
|
+
"""Test update methods."""
|
|
174
|
+
hv = gtsam.HybridValues(
|
|
175
|
+
self.vector_values, self.discrete_values, self.nonlinear_values
|
|
176
|
+
)
|
|
177
|
+
|
|
178
|
+
# Update VectorValues
|
|
179
|
+
vv_update = gtsam.VectorValues()
|
|
180
|
+
vv_update.insert(V(0), np.array([10.0, 20.0])) # Existing key
|
|
181
|
+
hv.update(vv_update)
|
|
182
|
+
self.gtsamAssertEquals(hv.at(V(0)), np.array([10.0, 20.0]))
|
|
183
|
+
self.assertEqual(hv.continuous().size(), 2) # X0, X1
|
|
184
|
+
|
|
185
|
+
# Update DiscreteValues
|
|
186
|
+
dv_update = gtsam.DiscreteValues()
|
|
187
|
+
dv_update[D(0)] = 5 # Existing key
|
|
188
|
+
hv.update(dv_update)
|
|
189
|
+
self.assertEqual(hv.atDiscrete(D(0)), 5)
|
|
190
|
+
self.assertEqual(len(hv.discrete()), 2) # C0, C1
|
|
191
|
+
|
|
192
|
+
# Update NonlinearValues
|
|
193
|
+
nv_update = gtsam.Values()
|
|
194
|
+
nv_update.insert(M(5), gtsam.Pose2(3, 4, 0.5))
|
|
195
|
+
hv.update(nv_update)
|
|
196
|
+
self.assertTrue(
|
|
197
|
+
hv.nonlinear().atPose2(M(5)).equals(gtsam.Pose2(3, 4, 0.5), 1e-9)
|
|
198
|
+
)
|
|
199
|
+
self.assertEqual(hv.nonlinear().size(), 1)
|
|
200
|
+
|
|
201
|
+
# Update HybridValues (only continuous and discrete parts for now)
|
|
202
|
+
hv_update_source = gtsam.HybridValues()
|
|
203
|
+
vv_source = gtsam.VectorValues()
|
|
204
|
+
vv_source.insert(V(0), np.array([-1.0, -2.0]))
|
|
205
|
+
dv_source = gtsam.DiscreteValues()
|
|
206
|
+
dv_source[D(0)] = 100
|
|
207
|
+
hv_update_source.insert(vv_source)
|
|
208
|
+
hv_update_source.insert(dv_source)
|
|
209
|
+
|
|
210
|
+
hv.update(hv_update_source)
|
|
211
|
+
self.gtsamAssertEquals(hv.at(V(0)), np.array([-1.0, -2.0]))
|
|
212
|
+
self.assertEqual(hv.atDiscrete(D(0)), 100)
|
|
213
|
+
|
|
214
|
+
def test_retract(self):
|
|
215
|
+
"""Test retract method."""
|
|
216
|
+
hv = gtsam.HybridValues(
|
|
217
|
+
self.vector_values, self.discrete_values, self.nonlinear_values
|
|
218
|
+
)
|
|
219
|
+
|
|
220
|
+
delta = gtsam.VectorValues()
|
|
221
|
+
deltaM5 = np.array([0.5, 0.5, -1.0])
|
|
222
|
+
delta.insert(M(5), deltaM5)
|
|
223
|
+
|
|
224
|
+
hv_retracted = hv.retract(delta)
|
|
29
225
|
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
hv1.insert(C(0), 2)
|
|
226
|
+
# Original should be unchanged
|
|
227
|
+
self.assertTrue(hv.continuous().equals(self.vector_values, 1e-9))
|
|
33
228
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
229
|
+
# Check retracted values
|
|
230
|
+
expected_M5 = hv.nonlinear().atPose2(M(5)).retract(deltaM5)
|
|
231
|
+
self.gtsamAssertEquals(hv_retracted.nonlinear().atPose2(M(5)), expected_M5)
|
|
37
232
|
|
|
38
|
-
|
|
39
|
-
self.assertEqual(
|
|
233
|
+
# Check that discrete and continuous parts are copied
|
|
234
|
+
self.assertEqual(len(hv_retracted.discrete()), len(self.discrete_values))
|
|
235
|
+
self.assertEqual(hv_retracted.continuous().size(), self.vector_values.size())
|
|
40
236
|
|
|
41
237
|
|
|
42
238
|
if __name__ == "__main__":
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
gtsam/__init__.py,sha256=6G-WPnb_FMQEJXNDDAmrKrQPau7evtd5svhTmMqhYSI,2011
|
|
2
|
-
gtsam/__init__.pyi,sha256=
|
|
3
|
-
gtsam/gtsam.cpython-311-aarch64-linux-gnu.so,sha256=
|
|
2
|
+
gtsam/__init__.pyi,sha256=0G9DT2qPySO5vDclcTF2QFaSyHyepITVRqLLCaxv3Tg,42970
|
|
3
|
+
gtsam/gtsam.cpython-311-aarch64-linux-gnu.so,sha256=YGOJRdlfL5XQ8WjM2HoN5p-9cfXC9PMW9sjKMes-pGI,22392945
|
|
4
4
|
gtsam/gtsfm.py,sha256=Udlkb6o5iUk69uxBkb88-W1GLfu1g8iSuZlLu-RRU0o,202
|
|
5
5
|
gtsam/imuBias.py,sha256=tz3bOCFl29iMycbGFoF-ud6kRsJYjA7DJ2RJoKPFRU8,209
|
|
6
6
|
gtsam/noiseModel.py,sha256=ybfIHa4sLXe78_k-Dib8nTaw34BRXqEDVtS2B9dzSO0,217
|
|
@@ -114,7 +114,7 @@ gtsam/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
|
114
114
|
gtsam/examples/gtsam_plotly.py,sha256=bTXAzZ3i_RunKrdGwFLsMsetYYleQrzDa50ekmrt_nQ,17073
|
|
115
115
|
gtsam/examples/plot_city10000.py,sha256=xsM1HFlcBn6TqEqQtZjlOl0WQI6tVZMgjtKdYIusbyE,3353
|
|
116
116
|
gtsam/examples/simulation.py,sha256=VAopcCosvdtXRy6xe547EDz73lXhLiYbPnFQZWjo2wU,5405
|
|
117
|
-
gtsam/gtsam/__init__.pyi,sha256=
|
|
117
|
+
gtsam/gtsam/__init__.pyi,sha256=ooTcq5Q5mu9rjfVFRjGQbCoXeBC-vGiae__WW_R_ppU,716768
|
|
118
118
|
gtsam/gtsam/gtsfm.pyi,sha256=Onoh4CRaSYIQ0FID0vBkZeV7ESIhc2fh4rJGgaPY-ug,702
|
|
119
119
|
gtsam/gtsam/imuBias.pyi,sha256=gD6w5kd9xpO4uBEpfNym_3LjW67MV7HPQRYOOoDPysQ,2478
|
|
120
120
|
gtsam/gtsam/lago.pyi,sha256=-VzJaQ1ho25n7S4VjbugWmPNUtKeMsoESifX9K8l2Yo,551
|
|
@@ -183,7 +183,7 @@ gtsam/tests/test_GraphvizFormatting.py,sha256=q0SvlNriwuHQ5trzJ_o8cEQusD8H9Q-MzU
|
|
|
183
183
|
gtsam/tests/test_HybridBayesNet.py,sha256=4NTWAiUqeUSsHwjwdaW7rS3zodw0RtlDuon7l97lc5A,3467
|
|
184
184
|
gtsam/tests/test_HybridFactorGraph.py,sha256=_tJld82_p_AxkqMQdeL11PEA5xTk-p21Fj1RLPvhljE,13093
|
|
185
185
|
gtsam/tests/test_HybridNonlinearFactorGraph.py,sha256=8XFH9CidtrhDeKSr_x5mS5QtK_aEvJfhEcPUrCSlJgI,1729
|
|
186
|
-
gtsam/tests/test_HybridValues.py,sha256=
|
|
186
|
+
gtsam/tests/test_HybridValues.py,sha256=DtgMnPFoifEuce0hS-gOozLFqfheVfwPO8ehQhpigtc,9027
|
|
187
187
|
gtsam/tests/test_JacobianFactor.py,sha256=KfmbVGocm0sW-iwE23ErKzrhoYSS8VE4YUU2sG_v2lU,2704
|
|
188
188
|
gtsam/tests/test_KalmanFilter.py,sha256=OinaR5eDHP9kYzn-CDvtX2FiPdOW15EkGExGIrSzCA0,3334
|
|
189
189
|
gtsam/tests/test_KarcherMeanFactor.py,sha256=L3_VAOljyRDmyOjOlZqnW-5apqufsDd8UnLIZ-d-_VE,2369
|
|
@@ -246,17 +246,17 @@ gtsam_develop.libs/libboost_system-0f8f8a6a.so.1.87.0,sha256=vG7c-nCNDFk9UrmGaYj
|
|
|
246
246
|
gtsam_develop.libs/libboost_thread-e6217d1e.so.1.87.0,sha256=E2jFMpQ_xgH8mzebJPVAo9JKwZRF0cTUZx4q4aDVVKo,357745
|
|
247
247
|
gtsam_develop.libs/libboost_timer-c03b5720.so.1.87.0,sha256=C-jrqHaflQqKfg88hGhzFRof8w0WX5Lw-N56zLtD3CE,133249
|
|
248
248
|
gtsam_develop.libs/libcephes-gtsam-906422bf.so.1.0.0,sha256=aX4Q_2V2F1uwqCEdNkLhzOzgGWLf2cTeZn9OJeRcSvY,264913
|
|
249
|
-
gtsam_develop.libs/libgtsam-
|
|
250
|
-
gtsam_develop.libs/libgtsam_unstable-9cc685c5.so.4.3a0.
|
|
249
|
+
gtsam_develop.libs/libgtsam-d5b5c340.so.4.3a0.dev202505281542,sha256=MoOgJZQAdKouvlUZINIfdnKq41LUFadCEJSiU62YAsY,10774073
|
|
250
|
+
gtsam_develop.libs/libgtsam_unstable-9cc685c5.so.4.3a0.dev202505281542,sha256=glzNt-zQDl4-WEc73naOPiQbXoydE1m8YHei4MgA1PA,2585473
|
|
251
251
|
gtsam_develop.libs/libmetis-gtsam-b7310f3a.so,sha256=6Y9LebAEnr8OFCzKGxK2KADmtBGIq3XnzDpXF7jMX4A,546689
|
|
252
252
|
gtsam_unstable/__init__.py,sha256=FPc_oO5PFQZbrfpgugzQuI6LJfP1fzq82UQf_nuyGtk,30
|
|
253
|
-
gtsam_unstable/gtsam_unstable.cpython-311-aarch64-linux-gnu.so,sha256=
|
|
253
|
+
gtsam_unstable/gtsam_unstable.cpython-311-aarch64-linux-gnu.so,sha256=LJprlFG7druS2JqoDyJmJBCYRHEYc03qa3QyrD4lCh8,2715681
|
|
254
254
|
gtsam_unstable/examples/LocalizationExample.py,sha256=na47I1PQ_5Tenj8Wg2LBg3GaqP32O4yEb8jtRWKu0P8,2882
|
|
255
255
|
gtsam_unstable/examples/TimeOfArrivalExample.py,sha256=uky5ps4Ng83C0Q_s2EAc64Af6iztQjXXdj3ahifRXoI,3737
|
|
256
256
|
gtsam_unstable/examples/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
257
257
|
gtsam_unstable/tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
258
258
|
gtsam_unstable/tests/test_ProjectionFactorRollingShutter.py,sha256=t2l62uWoXfjrM8oH6ogV7M20WjTYKZ4CSferdurMIY0,2156
|
|
259
|
-
gtsam_develop-4.3a0.
|
|
260
|
-
gtsam_develop-4.3a0.
|
|
261
|
-
gtsam_develop-4.3a0.
|
|
262
|
-
gtsam_develop-4.3a0.
|
|
259
|
+
gtsam_develop-4.3a0.dev202505281542.dist-info/METADATA,sha256=Q2D0kXkx4iN9Lv3sKMDxAiLHu1r7sVCJTvRfDhdaWHE,7767
|
|
260
|
+
gtsam_develop-4.3a0.dev202505281542.dist-info/WHEEL,sha256=QJg38rE8f0PT7_ZWlFpvwOoUFGenUbSJhXM-6SbDiao,153
|
|
261
|
+
gtsam_develop-4.3a0.dev202505281542.dist-info/top_level.txt,sha256=DOnqfd8DN2HpG5-V5t32TjFOB_vcYuyOWyRsgeoANEo,30
|
|
262
|
+
gtsam_develop-4.3a0.dev202505281542.dist-info/RECORD,,
|
|
index 365ed52..faab537 100755
|
|
|
Binary file
|
|
index de9591f..b2daa12 100755
|
|
|
Binary file
|
|
Binary file
|
|
File without changes
|
|
File without changes
|