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 <plugins/mongodb/aspect/mongodb.h>
40
41#include <string>
42
43namespace fawkes {
44class Mutex;
45class RobotMemoryInterface;
46class TimeWait;
47#ifdef USE_TIMETRACKER
48class TimeTracker;
49#endif
50} // namespace fawkes
51
60{
61public:
63 virtual ~RobotMemoryThread();
64
65 virtual void init();
66 virtual void loop();
67 virtual void finalize();
68
69 /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
70protected:
71 virtual void
73 {
74 Thread::run();
75 }
76
77private:
78 RobotMemory * robot_memory;
79 fawkes::RobotMemoryIniFin robot_memory_inifin_;
80 BlackboardComputable * blackboard_computable;
81 TransformComputable * transform_computable;
82
83 fawkes::TimeWait *timewait_;
84
85#ifdef USE_TIMETRACKER
87 unsigned int tt_loopcount_;
88 unsigned int ttc_msgproc_;
89 unsigned int ttc_rmloop_;
90#endif
91};
92
93#endif
Computable providing access to blackboard interfaces.
Thread that provides a robot memory with MongoDB.
virtual void loop()
Code to execute in the thread.
virtual void init()
Initialize the thread.
virtual ~RobotMemoryThread()
Destructor.
virtual void run()
Stub to see name in backtrace for easier debugging.
RobotMemoryThread()
Constructor for thread.
virtual void finalize()
Finalize the thread.
Access to the robot memory based on mongodb.
Definition: robot_memory.h:47
Computable proving positions in other frames by using transforms.
Thread aspect provide a new aspect.
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:34
Thread aspect to access configuration data.
Definition: configurable.h:33
Thread aspect to log output.
Definition: logging.h:33
Thread aspect to access MongoDB.
Definition: mongodb.h:39
RobotMemoryAspect initializer/finalizer.
Thread class encapsulation of pthreads.
Definition: thread.h:46
Time tracking utility.
Definition: tracker.h:37
Time wait utility.
Definition: wait.h:33
Thread aspect to access the transform system.
Definition: tf.h:39
Fawkes library namespace.