Fawkes API Fawkes Development Version
stn-generator_thread.h
1
2/***************************************************************************
3 * stn-generator_thread.h - stn-generator
4 *
5 * Created: Sat May 6 20:16:21 2017
6 * Copyright 2017 Matthias Loebach
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_STN_GENERATOR_THREAD_H_
23#define _PLUGINS_STN_GENERATOR_THREAD_H_
24
25#include "stn.h"
26
27#include <aspect/blackboard.h>
28#include <aspect/configurable.h>
29#include <aspect/logging.h>
30#include <blackboard/interface_listener.h>
31#include <core/threading/thread.h>
32#include <interfaces/PddlPlannerInterface.h>
33#include <plugins/robot-memory/aspect/robot_memory_aspect.h>
34
35namespace fawkes {
36// add forward declarations here, e.g., interfaces
37}
38
45{
46public:
48
49 virtual void init();
50 virtual void finalize();
51 virtual void loop();
52
53 virtual void bb_interface_data_refreshed(fawkes::Interface *interface) noexcept;
54
55 /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
56protected:
57 virtual void
59 {
60 Thread::run();
61 }
62
63private:
64 std::string cfg_plan_collection_;
65 bool cfg_publish_to_robot_memory_;
66 bool cfg_draw_graph_;
67 size_t num_published_actions_ = 0;
68 std::string cfg_output_collection_;
69 std::string cfg_pddl_problem_path_;
70 fawkes::PddlPlannerInterface *plan_if_;
71
72 fawkes::stn::Stn *stn_;
73};
74
75#endif
Generates an STN representation of a sequential task plan.
virtual void finalize()
Finalize the thread.
virtual void bb_interface_data_refreshed(fawkes::Interface *interface) noexcept
BlackBoard data refreshed notification.
virtual void loop()
Code to execute in the thread.
StnGeneratorThread()
Constructor.
virtual void run()
Stub to see name in backtrace for easier debugging.
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
Thread aspect to get access to a the RobotMemory.
Thread class encapsulation of pthreads.
Definition: thread.h:46
A Simple Temporal Network.
Definition: stn.h:43
Fawkes library namespace.