2020-09-01 01:56:56 +08:00
|
|
|
from . import utils
|
2019-02-08 23:34:09 +08:00
|
|
|
from .gtsam import *
|
2020-09-01 01:56:56 +08:00
|
|
|
from .utils import findExampleDataFile
|
2019-03-07 17:11:16 +08:00
|
|
|
|
|
|
|
|
|
2020-08-18 23:03:51 +08:00
|
|
|
def _init():
|
|
|
|
|
"""This function is to add shims for the long-gone Point2 and Point3 types"""
|
2019-03-07 17:11:16 +08:00
|
|
|
|
2020-08-18 23:03:51 +08:00
|
|
|
import numpy as np
|
2019-03-07 17:11:16 +08:00
|
|
|
|
2020-08-18 23:03:51 +08:00
|
|
|
global Point2 # export function
|
2019-03-07 18:05:02 +08:00
|
|
|
|
2020-08-21 23:01:08 +08:00
|
|
|
def Point2(x=np.nan, y=np.nan):
|
2020-08-18 23:03:51 +08:00
|
|
|
"""Shim for the deleted Point2 type."""
|
2020-08-21 02:47:55 +08:00
|
|
|
if isinstance(x, np.ndarray):
|
|
|
|
|
assert x.shape == (2,), "Point2 takes 2-vector"
|
|
|
|
|
return x # "copy constructor"
|
2020-08-18 23:03:51 +08:00
|
|
|
return np.array([x, y], dtype=float)
|
2019-03-07 18:05:02 +08:00
|
|
|
|
2020-08-18 23:03:51 +08:00
|
|
|
global Point3 # export function
|
2019-03-07 17:11:16 +08:00
|
|
|
|
2020-08-21 23:01:08 +08:00
|
|
|
def Point3(x=np.nan, y=np.nan, z=np.nan):
|
2020-08-18 23:03:51 +08:00
|
|
|
"""Shim for the deleted Point3 type."""
|
2020-08-21 02:47:55 +08:00
|
|
|
if isinstance(x, np.ndarray):
|
|
|
|
|
assert x.shape == (3,), "Point3 takes 3-vector"
|
|
|
|
|
return x # "copy constructor"
|
2020-08-18 23:03:51 +08:00
|
|
|
return np.array([x, y, z], dtype=float)
|
|
|
|
|
|
|
|
|
|
# for interactive debugging
|
|
|
|
|
if __name__ == "__main__":
|
|
|
|
|
# we want all definitions accessible
|
|
|
|
|
globals().update(locals())
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
_init()
|