diff --git a/.cproject b/.cproject index ccd8a6d49..18ea618c7 100644 --- a/.cproject +++ b/.cproject @@ -300,7 +300,6 @@ make - install true true @@ -308,7 +307,6 @@ make - check true true @@ -324,7 +322,6 @@ make - testSimpleCamera.run true true @@ -340,6 +337,7 @@ make + testVSLAMFactor.run true true @@ -347,7 +345,6 @@ make - testCalibratedCamera.run true true @@ -355,6 +352,7 @@ make + testGaussianConditional.run true true @@ -362,7 +360,6 @@ make - testPose2.run true true @@ -370,7 +367,6 @@ make - testRot3.run true true @@ -378,6 +374,7 @@ make + testNonlinearOptimizer.run true true @@ -385,7 +382,6 @@ make - testGaussianFactor.run true true @@ -393,7 +389,6 @@ make - testGaussianFactorGraph.run true true @@ -401,6 +396,7 @@ make + testNonlinearFactorGraph.run true true @@ -408,7 +404,6 @@ make - testPose3.run true true @@ -416,6 +411,7 @@ make + testVectorConfig.run true true @@ -423,6 +419,7 @@ make + testPoint2.run true true @@ -430,7 +427,6 @@ make - testNonlinearFactor.run true true @@ -438,7 +434,6 @@ make - timeGaussianFactor.run true true @@ -446,7 +441,6 @@ make - timeGaussianFactorGraph.run true true @@ -454,7 +448,6 @@ make - testGaussianBayesNet.run true true @@ -462,6 +455,7 @@ make + testBayesTree.run true false @@ -469,7 +463,6 @@ make - testSymbolicBayesNet.run true false @@ -477,6 +470,7 @@ make + testSymbolicFactorGraph.run true false @@ -484,7 +478,6 @@ make - testVector.run true true @@ -492,7 +485,6 @@ make - testMatrix.run true true @@ -500,6 +492,7 @@ make + testVSLAMGraph.run true true @@ -507,6 +500,7 @@ make + testNonlinearEquality.run true true @@ -514,7 +508,6 @@ make - testSQP.run true true @@ -522,6 +515,7 @@ make + testNonlinearConstraint.run true true @@ -529,7 +523,6 @@ make - testSQPOptimizer.run true true @@ -537,7 +530,6 @@ make - testVSLAMConfig.run true true @@ -545,7 +537,6 @@ make - testControlConfig.run true true @@ -553,7 +544,6 @@ make - testControlPoint.run true true @@ -561,6 +551,7 @@ make + testControlGraph.run true true @@ -568,7 +559,6 @@ make - testOrdering.run true true @@ -576,6 +566,7 @@ make + testPose2Constraint.run true true @@ -583,7 +574,6 @@ make - testRot2.run true true @@ -591,14 +581,46 @@ make - testGaussianBayesTree.run true true true + +make + +testPose3Factor.run +true +true +true + + +make + +testUrbanGraph.run +true +true +true + + +make + +testUrbanConfig.run +true +true +true + + +make + +testUrbanMeasurement.run +true +true +true + make + install true true @@ -606,6 +628,7 @@ make + clean true true @@ -613,6 +636,7 @@ make + check true true diff --git a/cpp/Makefile.am b/cpp/Makefile.am index 91411a171..f789de37b 100644 --- a/cpp/Makefile.am +++ b/cpp/Makefile.am @@ -123,35 +123,28 @@ timeGaussianFactorGraph: LDFLAGS += smallExample.o -L.libs -lgtsam -L../CppUnitL # Nonlinear inference headers += NonlinearFactorGraph.h NonlinearFactorGraph-inl.h headers += NonlinearOptimizer.h NonlinearOptimizer-inl.h -headers += SQPOptimizer.h SQPOptimizer-inl.h -headers += NonlinearConstraint.h NonlinearConstraint-inl.h -headers += NonlinearEquality.h -headers += Pose2Config.h Pose2Factor.h -headers += UrbanGraph.h sources += NonlinearFactor.cpp -sources += Pose2Graph.cpp -sources += UrbanConfig.cpp UrbanMeasurement.cpp -check_PROGRAMS += testNonlinearFactor testNonlinearFactorGraph testNonlinearOptimizer testNonlinearEquality testSQP testNonlinearConstraint testSQPOptimizer testPose2Factor testPose2Graph testUrbanGraph +check_PROGRAMS += testNonlinearFactor testNonlinearFactorGraph testNonlinearOptimizer testNonlinearFactor_SOURCES = $(example) testNonlinearFactor.cpp testNonlinearFactor_LDADD = libgtsam.la -testNonlinearConstraint_SOURCES = $(example) testNonlinearConstraint.cpp -testNonlinearConstraint_LDADD = libgtsam.la testNonlinearFactorGraph_SOURCES = $(example) testNonlinearFactorGraph.cpp testNonlinearFactorGraph_LDADD = libgtsam.la testNonlinearOptimizer_SOURCES = $(example) testNonlinearOptimizer.cpp testNonlinearOptimizer_LDADD = libgtsam.la -testSQPOptimizer_SOURCES = $(example) testSQPOptimizer.cpp -testSQPOptimizer_LDADD = libgtsam.la -testNonlinearEquality_SOURCES = testNonlinearEquality.cpp -testNonlinearEquality_LDADD = libgtsam.la -testSQP_SOURCES = $(example) testSQP.cpp -testSQP_LDADD = libgtsam.la -testPose2Factor_SOURCES = $(example) testPose2Factor.cpp -testPose2Factor_LDADD = libgtsam.la -testPose2Graph_SOURCES = $(example) testPose2Graph.cpp -testPose2Graph_LDADD = libgtsam.la -testUrbanGraph_SOURCES = $(example) testUrbanGraph.cpp -testUrbanGraph_LDADD = libgtsam.la + +# Nonlinear constraints +headers += SQPOptimizer.h SQPOptimizer-inl.h +headers += NonlinearConstraint.h NonlinearConstraint-inl.h +headers += NonlinearEquality.h +check_PROGRAMS += testNonlinearConstraint testNonlinearEquality testSQP testSQPOptimizer +testNonlinearConstraint_SOURCES = testNonlinearConstraint.cpp +testNonlinearConstraint_LDADD = libgtsam.la +testNonlinearEquality_SOURCES = testNonlinearEquality.cpp +testNonlinearEquality_LDADD = libgtsam.la +testSQP_SOURCES = $(example) testSQP.cpp +testSQP_LDADD = libgtsam.la +testSQPOptimizer_SOURCES = $(example) testSQPOptimizer.cpp +testSQPOptimizer_LDADD = libgtsam.la # geometry sources += Point2.cpp Rot2.cpp Pose2.cpp Point3.cpp Rot3.cpp Pose3.cpp Cal3_S2.cpp @@ -184,15 +177,37 @@ testSimulated3D_SOURCES = testSimulated3D.cpp testSimulated3D_LDADD = libgtsam.la check_PROGRAMS += testSimulated3D +# Pose constraints +headers += Pose2Config.h Pose2Factor.h +sources += Pose3Factor.cpp Pose2Graph.cpp +check_PROGRAMS += testPose2Factor testPose2Graph testPose3Factor +testPose2Factor_SOURCES = $(example) testPose2Factor.cpp +testPose2Factor_LDADD = libgtsam.la +testPose2Graph_SOURCES = $(example) testPose2Graph.cpp +testPose2Graph_LDADD = libgtsam.la +testPose3Factor_SOURCES = $(example) testPose3Factor.cpp +testPose3Factor_LDADD = libgtsam.la + +# Urban +headers += UrbanGraph.h +sources += UrbanConfig.cpp UrbanMeasurement.cpp +check_PROGRAMS += testUrbanConfig testUrbanMeasurement testUrbanGraph +testUrbanConfig_SOURCES = $(example) testUrbanConfig.cpp +testUrbanConfig_LDADD = libgtsam.la +testUrbanMeasurement_SOURCES = $(example) testUrbanMeasurement.cpp +testUrbanMeasurement_LDADD = libgtsam.la +testUrbanGraph_SOURCES = $(example) testUrbanGraph.cpp +testUrbanGraph_LDADD = libgtsam.la + # Robot Control example system sources += ControlConfig.cpp ControlPoint.cpp ControlGraph.cpp check_PROGRAMS += testControlConfig testControlPoint testControlGraph testControlConfig_SOURCES = testControlConfig.cpp -testControlConfig_LDADD = libgtsam.la -testControlPoint_SOURCES = testControlPoint.cpp -testControlPoint_LDADD = libgtsam.la -testControlGraph_SOURCES = testControlGraph.cpp -testControlGraph_LDADD = libgtsam.la +testControlConfig_LDADD = libgtsam.la +testControlPoint_SOURCES = testControlPoint.cpp +testControlPoint_LDADD = libgtsam.la +testControlGraph_SOURCES = testControlGraph.cpp +testControlGraph_LDADD = libgtsam.la # Cameras sources += CalibratedCamera.cpp SimpleCamera.cpp diff --git a/cpp/Pose3Factor.cpp b/cpp/Pose3Factor.cpp index 32fb79780..d0db5436f 100644 --- a/cpp/Pose3Factor.cpp +++ b/cpp/Pose3Factor.cpp @@ -5,22 +5,19 @@ * @author Viorela Ila */ -#include "UrbanConfig.h" #include "Pose3Factor.h" -#include "Pose3.h" -#include "SimpleCamera.h" using namespace std; -namespace gtsam{ +namespace gtsam { -/* ************************************************************************* */ +/* ************************************************************************* * Pose3Factor::Pose3Factor() { /// Arbitrary values robotPoseNumber_ = 1; robotPoseName_ = symbol('x',robotPoseNumber_); keys_.push_back(robotPoseName_); } -/* ************************************************************************* */ +/* ************************************************************************* * Pose3Factor::Pose3Factor(const Point2& z, double sigma, int cn, int ln) : NonlinearFactor(z.vector(), sigma) { @@ -32,13 +29,13 @@ Pose3Factor::Pose3Factor(const Point2& z, double sigma, int cn, int ln) keys_.push_back(landmarkName_); } -/* ************************************************************************* */ +/* ************************************************************************* * void Pose3Factor::print(const std::string& s) const { printf("%s %s %s\n", s.c_str(), robotPoseName_.c_str(), landmarkName_.c_str()); gtsam::print(this->z_, s+".z"); } -/* ************************************************************************* */ +/* ************************************************************************* * bool Pose3Factor::equals(const Pose3Factor& p, double tol) const { if (&p == NULL) return false; if (robotPoseNumber_ != p.robotPoseNumber_ || landmarkNumber_ != p.landmarkNumber_) return false; @@ -46,6 +43,7 @@ bool Pose3Factor::equals(const Pose3Factor& p, double tol) const { return true; } +/* ************************************************************************* * // TODO Implement transformPoint2_from // the difference here that we have a 2d point in a 3D coordinate Vector Pose3Factor::predict(const Pose3Config& c) const { @@ -54,13 +52,14 @@ Vector Pose3Factor::predict(const Pose3Config& c) const { return transformPoint2_from(SimpleCamera(*K_,pose), landmark).vector(); } -/* ************************************************************************* */ +/* ************************************************************************* * Vector Pose3Factor::error_vector(const Pose3Config& c) const { // Right-hand-side b = (z - h(x))/sigma Point2 h = predict(c); return (this->z_ - h); } +/* ************************************************************************* * GaussianFactor::shared_ptr Pose3Factor::linearize(const Pose3Config& c) const { // get arguments from config diff --git a/cpp/Pose3Factor.h b/cpp/Pose3Factor.h index 1c83753c6..e23366b68 100644 --- a/cpp/Pose3Factor.h +++ b/cpp/Pose3Factor.h @@ -13,59 +13,68 @@ #include "VectorConfig.h" #include "Pose3.h" #include "Matrix.h" -#include "ostream" namespace gtsam { -template -class Pose3Factor : public NonlinearFactor { -private: - std::string key1_, key2_; /** The keys of the two poses, order matters */ - Pose3 measured_; - Matrix square_root_inverse_covariance_; /** sqrt(inv(measurement_covariance)) */ + typedef VectorConfig Config; -public: + class Pose3Factor: public NonlinearFactor { + private: + std::string key1_, key2_; /** The keys of the two poses, order matters */ + Pose3 measured_; + Matrix square_root_inverse_covariance_; /** sqrt(inv(measurement_covariance)) */ - typedef boost::shared_ptr shared_ptr; // shorthand for a smart pointer to a factor + public: - Pose3Factor(const std::string& key1, const std::string& key2, - const Pose3& measured, const Matrix& measurement_covariance): key1_(key1),key2_(key2),measured_(measured) { - square_root_inverse_covariance_ = inverse_square_root(measurement_covariance); - } + typedef boost::shared_ptr shared_ptr; // shorthand for a smart pointer to a factor - /** implement functions needed for Testable */ - void print(const std::string& name) const { - std::cout << name << std::endl; - std::cout << "Factor "<< std::endl; - std::cout << "key1 "<< key1_<& expected, double tol) const {return false;} + Pose3Factor(const std::string& key1, const std::string& key2, + const Pose3& measured, const Matrix& measurement_covariance) : + key1_(key1), key2_(key2), measured_(measured) { + square_root_inverse_covariance_ = inverse_square_root( + measurement_covariance); + } - /** implement functions needed to derive from Factor */ - Vector error_vector(const Config& config) const { - //z-h - Pose3 p1 = config.get(key1_), p2 = config.get(key2_); - return (measured_ - between(p1,p2)).vector(); - } + /** implement functions needed for Testable */ + void print(const std::string& name) const { + std::cout << name << std::endl; + std::cout << "Factor " << std::endl; + std::cout << "key1 " << key1_ << std::endl; + std::cout << "key2 " << key2_ << std::endl; + measured_.print("measured "); + gtsam::print(square_root_inverse_covariance_, "MeasurementCovariance"); + } + bool equals(const NonlinearFactor& expected, double tol) const { + return false; + } - std::list keys() const { std::list l; return l; } - std::size_t size() const { return 2;} + /** implement functions needed to derive from Factor */ + Vector error_vector(const Config& config) const { + //z-h + Pose3 p1 = config.get(key1_), p2 = config.get(key2_); + return (measured_ - between(p1, p2)).vector(); + } + + std::list keys() const { + std::list l; + return l; + } + std::size_t size() const { + return 2; + } + + /** linearize */ + boost::shared_ptr linearize(const Config& config) const { + Pose3 p1 = config.get(key1_), p2 = config.get(key2_); + Vector b = (measured_ - between(p1, p2)).vector(); + Matrix H1 = Dbetween1(p1, p2); + Matrix H2 = Dbetween2(p1, p2); + boost::shared_ptr linearized(new GaussianFactor(key1_, + square_root_inverse_covariance_ * H1, key2_, + square_root_inverse_covariance_ * H2, b, 1.0)); + return linearized; + } + }; - /** linearize */ - boost::shared_ptr linearize(const Config& config) const { - Pose3 p1 = config.get(key1_), p2 = config.get(key2_); - Vector b = (measured_ - between(p1,p2)).vector(); - Matrix H1 = Dbetween1(p1,p2); - Matrix H2 = Dbetween2(p1,p2); - boost::shared_ptr linearized(new GaussianFactor( - key1_, square_root_inverse_covariance_ * H1, - key2_, square_root_inverse_covariance_ * H2, - b, 1.0)); - return linearized; - } -}; } /// namespace gtsam diff --git a/cpp/testPose3Factor b/cpp/testPose3Factor new file mode 100755 index 000000000..6c46aa0c3 --- /dev/null +++ b/cpp/testPose3Factor @@ -0,0 +1,130 @@ +#! /bin/sh + +# testPose3Factor - temporary wrapper script for .libs/testPose3Factor +# Generated by ltmain.sh (GNU libtool) 2.2.6 +# +# The testPose3Factor program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='/usr/bin/sed -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command="" + +# This environment variable determines our operation mode. +if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then + # install mode needs the following variables: + generated_by_libtool_version='2.2.6' + notinst_deplibs=' libgtsam.la' +else + # When we are sourced in execute mode, $file and $ECHO are already set. + if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then + ECHO="/bin/echo" + file="$0" + # Make sure echo works. + if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! + : + else + # Restart under the correct shell, and then maybe $ECHO will work. + exec /bin/sh "$0" --no-reexec ${1+"$@"} + fi + fi + + # Find the directory that this script lives in. + thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "x$thisdir" = "x$file" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` + while test -n "$file"; do + destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` + + # If there was a directory component, then change thisdir. + if test "x$destdir" != "x$file"; then + case "$destdir" in + [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; + *) thisdir="$thisdir/$destdir" ;; + esac + fi + + file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'` + file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` + done + + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no + if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then + # special case for '.' + if test "$thisdir" = "."; then + thisdir=`pwd` + fi + # remove .libs from thisdir + case "$thisdir" in + *[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;; + .libs ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=`cd "$thisdir" && pwd` + test -n "$absdir" && thisdir="$absdir" + + program='testPose3Factor' + progdir="$thisdir/.libs" + + + if test -f "$progdir/$program"; then + # Add our own library path to DYLD_LIBRARY_PATH + DYLD_LIBRARY_PATH="/Users/dellaert/borg/gtsam/cpp/.libs:$DYLD_LIBRARY_PATH" + + # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH + # The second colon is a workaround for a bug in BeOS R4 sed + DYLD_LIBRARY_PATH=`$ECHO "X$DYLD_LIBRARY_PATH" | $Xsed -e 's/::*$//'` + + export DYLD_LIBRARY_PATH + + if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then + # Run the actual program with our arguments. + + exec "$progdir/$program" ${1+"$@"} + + $ECHO "$0: cannot exec $program $*" 1>&2 + exit 1 + fi + else + # The program doesn't exist. + $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2 + $ECHO "This script is just a wrapper for $program." 1>&2 + /bin/echo "See the libtool documentation for more information." 1>&2 + exit 1 + fi +fi diff --git a/cpp/testPose3Factor.cpp b/cpp/testPose3Factor.cpp new file mode 100644 index 000000000..fbd56c060 --- /dev/null +++ b/cpp/testPose3Factor.cpp @@ -0,0 +1,23 @@ +/** + * @file testPose3Pose.cpp + * @brief Unit tests for Pose3Factor Class + * @authors Frank Dellaert + **/ + +#include +#include +#include "Pose3Factor.h" + +using namespace std; +using namespace gtsam; + +TEST( Pose3Factor, constructor ) +{ +} + +/* ************************************************************************* */ +int main() { + TestResult tr; + return TestRegistry::runAllTests(tr); +} +/* ************************************************************************* */ diff --git a/cpp/testUrbanConfig b/cpp/testUrbanConfig new file mode 100755 index 000000000..266c6dbf4 --- /dev/null +++ b/cpp/testUrbanConfig @@ -0,0 +1,130 @@ +#! /bin/sh + +# testUrbanConfig - temporary wrapper script for .libs/testUrbanConfig +# Generated by ltmain.sh (GNU libtool) 2.2.6 +# +# The testUrbanConfig program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='/usr/bin/sed -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command="" + +# This environment variable determines our operation mode. +if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then + # install mode needs the following variables: + generated_by_libtool_version='2.2.6' + notinst_deplibs=' libgtsam.la' +else + # When we are sourced in execute mode, $file and $ECHO are already set. + if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then + ECHO="/bin/echo" + file="$0" + # Make sure echo works. + if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! + : + else + # Restart under the correct shell, and then maybe $ECHO will work. + exec /bin/sh "$0" --no-reexec ${1+"$@"} + fi + fi + + # Find the directory that this script lives in. + thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "x$thisdir" = "x$file" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` + while test -n "$file"; do + destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` + + # If there was a directory component, then change thisdir. + if test "x$destdir" != "x$file"; then + case "$destdir" in + [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; + *) thisdir="$thisdir/$destdir" ;; + esac + fi + + file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'` + file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` + done + + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no + if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then + # special case for '.' + if test "$thisdir" = "."; then + thisdir=`pwd` + fi + # remove .libs from thisdir + case "$thisdir" in + *[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;; + .libs ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=`cd "$thisdir" && pwd` + test -n "$absdir" && thisdir="$absdir" + + program='testUrbanConfig' + progdir="$thisdir/.libs" + + + if test -f "$progdir/$program"; then + # Add our own library path to DYLD_LIBRARY_PATH + DYLD_LIBRARY_PATH="/Users/dellaert/borg/gtsam/cpp/.libs:$DYLD_LIBRARY_PATH" + + # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH + # The second colon is a workaround for a bug in BeOS R4 sed + DYLD_LIBRARY_PATH=`$ECHO "X$DYLD_LIBRARY_PATH" | $Xsed -e 's/::*$//'` + + export DYLD_LIBRARY_PATH + + if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then + # Run the actual program with our arguments. + + exec "$progdir/$program" ${1+"$@"} + + $ECHO "$0: cannot exec $program $*" 1>&2 + exit 1 + fi + else + # The program doesn't exist. + $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2 + $ECHO "This script is just a wrapper for $program." 1>&2 + /bin/echo "See the libtool documentation for more information." 1>&2 + exit 1 + fi +fi diff --git a/cpp/testUrbanConfig.cpp b/cpp/testUrbanConfig.cpp new file mode 100644 index 000000000..ee4e2089a --- /dev/null +++ b/cpp/testUrbanConfig.cpp @@ -0,0 +1,23 @@ +/* + * @file testUrbanConfig.cpp + * @brief Tests for the CitySLAM configuration class + * @author Frank Dellaert + */ + +#include +#include + +using namespace std; +using namespace gtsam; + +/* ************************************************************************* */ +TEST( UrbanConfig, update_with_large_delta) +{ +} + +/* ************************************************************************* */ +int main() { + TestResult tr; + return TestRegistry::runAllTests(tr); +} +/* ************************************************************************* */ diff --git a/cpp/testUrbanGraph b/cpp/testUrbanGraph index b212fe436..f5094191d 100755 --- a/cpp/testUrbanGraph +++ b/cpp/testUrbanGraph @@ -1,7 +1,7 @@ #! /bin/sh # testUrbanGraph - temporary wrapper script for .libs/testUrbanGraph -# Generated by ltmain.sh - GNU libtool 1.5.22 (1.1220.2.365 2005/12/18 22:14:06) +# Generated by ltmain.sh (GNU libtool) 2.2.6 # # The testUrbanGraph program cannot be directly executed until all the libtool # libraries that it depends on are installed. @@ -12,7 +12,21 @@ # Sed substitution that helps us do robust quoting. It backslashifies # metacharacters that are still active within double-quoted strings. Xsed='/usr/bin/sed -e 1s/^X//' -sed_quote_subst='s/\([\\`\\"$\\\\]\)/\\\1/g' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh # The HP-UX ksh and POSIX shell print the target directory to stdout # if CDPATH is set. @@ -22,34 +36,35 @@ relink_command="" # This environment variable determines our operation mode. if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then - # install mode needs the following variable: + # install mode needs the following variables: + generated_by_libtool_version='2.2.6' notinst_deplibs=' libgtsam.la' else - # When we are sourced in execute mode, $file and $echo are already set. + # When we are sourced in execute mode, $file and $ECHO are already set. if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then - echo="/bin/echo" + ECHO="/bin/echo" file="$0" # Make sure echo works. if test "X$1" = X--no-reexec; then # Discard the --no-reexec flag, and continue. shift - elif test "X`($echo '\t') 2>/dev/null`" = 'X\t'; then - # Yippee, $echo works! + elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! : else - # Restart under the correct shell, and then maybe $echo will work. + # Restart under the correct shell, and then maybe $ECHO will work. exec /bin/sh "$0" --no-reexec ${1+"$@"} fi fi # Find the directory that this script lives in. - thisdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` test "x$thisdir" = "x$file" && thisdir=. # Follow symbolic links until we get to the real thisdir. file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` while test -n "$file"; do - destdir=`$echo "X$file" | $Xsed -e 's%/[^/]*$%%'` + destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` # If there was a directory component, then change thisdir. if test "x$destdir" != "x$file"; then @@ -59,10 +74,26 @@ else esac fi - file=`$echo "X$file" | $Xsed -e 's%^.*/%%'` + file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'` file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` done + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no + if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then + # special case for '.' + if test "$thisdir" = "."; then + thisdir=`pwd` + fi + # remove .libs from thisdir + case "$thisdir" in + *[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;; + .libs ) thisdir=. ;; + esac + fi + # Try to get the absolute directory name. absdir=`cd "$thisdir" && pwd` test -n "$absdir" && thisdir="$absdir" @@ -73,11 +104,11 @@ else if test -f "$progdir/$program"; then # Add our own library path to DYLD_LIBRARY_PATH - DYLD_LIBRARY_PATH="/Users/vila/borg/gtsam/cpp/.libs:$DYLD_LIBRARY_PATH" + DYLD_LIBRARY_PATH="/Users/dellaert/borg/gtsam/cpp/.libs:$DYLD_LIBRARY_PATH" # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH # The second colon is a workaround for a bug in BeOS R4 sed - DYLD_LIBRARY_PATH=`$echo "X$DYLD_LIBRARY_PATH" | $Xsed -e 's/::*$//'` + DYLD_LIBRARY_PATH=`$ECHO "X$DYLD_LIBRARY_PATH" | $Xsed -e 's/::*$//'` export DYLD_LIBRARY_PATH @@ -86,13 +117,13 @@ else exec "$progdir/$program" ${1+"$@"} - $echo "$0: cannot exec $program ${1+"$@"}" + $ECHO "$0: cannot exec $program $*" 1>&2 exit 1 fi else # The program doesn't exist. - $echo "$0: error: \`$progdir/$program' does not exist" 1>&2 - $echo "This script is just a wrapper for $program." 1>&2 + $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2 + $ECHO "This script is just a wrapper for $program." 1>&2 /bin/echo "See the libtool documentation for more information." 1>&2 exit 1 fi diff --git a/cpp/testUrbanMeasurement b/cpp/testUrbanMeasurement new file mode 100755 index 000000000..2decdec46 --- /dev/null +++ b/cpp/testUrbanMeasurement @@ -0,0 +1,130 @@ +#! /bin/sh + +# testUrbanMeasurement - temporary wrapper script for .libs/testUrbanMeasurement +# Generated by ltmain.sh (GNU libtool) 2.2.6 +# +# The testUrbanMeasurement program cannot be directly executed until all the libtool +# libraries that it depends on are installed. +# +# This wrapper script should never be moved out of the build directory. +# If it is, it will not operate correctly. + +# Sed substitution that helps us do robust quoting. It backslashifies +# metacharacters that are still active within double-quoted strings. +Xsed='/usr/bin/sed -e 1s/^X//' +sed_quote_subst='s/\([`"$\\]\)/\\\1/g' + +# Be Bourne compatible +if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then + emulate sh + NULLCMD=: + # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which + # is contrary to our usage. Disable this feature. + alias -g '${1+"$@"}'='"$@"' + setopt NO_GLOB_SUBST +else + case `(set -o) 2>/dev/null` in *posix*) set -o posix;; esac +fi +BIN_SH=xpg4; export BIN_SH # for Tru64 +DUALCASE=1; export DUALCASE # for MKS sh + +# The HP-UX ksh and POSIX shell print the target directory to stdout +# if CDPATH is set. +(unset CDPATH) >/dev/null 2>&1 && unset CDPATH + +relink_command="" + +# This environment variable determines our operation mode. +if test "$libtool_install_magic" = "%%%MAGIC variable%%%"; then + # install mode needs the following variables: + generated_by_libtool_version='2.2.6' + notinst_deplibs=' libgtsam.la' +else + # When we are sourced in execute mode, $file and $ECHO are already set. + if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then + ECHO="/bin/echo" + file="$0" + # Make sure echo works. + if test "X$1" = X--no-reexec; then + # Discard the --no-reexec flag, and continue. + shift + elif test "X`{ $ECHO '\t'; } 2>/dev/null`" = 'X\t'; then + # Yippee, $ECHO works! + : + else + # Restart under the correct shell, and then maybe $ECHO will work. + exec /bin/sh "$0" --no-reexec ${1+"$@"} + fi + fi + + # Find the directory that this script lives in. + thisdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` + test "x$thisdir" = "x$file" && thisdir=. + + # Follow symbolic links until we get to the real thisdir. + file=`ls -ld "$file" | /usr/bin/sed -n 's/.*-> //p'` + while test -n "$file"; do + destdir=`$ECHO "X$file" | $Xsed -e 's%/[^/]*$%%'` + + # If there was a directory component, then change thisdir. + if test "x$destdir" != "x$file"; then + case "$destdir" in + [\\/]* | [A-Za-z]:[\\/]*) thisdir="$destdir" ;; + *) thisdir="$thisdir/$destdir" ;; + esac + fi + + file=`$ECHO "X$file" | $Xsed -e 's%^.*/%%'` + file=`ls -ld "$thisdir/$file" | /usr/bin/sed -n 's/.*-> //p'` + done + + + # Usually 'no', except on cygwin/mingw when embedded into + # the cwrapper. + WRAPPER_SCRIPT_BELONGS_IN_OBJDIR=no + if test "$WRAPPER_SCRIPT_BELONGS_IN_OBJDIR" = "yes"; then + # special case for '.' + if test "$thisdir" = "."; then + thisdir=`pwd` + fi + # remove .libs from thisdir + case "$thisdir" in + *[\\/].libs ) thisdir=`$ECHO "X$thisdir" | $Xsed -e 's%[\\/][^\\/]*$%%'` ;; + .libs ) thisdir=. ;; + esac + fi + + # Try to get the absolute directory name. + absdir=`cd "$thisdir" && pwd` + test -n "$absdir" && thisdir="$absdir" + + program='testUrbanMeasurement' + progdir="$thisdir/.libs" + + + if test -f "$progdir/$program"; then + # Add our own library path to DYLD_LIBRARY_PATH + DYLD_LIBRARY_PATH="/Users/dellaert/borg/gtsam/cpp/.libs:$DYLD_LIBRARY_PATH" + + # Some systems cannot cope with colon-terminated DYLD_LIBRARY_PATH + # The second colon is a workaround for a bug in BeOS R4 sed + DYLD_LIBRARY_PATH=`$ECHO "X$DYLD_LIBRARY_PATH" | $Xsed -e 's/::*$//'` + + export DYLD_LIBRARY_PATH + + if test "$libtool_execute_magic" != "%%%MAGIC variable%%%"; then + # Run the actual program with our arguments. + + exec "$progdir/$program" ${1+"$@"} + + $ECHO "$0: cannot exec $program $*" 1>&2 + exit 1 + fi + else + # The program doesn't exist. + $ECHO "$0: error: \`$progdir/$program' does not exist" 1>&2 + $ECHO "This script is just a wrapper for $program." 1>&2 + /bin/echo "See the libtool documentation for more information." 1>&2 + exit 1 + fi +fi diff --git a/cpp/testUrbanMeasurement.cpp b/cpp/testUrbanMeasurement.cpp new file mode 100644 index 000000000..a9f1e2f25 --- /dev/null +++ b/cpp/testUrbanMeasurement.cpp @@ -0,0 +1,25 @@ +/********************************************************** + Written by Frank Dellaert, Dec 2009 + **********************************************************/ + +#include + +#include "UrbanConfig.h" +#include "UrbanMeasurement.h" + +using namespace std; +using namespace gtsam; + +/* ************************************************************************* */ +TEST( UrbanMeasurement, linearize ) +{ +} + +/* ************************************************************************* */ +int main() { + TestResult tr; + TestRegistry::runAllTests(tr); + return 0; +} +/* ************************************************************************* */ +