Fawkes API  Fawkes Development Version
pcl_db_store_thread.h
1 
2 /***************************************************************************
3  * pcl_db_store_thread.h - Store point clouds to MongoDB
4  *
5  * Created: Mon May 05 14:26:15 2014
6  * Copyright 2012-2014 Tim Niemueller [www.niemueller.de]
7  ****************************************************************************/
8 
9 /* This program is free software; you can redistribute it and/or modify
10  * it under the terms of the GNU General Public License as published by
11  * the Free Software Foundation; either version 2 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17  * GNU Library General Public License for more details.
18  *
19  * Read the full text in the LICENSE.GPL file in the doc directory.
20  */
21 
22 #ifndef _PLUGINS_PERCEPTION_PCL_DB_STORE_PCL_DB_STORE_THREAD_H_
23 #define _PLUGINS_PERCEPTION_PCL_DB_STORE_PCL_DB_STORE_THREAD_H_
24 
25 #include <aspect/blackboard.h>
26 #include <aspect/clock.h>
27 #include <aspect/configurable.h>
28 #include <aspect/logging.h>
29 #include <aspect/pointcloud.h>
30 #include <core/threading/thread.h>
31 #include <pcl/point_cloud.h>
32 #include <pcl/point_types.h>
33 #include <plugins/mongodb/aspect/mongodb.h>
34 
35 namespace fawkes {
36 class PclDatabaseStoreInterface;
37 class BlackBoardOnMessageWaker;
38 } // namespace fawkes
39 class PointCloudAdapter;
40 
42  public fawkes::ClockAspect,
43  public fawkes::LoggingAspect,
46  public fawkes::MongoDBAspect,
48 {
49 public:
51  virtual ~PointCloudDBStoreThread();
52 
53  virtual void init();
54  virtual void loop();
55  virtual void finalize();
56 
57 private:
58  bool store_pointcloud(std::string pcl_id,
59  std::string database,
60  std::string collection,
61  std::string &errmsg);
62 
63  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
64 protected:
65  virtual void
66  run()
67  {
68  Thread::run();
69  }
70 
71 private: // members
72  fawkes::PclDatabaseStoreInterface *store_if_;
74  PointCloudAdapter * adapter_;
75 
76  std::string cfg_input_id_;
77  std::string cfg_database_;
78 };
79 
80 #endif
PointCloudDBStoreThread
Definition: pcl_db_store_thread.h:40
fawkes::MongoDBAspect
Definition: mongodb.h:41
PointCloudDBStoreThread::~PointCloudDBStoreThread
virtual ~PointCloudDBStoreThread()
Destructor.
Definition: pcl_db_store_thread.cpp:51
PointCloudDBStoreThread::PointCloudDBStoreThread
PointCloudDBStoreThread()
Constructor.
Definition: pcl_db_store_thread.cpp:45
PointCloudDBStoreThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: pcl_db_store_thread.h:65
PointCloudDBStoreThread::init
virtual void init()
Initialize the thread.
Definition: pcl_db_store_thread.cpp:56
PointCloudDBStoreThread::loop
virtual void loop()
Code to execute in the thread.
Definition: pcl_db_store_thread.cpp:85
PointCloudDBStoreThread::finalize
virtual void finalize()
Finalize the thread.
Definition: pcl_db_store_thread.cpp:77
fawkes::BlackBoardAspect
Definition: blackboard.h:36
fawkes::PointCloudAspect
Definition: pointcloud.h:36
fawkes
fawkes::LoggingAspect
Definition: logging.h:36
PointCloudAdapter
Definition: pcl_adapter.h:37
fawkes::Thread
Definition: thread.h:44
fawkes::BlackBoardOnMessageWaker
Definition: on_message_waker.h:39
fawkes::ConfigurableAspect
Definition: configurable.h:36
fawkes::ClockAspect
Definition: clock.h:38