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 
35 namespace fawkes {
36 // add forward declarations here, e.g., interfaces
37 }
38 
40  public fawkes::LoggingAspect,
45 {
46 public:
48 
49  virtual void init();
50  virtual void finalize();
51  virtual void loop();
52 
53  virtual void bb_interface_data_changed(fawkes::Interface *interface) throw();
54 
55  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
56 protected:
57  virtual void
58  run()
59  {
60  Thread::run();
61  }
62 
63 private:
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
StnGeneratorThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: stn-generator_thread.h:58
StnGeneratorThread::loop
virtual void loop()
Code to execute in the thread.
Definition: stn-generator_thread.cpp:92
StnGeneratorThread::finalize
virtual void finalize()
Finalize the thread.
Definition: stn-generator_thread.cpp:155
StnGeneratorThread
Definition: stn-generator_thread.h:39
fawkes::BlackBoardInterfaceListener
Definition: interface_listener.h:47
fawkes::stn::Stn
Definition: stn.h:52
StnGeneratorThread::bb_interface_data_changed
virtual void bb_interface_data_changed(fawkes::Interface *interface)
BlackBoard data changed notification.
Definition: stn-generator_thread.cpp:161
StnGeneratorThread::StnGeneratorThread
StnGeneratorThread()
Constructor.
Definition: stn-generator_thread.cpp:43
fawkes::BlackBoardAspect
Definition: blackboard.h:38
fawkes
fawkes::LoggingAspect
Definition: logging.h:38
fawkes::Interface
Definition: interface.h:78
fawkes::Thread
Definition: thread.h:45
fawkes::ConfigurableAspect
Definition: configurable.h:38
fawkes::RobotMemoryAspect
Definition: robot_memory_aspect.h:39
StnGeneratorThread::init
virtual void init()
Initialize the thread.
Definition: stn-generator_thread.cpp:50