Fawkes API  Fawkes Development Version
navgraph_breakout_thread.h
1 
2 /***************************************************************************
3  * navgraph_breakout_thread.h - Provide navgraph-like API through ROS
4  *
5  * Created: Fri Jan 27 11:20:32 2017
6  * Copyright 2017 Tim Niemueller
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 __ROS_NAVGRAPH_BREAKOUT_THREAD_H_
23 #define __ROS_NAVGRAPH_BREAKOUT_THREAD_H_
24 
25 #include <core/threading/thread.h>
26 #include <aspect/blocked_timing.h>
27 #include <aspect/logging.h>
28 #include <aspect/blackboard.h>
29 #include <aspect/configurable.h>
30 
31 #include <ros/ros.h>
32 #include <fawkes_msgs/NavGraphGotoAction.h>
33 #include <fawkes_msgs/NavGraphGotoGoal.h>
34 #include <actionlib/client/simple_action_client.h>
35 
36 #include <string>
37 
38 namespace fawkes {
39  class NavigatorInterface;
40 }
41 
43 : public fawkes::Thread,
45  public fawkes::LoggingAspect,
48 {
49  public:
51 
52  virtual void init();
53  virtual void finalize();
54  virtual void loop();
55 
56  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
57  protected: virtual void run() { Thread::run(); }
58 
59  private:
60  typedef actionlib::SimpleActionClient<fawkes_msgs::NavGraphGotoAction> NavGraphGotoClient;
61 
62  std::string cfg_action_topic_;
63 
64  fawkes::NavigatorInterface *pp_nav_if_;
65  NavGraphGotoClient *ac_;
66  fawkes_msgs::NavGraphGotoGoal goal_;
67  bool goal_active_;
68  bool was_connected_;
69 };
70 
71 #endif /* __ROS_NAVIGATOR_THREAD_H_ */
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Fawkes library namespace.
virtual void run()
Code to execute in the thread.
Definition: thread.cpp:939
Thread class encapsulation of pthreads.
Definition: thread.h:42
Thread aspect to use blocked timing.
Provide navgraph-like API through ROS.
Thread aspect to log output.
Definition: logging.h:35
Thread aspect to access configuration data.
Definition: configurable.h:35
virtual void run()
Stub to see name in backtrace for easier debugging.
NavigatorInterface Fawkes BlackBoard Interface.