Skip to content

Commit

Permalink
[SymForce] cc_sym_test uses GEO_TYPES and CAM_TYPES
Browse files Browse the repository at this point in the history
Instead of manually listing

Topic: sf-ccsym-lists
GitOrigin-RevId: fd469badbc9f4d5265b3bad80ca107d587343073
  • Loading branch information
aaron-skydio authored and nathan-skydio committed Dec 23, 2023
1 parent d7d24d6 commit f3e303d
Showing 1 changed file with 4 additions and 25 deletions.
29 changes: 4 additions & 25 deletions test/symforce_cc_sym_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from lcmtypes.sym._values_t import values_t

import sym
import symforce.symbolic as sf
from symforce import cc_sym
from symforce import typing as T
from symforce.opt import optimizer
Expand Down Expand Up @@ -133,33 +134,11 @@ def test_values(self) -> None:
Tests:
cc_sym.Values
cc_sym.Key
Implicitly tests conversions of sym types:
sym.Rot2
sym.Rot3
sym.Pose2
sym.Pose3
sym.Unit3
sym.ATANCameraCal
sym.DoubleSphereCameraCal
sym.EquirectangularCameraCal
sym.LinearCameraCal
sym.PolynomialCameraCal
sym.SphericalCameraCal
Implicitly tests conversions of all sym types
"""

supported_types = [
T.Scalar,
sym.Rot2,
sym.Rot3,
sym.Pose2,
sym.Pose3,
sym.Unit3,
sym.ATANCameraCal,
sym.DoubleSphereCameraCal,
sym.EquirectangularCameraCal,
sym.LinearCameraCal,
sym.PolynomialCameraCal,
sym.SphericalCameraCal,
supported_types = [T.Scalar] + [
getattr(sym, cls.__name__) for cls in sf.GEO_TYPES + sf.CAM_TYPES
]

def instantiate_type(tp: T.Type[T.Any]) -> T.Any:
Expand Down

0 comments on commit f3e303d

Please sign in to comment.