Fawkes API  Fawkes Development Version
robot_memory_thread.h
1 
2 /***************************************************************************
3  * robot_memory_thread.h - Robot Memory thread
4  *
5  * Created: Sun May 01 13:39:52 2016
6  * Copyright 2016 Frederik Zwilling
7  * 2017 Tim Niemueller [www.niemueller.de]
8  ****************************************************************************/
9 
10 /* This program is free software; you can redistribute it and/or modify
11  * it under the terms of the GNU General Public License as published by
12  * the Free Software Foundation; either version 2 of the License, or
13  * (at your option) any later version.
14  *
15  * This program is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18  * GNU Library General Public License for more details.
19  *
20  * Read the full text in the LICENSE.GPL file in the doc directory.
21  */
22 
23 #ifndef _PLUGINS_ROBOT_MEMORY_THREAD_H_
24 #define _PLUGINS_ROBOT_MEMORY_THREAD_H_
25 
26 #include "aspect/robot_memory_inifin.h"
27 #include "computables/blackboard_computable.h"
28 #include "computables/transform_computable.h"
29 #include "robot_memory.h"
30 
31 #include <aspect/aspect_provider.h>
32 #include <aspect/blackboard.h>
33 #include <aspect/blocked_timing.h>
34 #include <aspect/clock.h>
35 #include <aspect/configurable.h>
36 #include <aspect/logging.h>
37 #include <aspect/tf.h>
38 #include <core/threading/thread.h>
39 #include <mongo/client/dbclient.h>
40 #include <plugins/mongodb/aspect/mongodb.h>
41 
42 #include <string>
43 
44 namespace fawkes {
45 class Mutex;
46 class RobotMemoryInterface;
47 } // namespace fawkes
48 
50  public fawkes::LoggingAspect,
52  public fawkes::ClockAspect,
53  public fawkes::MongoDBAspect,
58 {
59 public:
61  virtual ~RobotMemoryThread();
62 
63  virtual void init();
64  virtual void loop();
65  virtual void finalize();
66 
67  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
68 protected:
69  virtual void
70  run()
71  {
72  Thread::run();
73  }
74 
75 private:
76  RobotMemory * robot_memory;
77  fawkes::RobotMemoryIniFin robot_memory_inifin_;
78  BlackboardComputable * blackboard_computable;
79  TransformComputable * transform_computable;
80 };
81 
82 #endif
Thread aspect to access to BlackBoard.
Definition: blackboard.h:33
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:33
RobotMemoryThread()
Constructor for thread.
Fawkes library namespace.
virtual void run()
Stub to see name in backtrace for easier debugging.
Computable providing access to blackboard interfaces.
virtual void finalize()
Finalize the thread.
Thread class encapsulation of pthreads.
Definition: thread.h:45
Computable proving positions in other frames by using transforms.
Thread aspect to access the transform system.
Definition: tf.h:38
virtual void init()
Initialize the thread.
Thread aspect to use blocked timing.
Thread aspect to access MongoDB.
Definition: mongodb.h:39
Thread that provides a robot memory with MongoDB.
virtual void loop()
Code to execute in the thread.
Thread aspect to log output.
Definition: logging.h:32
Thread aspect provide a new aspect.
Thread aspect to access configuration data.
Definition: configurable.h:32
Access to the robot memory based on mongodb.
Definition: robot_memory.h:48
virtual ~RobotMemoryThread()
Destructor.
RobotMemoryAspect initializer/finalizer.