Point Cloud Library (PCL)  1.11.0
tracker.h
1 /*
2  * Software License Agreement (BSD License)
3  *
4  * Point Cloud Library (PCL) - www.pointclouds.org
5  * Copyright (c) 2010-2012, Willow Garage, Inc.
6  *
7  * All rights reserved.
8  *
9  * Redistribution and use in source and binary forms, with or without
10  * modification, are permitted provided that the following conditions
11  * are met:
12  *
13  * * Redistributions of source code must retain the above copyright
14  * notice, this list of conditions and the following disclaimer.
15  * * Redistributions in binary form must reproduce the above
16  * copyright notice, this list of conditions and the following
17  * disclaimer in the documentation and/or other materials provided
18  * with the distribution.
19  * * Neither the name of Willow Garage, Inc. nor the names of its
20  * contributors may be used to endorse or promote products derived
21  * from this software without specific prior written permission.
22  *
23  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
24  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
25  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
26  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
27  * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
28  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
29  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
31  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
32  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
33  * ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
34  * POSSIBILITY OF SUCH DAMAGE.
35  *
36  * $Id: point_cloud.h 4696 2012-02-23 06:12:55Z rusu $
37  *
38  */
39 
40 #pragma once
41 
42 #include <pcl/tracking/tracking.h>
43 #include <pcl/memory.h>
44 #include <pcl/pcl_base.h>
45 #include <pcl/pcl_macros.h>
46 #include <pcl/search/search.h>
47 
48 namespace pcl
49 {
50  namespace tracking
51  {
52  /** \brief @b Tracker represents the base tracker class.
53  * \author Ryohei Ueda
54  * \ingroup tracking
55  */
56  template <typename PointInT, typename StateT>
57  class Tracker: public PCLBase<PointInT>
58  {
59  protected:
61 
62  public:
65 
67  using Ptr = shared_ptr< Tracker<PointInT, StateT> >;
68  using ConstPtr = shared_ptr< const Tracker<PointInT, StateT> >;
69 
72 
76 
80 
81  public:
82  /** \brief Empty constructor. */
83  Tracker (): search_ () {}
84 
85  /** \brief Base method for tracking for all points given in
86  * <setInputCloud (), setIndices ()> using the indices in setIndices ()
87  */
88  void
89  compute ();
90 
91  protected:
92  /** \brief The tracker name. */
93  std::string tracker_name_;
94 
95  /** \brief A pointer to the spatial search object. */
97 
98  /** \brief Get a string representation of the name of this class. */
99  inline const std::string&
100  getClassName () const { return (tracker_name_); }
101 
102  /** \brief This method should get called before starting the actual computation. */
103  virtual bool
104  initCompute ();
105 
106  /** \brief Provide a pointer to a dataset to add additional information
107  * to estimate the features for every point in the input dataset. This
108  * is optional, if this is not set, it will only use the data in the
109  * input cloud to estimate the features. This is useful when you only
110  * need to compute the features for a downsampled cloud.
111  * \param search a pointer to a PointCloud message
112  */
113  inline void
114  setSearchMethod (const SearchPtr &search) { search_ = search; }
115 
116  /** \brief Get a pointer to the point cloud dataset. */
117  inline SearchPtr
118  getSearchMethod () { return (search_); }
119 
120  /** \brief Get an instance of the result of tracking. */
121  virtual StateT
122  getResult () const = 0;
123 
124  private:
125  /** \brief Abstract tracking method. */
126  virtual void
127  computeTracking () = 0;
128 
129  public:
131  };
132  }
133 }
134 
135 #include <pcl/tracking/impl/tracker.hpp>
pcl_macros.h
Defines all the PCL and non-PCL macros used.
pcl
Definition: convolution.h:46
pcl::search::Search::ConstPtr
shared_ptr< const pcl::search::Search< PointT > > ConstPtr
Definition: search.h:82
pcl::tracking::Tracker< PointInT, Eigen::Affine3f >::ConstPtr
shared_ptr< const Tracker< PointInT, Eigen::Affine3f > > ConstPtr
Definition: tracker.h:68
pcl::tracking::Tracker::setSearchMethod
void setSearchMethod(const SearchPtr &search)
Provide a pointer to a dataset to add additional information to estimate the features for every point...
Definition: tracker.h:114
pcl::PCLBase
PCL base class.
Definition: pcl_base.h:70
pcl::PointCloud< PointInT >
pcl::tracking::Tracker::tracker_name_
std::string tracker_name_
The tracker name.
Definition: tracker.h:93
pcl::tracking::Tracker< PointInT, Eigen::Affine3f >::SearchPtr
typename pcl::search::Search< PointInT >::Ptr SearchPtr
Definition: tracker.h:70
pcl::tracking::Tracker< PointInT, Eigen::Affine3f >::SearchConstPtr
typename pcl::search::Search< PointInT >::ConstPtr SearchConstPtr
Definition: tracker.h:71
pcl::tracking::Tracker::initCompute
virtual bool initCompute()
This method should get called before starting the actual computation.
Definition: tracker.hpp:9
pcl::search::Search::Ptr
shared_ptr< pcl::search::Search< PointT > > Ptr
Definition: search.h:81
PCL_MAKE_ALIGNED_OPERATOR_NEW
#define PCL_MAKE_ALIGNED_OPERATOR_NEW
Macro to signal a class requires a custom allocator.
Definition: memory.h:63
pcl::tracking::Tracker::Tracker
Tracker()
Empty constructor.
Definition: tracker.h:83
pcl::tracking::Tracker::getSearchMethod
SearchPtr getSearchMethod()
Get a pointer to the point cloud dataset.
Definition: tracker.h:118
pcl::tracking::Tracker::getResult
virtual StateT getResult() const =0
Get an instance of the result of tracking.
pcl::tracking::Tracker< PointInT, Eigen::Affine3f >::PointCloudStateConstPtr
typename PointCloudState::ConstPtr PointCloudStateConstPtr
Definition: tracker.h:79
pcl::tracking::Tracker< PointInT, Eigen::Affine3f >::PointCloudStatePtr
typename PointCloudState::Ptr PointCloudStatePtr
Definition: tracker.h:78
pcl::PointCloud< PointInT >::Ptr
shared_ptr< PointCloud< PointInT > > Ptr
Definition: point_cloud.h:428
pcl::tracking::Tracker< PointInT, Eigen::Affine3f >::Ptr
shared_ptr< Tracker< PointInT, Eigen::Affine3f > > Ptr
Definition: tracker.h:67
pcl::PointCloud< PointInT >::ConstPtr
shared_ptr< const PointCloud< PointInT > > ConstPtr
Definition: point_cloud.h:429
pcl::tracking::Tracker::search_
SearchPtr search_
A pointer to the spatial search object.
Definition: tracker.h:96
pcl::tracking::Tracker::compute
void compute()
Base method for tracking for all points given in <setInputCloud (), setIndices ()> using the indices ...
Definition: tracker.hpp:30
pcl::tracking::Tracker< PointInT, Eigen::Affine3f >::PointCloudInConstPtr
typename PointCloudIn::ConstPtr PointCloudInConstPtr
Definition: tracker.h:75
pcl::tracking::Tracker::getClassName
const std::string & getClassName() const
Get a string representation of the name of this class.
Definition: tracker.h:100
pcl::tracking::Tracker
Tracker represents the base tracker class.
Definition: tracker.h:58
memory.h
Defines functions, macros and traits for allocating and using memory.
pcl::tracking::Tracker< PointInT, Eigen::Affine3f >::PointCloudInPtr
typename PointCloudIn::Ptr PointCloudInPtr
Definition: tracker.h:74