|
From: <ve...@us...> - 2009-01-06 19:15:20
|
Revision: 8886
http://personalrobots.svn.sourceforge.net/personalrobots/?rev=8886&view=rev
Author: veedee
Date: 2009-01-06 19:15:19 +0000 (Tue, 06 Jan 2009)
Log Message:
-----------
added ANN as a dependency, changef cloud_kdtree to use ANN for now (more stable)
Modified Paths:
--------------
pkg/trunk/mapping/cloud_kdtree/include/cloud_kdtree/kdtree.h
pkg/trunk/mapping/cloud_kdtree/manifest.xml
Added Paths:
-----------
pkg/trunk/3rdparty/ANN/
pkg/trunk/3rdparty/ANN/Makefile
pkg/trunk/3rdparty/ANN/gcc43_shared.patch
pkg/trunk/3rdparty/ANN/manifest.xml
Added: pkg/trunk/3rdparty/ANN/Makefile
===================================================================
--- pkg/trunk/3rdparty/ANN/Makefile (rev 0)
+++ pkg/trunk/3rdparty/ANN/Makefile 2009-01-06 19:15:19 UTC (rev 8886)
@@ -0,0 +1,15 @@
+all: ann
+
+TARBALL = build/ann_1.1.1.tar.gz
+TARBALL_URL = http://www.cs.umd.edu/~mount/ANN/Files/1.1.1/ann_1.1.1.tar.gz
+UNPACK_CMD = tar xfz
+SOURCE_DIR = build/ann_1.1.1
+TARBALL_PATCH = gcc43_shared.patch
+
+include $(shell rospack find mk)/download_unpack_build.mk
+
+ann: $(SOURCE_DIR)
+ echo "Building FL-ANN..."
+ cd build/ann_1.1.1 && make linux-g++
+wipe:
+ rm -rf build
Added: pkg/trunk/3rdparty/ANN/gcc43_shared.patch
===================================================================
--- pkg/trunk/3rdparty/ANN/gcc43_shared.patch (rev 0)
+++ pkg/trunk/3rdparty/ANN/gcc43_shared.patch 2009-01-06 19:15:19 UTC (rev 8886)
@@ -0,0 +1,128 @@
+--- ./test/ann_test.cpp.orig 2009-01-06 10:58:37.000000000 -0800
++++ ./test/ann_test.cpp 2009-01-06 10:59:11.000000000 -0800
+@@ -37,6 +37,7 @@
+ #include <ctime> // clock
+ #include <cmath> // math routines
+ #include <string> // C string ops
++#include <string.h>
+ #include <fstream> // file I/O
+
+ #include <ANN/ANN.h> // ANN declarations
+@@ -370,7 +371,7 @@
+ //----------------------------------------------------------------------
+
+ void Error( // error routine
+- char *msg, // error message
++ const char *msg, // error message
+ ANNerr level) // abort afterwards
+ {
+ if (level == ANNabort) {
+--- ./Makefile.orig 2009-01-06 11:03:59.000000000 -0800
++++ ./Makefile 2009-01-06 11:04:29.000000000 -0800
+@@ -42,6 +42,7 @@
+ default:
+ @echo "Enter one of the following:"
+ @echo " make linux-g++ for Linux and g++"
++ @echo " make linux-shared-g++ for Linux and g++ (shared)"
+ @echo " make macosx-g++ for Mac OS X and g++"
+ @echo " make sunos5 for Sun with SunOS 5.x"
+ @echo " make sunos5-sl for Sun with SunOS 5.x, make shared libs"
+@@ -56,7 +57,7 @@
+ #-----------------------------------------------------------------------------
+ # main make entry point
+ #-----------------------------------------------------------------------------
+-alpha-g++ macosx-g++ linux-g++ sgi sunos4 sunos4-g++ sunos5 sunos5-g++ sunos5-g++-sl authors-debug authors-perf:
++alpha-g++ macosx-g++ linux-g++ linux-shared-g++ sgi sunos4 sunos4-g++ sunos5 sunos5-g++ sunos5-g++-sl authors-debug authors-perf:
+ cd src ; $(MAKE) $@
+ cd test ; $(MAKE) $@
+ cd sample ; $(MAKE) $@
+--- ./src/kd_dump.cpp.orig 2009-01-06 10:56:58.000000000 -0800
++++ ./src/kd_dump.cpp 2009-01-06 10:57:29.000000000 -0800
+@@ -31,6 +31,8 @@
+ // desired.)
+ //----------------------------------------------------------------------
+
++#include <stdlib.h>
++#include <string.h>
+ #include "kd_tree.h" // kd-tree declarations
+ #include "bd_tree.h" // bd-tree declarations
+
+--- ./src/perf.cpp.orig 2009-01-06 10:57:54.000000000 -0800
++++ ./src/perf.cpp 2009-01-06 10:57:59.000000000 -0800
+@@ -102,7 +102,7 @@
+ }
+
+ // print a single statistic
+-void print_one_stat(char *title, ANNsampStat s, double div)
++void print_one_stat(const char *title, ANNsampStat s, double div)
+ {
+ cout << title << "= [ ";
+ cout.width(9); cout << s.mean()/div << " : ";
+--- ./src/ANN.cpp.orig 2009-01-06 10:55:10.000000000 -0800
++++ ./src/ANN.cpp 2009-01-06 11:00:32.000000000 -0800
+@@ -24,6 +24,7 @@
+ // Added performance counting to annDist()
+ //----------------------------------------------------------------------
+
++#include <stdlib.h>
+ #include <ANN/ANNx.h> // all ANN includes
+ #include <ANN/ANNperf.h> // ANN performance
+
+@@ -163,7 +164,7 @@
+ // Error handler
+ //----------------------------------------------------------------------
+
+-void annError(char *msg, ANNerr level)
++void annError(const char *msg, ANNerr level)
+ {
+ if (level == ANNabort) {
+ cerr << "ANN: ERROR------->" << msg << "<-------------ERROR\n";
+--- ./ann2fig/ann2fig.cpp.orig 2009-01-06 11:01:08.000000000 -0800
++++ ./ann2fig/ann2fig.cpp 2009-01-06 11:01:35.000000000 -0800
+@@ -40,6 +40,8 @@
+ // arguments.
+ //----------------------------------------------------------------------
+
++#include <stdlib.h>
++#include <string.h>
+ #include <cstdio> // C standard I/O
+ #include <fstream> // file I/O
+ #include <string> // string manipulation
+@@ -92,7 +94,7 @@
+ // Error handler
+ //----------------------------------------------------------------------
+
+-void Error(char *msg, ANNerr level)
++void Error(const char *msg, ANNerr level)
+ {
+ if (level == ANNabort) {
+ cerr << "ann2fig: ERROR------->" << msg << "<-------------ERROR\n";
+--- ./include/ANN/ANNx.h.orig 2009-01-06 10:56:33.000000000 -0800
++++ ./include/ANN/ANNx.h 2009-01-06 10:56:40.000000000 -0800
+@@ -61,7 +61,7 @@
+ //----------------------------------------------------------------------
+
+ void annError( // ANN error routine
+- char *msg, // error message
++ const char *msg, // error message
+ ANNerr level); // level of error
+
+ void annPrintPt( // print a point
+--- ./Make-config.orig 2009-01-06 11:02:38.000000000 -0800
++++ ./Make-config 2009-01-06 11:04:36.000000000 -0800
+@@ -76,6 +76,15 @@
+ "MAKELIB = ar ruv" \
+ "RANLIB = true"
+
++# Linux using g++ shared
++linux-shared-g++:
++ $(MAKE) targets \
++ "ANNLIB = libANN.so" \
++ "C++ = g++" \
++ "CFLAGS = -O3" \
++ "MAKELIB = g++ -shared -o" \
++ "RANLIB = true"
++
+ # Mac OS X using g++
+ macosx-g++:
+ $(MAKE) targets \
Added: pkg/trunk/3rdparty/ANN/manifest.xml
===================================================================
--- pkg/trunk/3rdparty/ANN/manifest.xml (rev 0)
+++ pkg/trunk/3rdparty/ANN/manifest.xml 2009-01-06 19:15:19 UTC (rev 8886)
@@ -0,0 +1,43 @@
+<package>
+ <description brief="ANN">
+
+ ANN is a library written in C++, which supports data structures and
+ algorithms for both exact and approximate nearest neighbor searching in
+ arbitrarily high dimensions.
+
+ In the nearest neighbor problem a set of data points in d-dimensional
+ space is given. These points are preprocessed into a data structure, so
+ that given any query point q, the nearest or generally k nearest points of
+ P to q can be reported efficiently. The distance between two points can be
+ defined in many ways. ANN assumes that distances are measured using any
+ class of distance functions called Minkowski metrics. These include the
+ well known Euclidean distance, Manhattan distance, and max distance.
+
+ Based on our own experience, ANN performs quite efficiently for point sets
+ ranging in size from thousands to hundreds of thousands, and in dimensions
+ as high as 20. (For applications in significantly higher dimensions, the
+ results are rather spotty, but you might try it anyway.)
+
+ The library implements a number of different data structures, based on
+ kd-trees and box-decomposition trees, and employs a couple of different
+ search strategies.
+
+ The library also comes with test programs for measuring the quality of
+ performance of ANN on any particular data sets, as well as programs for
+ visualizing the structure of the geometric data structures.
+
+ </description>
+
+ <author>Sunil Arya and David Mount</author>
+ <license>LGPL</license>
+ <review status="3rdparty" notes=""/>
+ <url>http://www.cs.umd.edu/~mount/ANN/</url>
+ <export>
+ <cpp cflags="-I${prefix}/build/ann_1.1.1/include" lflags="-Wl,-rpath,${prefix}/build/ann_1.1.1/lib -L${prefix}/build/ann_1.1.1/lib -lANN" />
+ <doxymaker external="http://www.cs.umd.edu/~mount/ANN/Files/1.1.1/ANNmanual_1.1.1.pdf"/>
+ </export>
+
+ <sysdepend os="ubuntu" version="7.04-feisty" package="wget"/>
+ <sysdepend os="ubuntu" version="8.04-hardy" package="wget"/>
+
+</package>
Modified: pkg/trunk/mapping/cloud_kdtree/include/cloud_kdtree/kdtree.h
===================================================================
--- pkg/trunk/mapping/cloud_kdtree/include/cloud_kdtree/kdtree.h 2009-01-06 18:57:42 UTC (rev 8885)
+++ pkg/trunk/mapping/cloud_kdtree/include/cloud_kdtree/kdtree.h 2009-01-06 19:15:19 UTC (rev 8886)
@@ -39,6 +39,8 @@
#include <stdlib.h>
+#define USE_ANN
+
#ifdef USE_ANN
#include <ANN/ANN.h>
#else
@@ -88,9 +90,9 @@
bucket_size_ = 30; // default bucket size value
// Allocate enough data
+ nr_points_ = convertCloudToArray (points, points_);
nn_idx_ = new ANNidx [nr_points_];
nn_dists_ = new ANNdist [nr_points_];
- nr_points_ = convertCloudToArray (points, points_);
// Create the kd_tree representation
#ifdef USE_ANN
ann_kd_tree_ = new ANNkd_tree (points_, nr_points_, dim_, bucket_size_);
@@ -113,9 +115,9 @@
dim_ = 3 + dim; // default number of dimensions (3 = xyz) + the extra channels
// Allocate enough data
+ nr_points_ = convertCloudToArray (points, dim, points_);
nn_idx_ = new ANNidx [nr_points_];
nn_dists_ = new ANNdist [nr_points_];
- nr_points_ = convertCloudToArray (points, dim, points_);
// Create the kd_tree representation
#ifdef USE_ANN
ann_kd_tree_ = new ANNkd_tree (points_, nr_points_, dim_, bucket_size_);
Modified: pkg/trunk/mapping/cloud_kdtree/manifest.xml
===================================================================
--- pkg/trunk/mapping/cloud_kdtree/manifest.xml 2009-01-06 18:57:42 UTC (rev 8885)
+++ pkg/trunk/mapping/cloud_kdtree/manifest.xml 2009-01-06 19:15:19 UTC (rev 8886)
@@ -10,8 +10,8 @@
<depend package="roscpp" />
<depend package="std_msgs" />
-<!-- <depend package="ANN" />-->
- <depend package="FL-ANN" />
+ <depend package="ANN" />
+<!-- <depend package="FL-ANN" />-->
<export>
<cpp cflags="-I${prefix}/include" lflags="-Wl,-rpath,${prefix}/lib -L${prefix}/lib -lcloud_kdtree"/>
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|