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 <core/threading/thread.h>
26 #include <aspect/clock.h>
27 #include <aspect/configurable.h>
28 #include <aspect/logging.h>
29 #include <aspect/blackboard.h>
30 #include <aspect/pointcloud.h>
31 #include <plugins/mongodb/aspect/mongodb.h>
32 
33 #include <pcl/point_types.h>
34 #include <pcl/point_cloud.h>
35 
36 namespace fawkes {
37  class PclDatabaseStoreInterface;
38  class BlackBoardOnMessageWaker;
39 }
40 class PointCloudAdapter;
41 
43 : public fawkes::Thread,
44  public fawkes::ClockAspect,
45  public fawkes::LoggingAspect,
48  public fawkes::MongoDBAspect,
50 {
51  public:
53  virtual ~PointCloudDBStoreThread();
54 
55  virtual void init();
56  virtual void loop();
57  virtual void finalize();
58 
59  private:
60  bool store_pointcloud(std::string pcl_id, std::string database,
61  std::string collection, std::string &errmsg);
62 
63 
64  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
65  protected: virtual void run() { Thread::run(); }
66 
67  private: // members
70  PointCloudAdapter *adapter_;
71 
72  std::string cfg_input_id_;
73  std::string cfg_database_;
74 };
75 
76 #endif
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:36
Fawkes library namespace.
Thread aspect to provide and access point clouds.
Definition: pointcloud.h:40
virtual void run()
Code to execute in the thread.
Definition: thread.cpp:939
Wake threads on receiving a blackboard message.
Thread class encapsulation of pthreads.
Definition: thread.h:42
Thread aspect to access MongoDB.
Definition: mongodb.h:40
Thread aspect to log output.
Definition: logging.h:35
Thread aspect to access configuration data.
Definition: configurable.h:35
Thread to store point clouds from database on request.
Point cloud adapter class.
Definition: pcl_adapter.h:38
PclDatabaseStoreInterface Fawkes BlackBoard Interface.
virtual void run()
Stub to see name in backtrace for easier debugging.