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 <mongo/client/dbclient.h>
34 #include <plugins/robot-memory/aspect/robot_memory_aspect.h>
35 
36 namespace fawkes {
37 // add forward declarations here, e.g., interfaces
38 }
39 
41  public fawkes::LoggingAspect,
46 {
47 public:
49 
50  virtual void init();
51  virtual void finalize();
52  virtual void loop();
53 
54  virtual void bb_interface_data_changed(fawkes::Interface *interface) throw();
55 
56  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
57 protected:
58  virtual void
59  run()
60  {
61  Thread::run();
62  }
63 
64 private:
65  std::string cfg_plan_collection_;
66  bool cfg_publish_to_robot_memory_;
67  bool cfg_draw_graph_;
68  size_t num_published_actions_ = 0;
69  std::string cfg_output_collection_;
70  std::string cfg_pddl_problem_path_;
71  fawkes::PddlPlannerInterface *plan_if_;
72 
73  fawkes::stn::Stn *stn_;
74 };
75 
76 #endif
Thread aspect to get access to a the RobotMemory.
A Simple Temporal Network.
Definition: stn.h:41
Thread aspect to access to BlackBoard.
Definition: blackboard.h:33
Fawkes library namespace.
Generates an STN representation of a sequential task plan.
StnGeneratorThread()
Constructor.
Thread class encapsulation of pthreads.
Definition: thread.h:45
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:78
virtual void init()
Initialize the thread.
virtual void loop()
Code to execute in the thread.
virtual void run()
Stub to see name in backtrace for easier debugging.
virtual void bb_interface_data_changed(fawkes::Interface *interface)
BlackBoard data changed notification.
Thread aspect to log output.
Definition: logging.h:32
Thread aspect to access configuration data.
Definition: configurable.h:32
virtual void finalize()
Finalize the thread.
BlackBoard interface listener.