[packages/pcl] - added fz_api patch, enable Fotonic FZ API support - added tawara patch (update from Tide to Tawara

qboosh qboosh at pld-linux.org
Sat Sep 21 12:22:25 CEST 2013


commit 0a13f061e754312fc31b8a2e6378da37f5c9e6a5
Author: Jakub Bogusz <qboosh at pld-linux.org>
Date:   Sat Sep 21 12:22:47 2013 +0200

    - added fz_api patch, enable Fotonic FZ API support
    - added tawara patch (update from Tide to Tawara), enable pcl_video program

 pcl-fz_api.patch |  18 ++++
 pcl-tawara.patch | 247 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 pcl.spec         |  19 +++--
 3 files changed, 279 insertions(+), 5 deletions(-)
---
diff --git a/pcl.spec b/pcl.spec
index faaedae..8ffcefa 100644
--- a/pcl.spec
+++ b/pcl.spec
@@ -1,10 +1,10 @@
 # TODO: MPI, ROS?
-# Fotonic (GZAPI)
-# tide (in tools)
 #
 # Conditional build:
 %bcond_without	apidocs	# do not build and package API docs
+%bcond_without	fzapi	# Fotonic FZ API support
 %bcond_with	sse	# SSE/SSE2/SSE3 support
+%bcond_without	tawara	# Tawara video output (pcl_video)
 %bcond_without	vtk	# VTK support in libpcl_{io,surface} + libpcl_{apps,visualization} libs
 #
 Summary:	Point Cloud Library - library for point cloud processing
@@ -19,6 +19,8 @@ Source0:	https://github.com/PointCloudLibrary/pcl/archive/%{name}-%{version}.tar
 # Source0-md5:	e2ac2d2e72825d991c6d194f9586b5d8
 Patch0:		%{name}-openni.patch
 Patch1:		%{name}-vtk6.patch
+Patch2:		%{name}-fz_api.patch
+Patch3:		%{name}-tawara.patch
 URL:		http://pointclouds.org/
 BuildRequires:	OpenGL-devel
 BuildRequires:	OpenGL-GLU-devel
@@ -29,6 +31,7 @@ BuildRequires:	boost-devel >= 1.43
 BuildRequires:	cmake >= 2.8
 BuildRequires:	eigen3 >= 3
 BuildRequires:	flann-devel >= 1.7.0
+%{?with_fzapi:BuildRequires:	fz-api-devel}
 BuildRequires:	gcc-c++ >= 6:4.2
 BuildRequires:	libgomp-devel
 BuildRequires:	libpcap-devel
@@ -39,6 +42,7 @@ BuildRequires:	qhull-devel
 BuildRequires:	qt4-build >= 4
 BuildRequires:	python
 BuildRequires:	sed >= 4.0
+%{?with_tawara:BuildRequires:	tawara-devel}
 # FIXME: only vtk-devel is really required, the rest (java,python,tcl runtimes) only because of checks in VTK cmake files
 %{?with_vtk:BuildRequires:	vtk-devel >= 6}
 %{?with_vtk:BuildRequires:	vtk-java >= 6}
@@ -101,9 +105,8 @@ Dokumentacja API oraz wprowadzenie do biblioteki PCL.
 %setup -q -n pcl-pcl-%{version}
 %patch0 -p1
 %patch1 -p1
-
-# don't use SSE/SSE2/SSE3 just because compiler and builder host supports it
-#%{__sed} -i -e '/^PCL_CHECK_FOR_SSE/d' CMakeLists.txt
+%patch2 -p1
+%patch3 -p1
 
 %build
 mkdir build
@@ -111,6 +114,11 @@ cd build
 # LIB_INSTALL_DIR specified by PLD cmake macro is incompatible with what PCL expects
 %cmake .. \
 	-DLIB_INSTALL_DIR=%{_lib} \
+%if %{with fzapi}
+	-DFZAPI_DIR=/usr \
+	-DFZAPI_INCLUDE_DIR=/usr/include \
+	-DFZAPI_LIBS=%{_libdir}/libfz_api.so \
+%endif
 	%{!?with_sse:-DPCL_ENABLE_SSE=OFF}
 
 # NOTE: -j1 because of OOM on th-x86_64
@@ -222,6 +230,7 @@ rm -rf $RPM_BUILD_ROOT
 %attr(755,root,root) %{_bindir}/pcl_transform_from_viewpoint
 %attr(755,root,root) %{_bindir}/pcl_transform_point_cloud
 %attr(755,root,root) %{_bindir}/pcl_vfh_estimation
+%{?with_tawara:%attr(755,root,root) %{_bindir}/pcl_video}
 %attr(755,root,root) %{_bindir}/pcl_viewer
 %attr(755,root,root) %{_bindir}/pcl_virtual_scanner
 %attr(755,root,root) %{_bindir}/pcl_voxel_grid
diff --git a/pcl-fz_api.patch b/pcl-fz_api.patch
new file mode 100644
index 0000000..1780fdc
--- /dev/null
+++ b/pcl-fz_api.patch
@@ -0,0 +1,18 @@
+--- pcl-pcl-1.7.0/cmake/Modules/FindFZAPI.cmake.orig	2013-07-23 19:21:02.000000000 +0200
++++ pcl-pcl-1.7.0/cmake/Modules/FindFZAPI.cmake	2013-09-19 21:29:44.661957271 +0200
+@@ -17,7 +17,7 @@
+ 	
+   # Find libraries
+   #MESSAGE("Searching Fotonic libs: ${FZ_API_DIR}/Release")
+-  find_library(FZAPI_LIBS fotonic_fz_api
++  find_library(FZAPI_LIBS fz_api
+     HINTS "${FZ_API_DIR}/Release" NO_DEFAULT_PATH
+     DOC "Fotonic libraries")
+ else()
+@@ -30,4 +30,4 @@
+ include(FindPackageHandleStandardArgs)
+ find_package_handle_standard_args(FZAPI DEFAULT_MSG
+                                   FZAPI_LIBS FZAPI_INCLUDE_DIR)
+-								  
+\ Brak znaku nowej linii na ko�cu pliku
++								  
diff --git a/pcl-tawara.patch b/pcl-tawara.patch
new file mode 100644
index 0000000..c77bec9
--- /dev/null
+++ b/pcl-tawara.patch
@@ -0,0 +1,247 @@
+--- pcl-pcl-1.7.0/tools/CMakeLists.txt.orig	2013-09-15 20:30:42.553276043 +0200
++++ pcl-pcl-1.7.0/tools/CMakeLists.txt	2013-09-19 21:27:13.421963621 +0200
+@@ -230,14 +230,14 @@
+   PCL_ADD_EXECUTABLE (pcl_transform_from_viewpoint ${SUBSYS_NAME} transform_from_viewpoint.cpp)
+   target_link_libraries (pcl_transform_from_viewpoint pcl_common pcl_io pcl_registration)
+ 
+-  find_package(tide QUIET)
+-  if(Tide_FOUND)
+-      include_directories(${Tide_INCLUDE_DIRS})
+-      add_definitions(${Tide_DEFINITIONS})
++  find_package(tawara)
++  if(Tawara_FOUND)
++      include_directories(${Tawara_INCLUDE_DIRS})
++      add_definitions(${Tawara_DEFINITIONS})
+       PCL_ADD_EXECUTABLE(pcl_video ${SUBSYS_NAME} pcl_video.cpp)
+       target_link_libraries(pcl_video pcl_common pcl_io pcl_visualization
+-          ${Tide_LIBRARIES})
+-  endif(Tide_FOUND)
++          ${Tawara_LIBRARIES})
++  endif(Tawara_FOUND)
+   
+ 
+ endif ()
+--- pcl-pcl-1.7.0/tools/pcl_video.cpp.orig	2013-07-23 19:21:02.000000000 +0200
++++ pcl-pcl-1.7.0/tools/pcl_video.cpp	2013-09-19 21:29:01.191959097 +0200
+@@ -36,13 +36,13 @@
+ 
+ #include <iostream>
+ #include <string>
+-#include <tide/ebml_element.h>
+-#include <tide/file_cluster.h>
+-#include <tide/segment.h>
+-#include <tide/simple_block.h>
+-#include <tide/tide_impl.h>
+-#include <tide/tracks.h>
+-#include <tide/track_entry.h>
++#include <tawara/ebml_element.h>
++#include <tawara/file_cluster.h>
++#include <tawara/segment.h>
++#include <tawara/simple_block.h>
++#include <tawara/tawara_impl.h>
++#include <tawara/tracks.h>
++#include <tawara/track_entry.h>
+ #include <pcl/point_cloud.h>
+ #include <pcl/point_types.h>
+ #include <pcl/io/openni_grabber.h>
+@@ -74,12 +74,12 @@
+             // cluster's timecode measured in the segment's timecode scale.
+             bpt::ptime blk_start(bpt::microsec_clock::local_time());
+             bpt::time_duration blk_offset = blk_start - cltr_start_;
+-            tide::BlockElement::Ptr block(new tide::SimpleBlock(1,
++            tawara::BlockElement::Ptr block(new tawara::SimpleBlock(1,
+                         blk_offset.total_microseconds() / 10000));
+             // Here the frame data itself is added to the block
+             pcl::PCLPointCloud2 blob;
+             pcl::toPCLPointCloud2(*cloud, blob);
+-            tide::Block::FramePtr frame_ptr(new tide::Block::Frame(blob.data.begin(),
++            tawara::Block::FramePtr frame_ptr(new tawara::Block::Frame(blob.data.begin(),
+                         blob.data.end()));
+             block->push_back(frame_ptr);
+             cluster_->push_back(block);
+@@ -106,7 +106,7 @@
+                 // Create a new cluster
+                 cltr_start_ = bpt::microsec_clock::local_time();
+                 bpt::time_duration cltr_offset = cltr_start_ - seg_start_;
+-                cluster_.reset(new tide::FileCluster(
++                cluster_.reset(new tawara::FileCluster(
+                             cltr_offset.total_microseconds() / 10000));
+                 cluster_->write(stream_);
+             }
+@@ -116,13 +116,13 @@
+         {
+             // Write the EBML PCLHeader. This specifies that the file is an EBML
+             // file, and is a Tide document.
+-            tide::EBMLElement ebml_el;
++            tawara::EBMLElement ebml_el;
+             ebml_el.write(stream_);
+ 
+             // Open a new segment in the file. This will write some initial meta-data
+             // and place some padding at the start of the file for final meta-data to
+             // be written after tracks, clusters, etc. have been written.
+-            tide::Segment segment;
++            tawara::Segment segment;
+             segment.write(stream_);
+             // Set up the segment information so it can be used while writing tracks
+             // and clusters.
+@@ -153,11 +153,11 @@
+             segment.info.writing_app("pcl_video");
+ 
+             // Set up the tracks meta-data and write it to the file.
+-            tide::Tracks tracks;
++            tawara::Tracks tracks;
+             // Each track is represented in the Tracks information by a TrackEntry.
+             // This specifies such things as the track number, the track's UID and the
+             // codec used.
+-            tide::TrackEntry::Ptr track(new tide::TrackEntry(1, 1, "pointcloud2"));
++            tawara::TrackEntry::Ptr track(new tawara::TrackEntry(1, 1, "pointcloud2"));
+             track->name("3D video");
+             track->codec_name("pcl::PCLPointCloud2");
+             // Adding each level 1 element (only the first occurance, in the case of
+@@ -183,7 +183,7 @@
+             // seconds being usable.
+             // The first cluster will appear at this point in the file, so it is
+             // recorded in the segment's index for faster file reading.
+-            segment.index.insert(std::make_pair(tide::ids::Cluster,
++            segment.index.insert(std::make_pair(tawara::ids::Cluster,
+                         segment.to_segment_offset(stream_.tellp())));
+ 
+             // Set up a callback to get clouds from a grabber and write them to the
+@@ -195,7 +195,7 @@
+             // Start the first cluster
+             cltr_start_ = bpt::microsec_clock::local_time();
+             bpt::time_duration cltr_offset = cltr_start_ - seg_start_;
+-            cluster_.reset(new tide::FileCluster(
++            cluster_.reset(new tawara::FileCluster(
+                         cltr_offset.total_microseconds() / 10000));
+             cluster_->write(stream_);
+             last_ = pcl::getTime();
+@@ -224,7 +224,7 @@
+         std::string filename_;
+         std::string title_;
+         std::fstream stream_;
+-        tide::FileCluster::Ptr cluster_;
++        tawara::FileCluster::Ptr cluster_;
+         bpt::ptime seg_start_;
+         bpt::ptime cltr_start_;
+         unsigned int count_;
+@@ -247,26 +247,26 @@
+             // Open the file and check for the EBML header. This confirms that the file
+             // is an EBML file, and is a Tide document.
+             std::ifstream stream(filename_, std::ios::in);
+-            tide::ids::ReadResult id = tide::ids::read(stream);
+-            if (id.first != tide::ids::EBML)
++            tawara::ids::ReadResult id = tawara::ids::read(stream);
++            if (id.first != tawara::ids::EBML)
+             {
+                 std::cerr << "File does not begin with an EBML header.\n";
+                 return 1;
+             }
+-            tide::EBMLElement ebml_el;
++            tawara::EBMLElement ebml_el;
+             ebml_el.read(stream);
+-            if (ebml_el.doc_type() != tide::TideDocType)
++            if (ebml_el.doc_type() != tawara::TawaraDocType)
+             {
+                 std::cerr << "Specified EBML file is not a Tide document.\n";
+                 return 1;
+             }
+-            if (ebml_el.read_version() > tide::TideEBMLVersion)
++            if (ebml_el.read_version() > tawara::TawaraEBMLVersion)
+             {
+                 std::cerr << "This Tide document requires read version " <<
+                     ebml_el.read_version() << ".\n";
+                 return 1;
+             }
+-            if (ebml_el.doc_read_version() > tide::TideVersionMajor)
++            if (ebml_el.doc_read_version() > tawara::TawaraVersionMajor)
+             {
+                 std::cerr << "This Tide document requires doc read version " <<
+                     ebml_el.read_version() << ".\n";
+@@ -278,13 +278,13 @@
+             // and read (or build, if necessary) an index of the level 1 elements. With
+             // this index, we will be able to quickly jump to important elements such
+             // as the Tracks and the first Cluster.
+-            id = tide::ids::read(stream);
+-            if (id.first != tide::ids::Segment)
++            id = tawara::ids::read(stream);
++            if (id.first != tawara::ids::Segment)
+             {
+                 std::cerr << "Segment element not found\n";
+                 return 1;
+             }
+-            tide::Segment segment;
++            tawara::Segment segment;
+             segment.read(stream);
+             // The segment's date is stored as the number of nanoseconds since the
+             // start of the millenium. Boost::Date_Time is invaluable here.
+@@ -298,18 +298,18 @@
+             // one will exist).
+             // We can guarantee that there is at least one in the index because
+             // otherwise the call to segment.read() would have thrown an error.
+-            std::streampos tracks_pos(segment.index.find(tide::ids::Tracks)->second);
++            std::streampos tracks_pos(segment.index.find(tawara::ids::Tracks)->second);
+             stream.seekg(segment.to_stream_offset(tracks_pos));
+             // To be sure, we can check it really is a Tracks element, but this is
+             // usually not necessary.
+-            id = tide::ids::read(stream);
+-            if (id.first != tide::ids::Tracks)
++            id = tawara::ids::read(stream);
++            if (id.first != tawara::ids::Tracks)
+             {
+                 std::cerr << "Tracks element not at indicated position.\n";
+                 return 1;
+             }
+             // Read the tracks
+-            tide::Tracks tracks;
++            tawara::Tracks tracks;
+             tracks.read(stream);
+             // Now we can introspect the tracks available in the file.
+             if (tracks.empty())
+@@ -334,7 +334,7 @@
+             // reads blocks from the file on demand. This is usually a better
+             // option tham the memory-based cluster when the size of the stored
+             // data is large.
+-            for (tide::Segment::FileBlockIterator block(segment.blocks_begin_file(stream));
++            for (tawara::Segment::FileBlockIterator block(segment.blocks_begin_file(stream));
+                     block != segment.blocks_end_file(stream); ++block)
+             {
+                 bpt::time_duration blk_offset(bpt::microseconds((
+@@ -354,7 +354,7 @@
+                 // so there is only one frame per block. This is the general
+                 // case; lacing is typically only used when the frame size is
+                 // very small to reduce overhead.
+-                tide::BlockElement::FramePtr frame_data(*block->begin());
++                tawara::BlockElement::FramePtr frame_data(*block->begin());
+                 // Copy the frame data into a serialised cloud structure
+                 pcl::PCLPointCloud2 blob;
+                 blob.height = 480;
+--- pcl-pcl-1.7.0/tools/pcl_video.cpp.orig	2013-09-20 15:25:35.239248341 +0200
++++ pcl-pcl-1.7.0/tools/pcl_video.cpp	2013-09-20 19:03:40.298699215 +0200
+@@ -36,6 +36,8 @@
+ 
+ #include <iostream>
+ #include <string>
++#include <boost/uuid/random_generator.hpp>
++#include <boost/uuid/uuid.hpp>
+ #include <tawara/ebml_element.h>
+ #include <tawara/file_cluster.h>
+ #include <tawara/segment.h>
+@@ -61,7 +63,7 @@
+     public:
+         Recorder(std::string const& filename, std::string const& title)
+             : filename_(filename), title_(title),
+-            stream_(filename, std::ios::in|std::ios::out|std::ios::trunc),
++            stream_(filename.c_str(), std::ios::in|std::ios::out|std::ios::trunc),
+             count_(0)
+         {
+         }
+@@ -246,7 +248,7 @@
+         {
+             // Open the file and check for the EBML header. This confirms that the file
+             // is an EBML file, and is a Tide document.
+-            std::ifstream stream(filename_, std::ios::in);
++            std::ifstream stream(filename_.c_str(), std::ios::in);
+             tawara::ids::ReadResult id = tawara::ids::read(stream);
+             if (id.first != tawara::ids::EBML)
+             {
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/pcl.git/commitdiff/0a13f061e754312fc31b8a2e6378da37f5c9e6a5



More information about the pld-cvs-commit mailing list