Fawkes API Fawkes Development Version
pddl_robot_memory_thread.h
1
2/***************************************************************************
3 * pddl_robot_memory_thread.h - pddl_robot_memory
4 *
5 * Plugin created: Thu Oct 13 13:34:05 2016
6
7 * Copyright 2016 Frederik Zwilling
8 *
9 ****************************************************************************/
10
11/* This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License as published by
13 * the Free Software Foundation; either version 2 of the License, or
14 * (at your option) any later version.
15 *
16 * This program is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Library General Public License for more details.
20 *
21 * Read the full text in the LICENSE.GPL file in the doc directory.
22 */
23
24#ifndef _PLUGINS_PDDL_ROBOT_MEMORYTHREAD_H_
25#define _PLUGINS_PDDL_ROBOT_MEMORYTHREAD_H_
26
27#include "interfaces/PddlGenInterface.h"
28
29#include <aspect/blackboard.h>
30#include <aspect/configurable.h>
31#include <aspect/logging.h>
32#include <blackboard/interface_listener.h>
33#include <core/threading/thread.h>
34#include <ctemplate/template.h>
35#include <plugins/robot-memory/aspect/robot_memory_aspect.h>
36
37#include <bsoncxx/document/view.hpp>
38#include <string>
39
40namespace fawkes {
41}
42
49{
50public:
52
53 virtual void init();
54 virtual void finalize();
55 virtual void loop();
56
57 /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
58protected:
59 virtual void
61 {
62 Thread::run();
63 }
64
65private:
66 fawkes::PddlGenInterface *gen_if;
67
68 std::string collection;
69 std::string input_path;
70 std::string output_path;
71 std::string goal;
72
73 void fill_dict_from_document(ctemplate::TemplateDictionary *dict,
74 const bsoncxx::document::view &obj,
75 std::string prefix = "");
76 void generate();
77
78 virtual bool bb_interface_message_received(fawkes::Interface *interface,
79 fawkes::Message * message) noexcept;
80};
81
82#endif
Generate PDDL files from the robot memory.
virtual void run()
Stub to see name in backtrace for easier debugging.
virtual void loop()
Thread is only waked up if there is a new interface message to generate a pddl.
virtual void finalize()
Finalize the thread.
virtual void init()
Initialize the thread.
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
BlackBoard interface listener.
Thread aspect to access configuration data.
Definition: configurable.h:33
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:80
Thread aspect to log output.
Definition: logging.h:33
Base class for all messages passed through interfaces in Fawkes BlackBoard.
Definition: message.h:44
Thread aspect to get access to a the RobotMemory.
Thread class encapsulation of pthreads.
Definition: thread.h:46
Fawkes library namespace.