add setup scripts, fix tests
parent
3478b744e6
commit
d40c0ba491
|
@ -0,0 +1,10 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
# exit if any command returns non-zero
|
||||||
|
set -e
|
||||||
|
# print out each command for debugging
|
||||||
|
set -x
|
||||||
|
|
||||||
|
#usage: wrap [--matlab|--cython] absoluteInterfacePath moduleName toolboxPath headerPath
|
||||||
|
wrap --cython $PWD gtsam $PWD ../
|
||||||
|
|
||||||
|
python setup.py build_ext --inplace
|
|
@ -0,0 +1,6 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
virtualenv venv
|
||||||
|
source venv/bin/activate
|
||||||
|
pip install -r requirements.txt
|
||||||
|
pip install eigency
|
|
@ -1,3 +1,2 @@
|
||||||
numpy>=1.11.1
|
Cython==0.24.1
|
||||||
eigency>=1.66
|
numpy==1.11.1
|
||||||
Cython>=0.24.1
|
|
||||||
|
|
|
@ -3,6 +3,8 @@ from distutils.extension import Extension
|
||||||
from Cython.Build import cythonize
|
from Cython.Build import cythonize
|
||||||
import eigency
|
import eigency
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
setup(
|
setup(
|
||||||
ext_modules = cythonize(Extension(
|
ext_modules = cythonize(Extension(
|
||||||
"gtsam",
|
"gtsam",
|
||||||
|
@ -13,5 +15,6 @@ setup(
|
||||||
|
|
||||||
libraries = ['gtsam'],
|
libraries = ['gtsam'],
|
||||||
library_dirs = ["/Users/dta-huynh/install/lib"],
|
library_dirs = ["/Users/dta-huynh/install/lib"],
|
||||||
language="c++")),
|
language="c++",
|
||||||
|
extra_compile_args=["-std=c++11"])),
|
||||||
)
|
)
|
|
@ -23,24 +23,25 @@ Rmat = np.array([
|
||||||
[0.104218, 0.990074, -0.0942928],
|
[0.104218, 0.990074, -0.0942928],
|
||||||
[-0.0942928, 0.104218, 0.990074]
|
[-0.0942928, 0.104218, 0.990074]
|
||||||
])
|
])
|
||||||
r5 = Rot3.ctor(Rmat)
|
r5 = Rot3.ctor1(Rmat)
|
||||||
r5._print(b"r5: ")
|
r5._print(b"r5: ")
|
||||||
|
|
||||||
l = Rot3.Logmap(r5)
|
l = Rot3.Logmap(r5)
|
||||||
print("l = ", l)
|
print("l = ", l)
|
||||||
|
|
||||||
|
|
||||||
noise = Gaussian.Covariance(Rmat)
|
noise = noiseModel_Gaussian.Covariance(Rmat)
|
||||||
noise._print(b"noise:")
|
noise._print(b"noise:")
|
||||||
|
|
||||||
D = np.array([1.,2.,3.])
|
D = np.array([1.,2.,3.])
|
||||||
diag = Diagonal.Variances(D)
|
diag = noiseModel_Diagonal.Variances(D)
|
||||||
print("diag:", diag)
|
print("diag:", diag)
|
||||||
diag._print(b"diag:")
|
diag._print(b"diag:")
|
||||||
print("diag R:", diag.R())
|
print("diag R:", diag.R())
|
||||||
|
|
||||||
p = Point3()
|
p = Point3()
|
||||||
factor = BetweenFactorPoint3(1,2,p, noise)
|
p._print("p:")
|
||||||
|
factor = BetweenFactorPoint3.ctor(1,2,p, noise)
|
||||||
factor._print(b"factor:")
|
factor._print(b"factor:")
|
||||||
|
|
||||||
vv = VectorValues()
|
vv = VectorValues()
|
||||||
|
@ -50,7 +51,7 @@ vv.insert(2, np.array([3.,4.]))
|
||||||
vv.insert(3, np.array([5.,6.,7.,8.]))
|
vv.insert(3, np.array([5.,6.,7.,8.]))
|
||||||
vv._print(b"vv:")
|
vv._print(b"vv:")
|
||||||
|
|
||||||
vv2 = VectorValues.ctor2(vv)
|
vv2 = VectorValues.ctor1(vv)
|
||||||
vv2.insert(4, np.array([4.,2.,1]))
|
vv2.insert(4, np.array([4.,2.,1]))
|
||||||
vv2._print(b"vv2:")
|
vv2._print(b"vv2:")
|
||||||
vv._print(b"vv:")
|
vv._print(b"vv:")
|
Loading…
Reference in New Issue