Liner and update Cmakelists

release/4.3a0
Jeremy Aguilon 2019-02-27 13:04:38 -05:00
parent 42ac0e589e
commit 5e97efa815
5 changed files with 31 additions and 5 deletions

1
THANKS
View File

@ -1,5 +1,6 @@
GTSAM was made possible by the efforts of many collaborators at Georgia Tech, listed below with their current afffiliation, if they left Tech: GTSAM was made possible by the efforts of many collaborators at Georgia Tech, listed below with their current afffiliation, if they left Tech:
* Jeremy Aguilon
* Sungtae An * Sungtae An
* Doru Balcan, Bank of America * Doru Balcan, Bank of America
* Chris Beall * Chris Beall

View File

@ -26,8 +26,7 @@ if (GTSAM_INSTALL_CYTHON_TOOLBOX)
gtsam_unstable # library to link with gtsam_unstable # library to link with
"gtsam_unstable;gtsam_unstable_header;cythonize_gtsam" # dependencies to be built before wrapping "gtsam_unstable;gtsam_unstable_header;cythonize_gtsam" # dependencies to be built before wrapping
) )
# for some reasons cython gtsam_unstable can't find gtsam/gtsam.pxd without doing this configure_file(${PROJECT_SOURCE_DIR}/cython/gtsam_unstable/__init__.py.in ${PROJECT_BINARY_DIR}/cython/gtsam_unstable/__init__.py)
file(WRITE ${PROJECT_BINARY_DIR}/cython/gtsam_unstable/__init__.py "")
endif() endif()
# Install the custom-generated __init__.py # Install the custom-generated __init__.py

View File

@ -0,0 +1 @@
from gtsam_unstable import *

View File

@ -1,4 +1,11 @@
""" """
GTSAM Copyright 2010-2018, Georgia Tech Research Corporation,
Atlanta, Georgia 30332-0415
All Rights Reserved
Authors: Frank Dellaert, et al. (see THANKS for the full author list)
See LICENSE for the license information
Demonstration of the fixed-lag smoothers using a planar robot example Demonstration of the fixed-lag smoothers using a planar robot example
and multiple odometry-like sensors and multiple odometry-like sensors
Author: Frank Dellaert (C++), Jeremy Aguilon (Python) Author: Frank Dellaert (C++), Jeremy Aguilon (Python)
@ -11,12 +18,21 @@ import gtsam_unstable
def _timestamp_key_value(key, value): def _timestamp_key_value(key, value):
"""
"""
return gtsam_unstable.FixedLagSmootherKeyTimestampMapValue( return gtsam_unstable.FixedLagSmootherKeyTimestampMapValue(
key, value key, value
) )
def BatchFixedLagSmootherExample(): def BatchFixedLagSmootherExample():
"""
Runs a batch fixed smoother on an agent with two odometry
sensors that is simply moving along the x axis in constant
speed.
"""
# Define a batch fixed lag smoother, which uses # Define a batch fixed lag smoother, which uses
# Levenberg-Marquardt to perform the nonlinear optimization # Levenberg-Marquardt to perform the nonlinear optimization
lag = 2.0 lag = 2.0
@ -41,6 +57,9 @@ def BatchFixedLagSmootherExample():
delta_time = 0.25 delta_time = 0.25
time = 0.25 time = 0.25
# Iterates from 0.25s to 3.0s, adding 0.25s each loop
# In each iteration, the agent moves at a constant speed
# and its two odometers measure the change.
while time <= 3.0: while time <= 3.0:
previous_key = 1000 * (time - delta_time) previous_key = 1000 * (time - delta_time)
current_key = 1000 * time current_key = 1000 * time

View File

@ -8,9 +8,16 @@ def _timestamp_key_value(key, value):
key, value key, value
) )
class TestFixedLagSmootherExample(unittest.TestCase): class TestFixedLagSmootherExample(unittest.TestCase):
# Simple test that checks for equality between C++ example '''
# file and the Python implementation Tests the fixed lag smoother wrapper
'''
def test_FixedLagSmootherExample(self): def test_FixedLagSmootherExample(self):
'''
Simple test that checks for equality between C++ example
file and the Python implementation. See
gtsam_unstable/examples/FixedLagSmootherExample.cpp
'''
# Define a batch fixed lag smoother, which uses # Define a batch fixed lag smoother, which uses
# Levenberg-Marquardt to perform the nonlinear optimization # Levenberg-Marquardt to perform the nonlinear optimization
lag = 2.0 lag = 2.0
@ -81,7 +88,6 @@ class TestFixedLagSmootherExample(unittest.TestCase):
estimate = smoother_batch.calculateEstimatePose2(current_key) estimate = smoother_batch.calculateEstimatePose2(current_key)
self.assertTrue(estimate.equals(ground_truth[i], 1e-4)) self.assertTrue(estimate.equals(ground_truth[i], 1e-4))
print("PASS")
new_timestamps.clear() new_timestamps.clear()
new_values.clear() new_values.clear()