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 <actionlib/client/simple_action_client.h>
26 #include <aspect/blackboard.h>
27 #include <aspect/blocked_timing.h>
28 #include <aspect/configurable.h>
29 #include <aspect/logging.h>
30 #include <core/threading/thread.h>
31 #include <fawkes_msgs/NavGraphGotoAction.h>
32 #include <fawkes_msgs/NavGraphGotoGoal.h>
33 #include <ros/ros.h>
34 
35 #include <string>
36 
37 namespace fawkes {
38 class NavigatorInterface;
39 }
40 
43  public fawkes::LoggingAspect,
46 {
47 public:
49 
50  virtual void init();
51  virtual void finalize();
52  virtual void loop();
53 
54  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
55 protected:
56  virtual void
57  run()
58  {
59  Thread::run();
60  }
61 
62 private:
63  typedef actionlib::SimpleActionClient<fawkes_msgs::NavGraphGotoAction> NavGraphGotoClient;
64 
65  std::string cfg_action_topic_;
66 
67  fawkes::NavigatorInterface * pp_nav_if_;
68  NavGraphGotoClient * ac_;
69  fawkes_msgs::NavGraphGotoGoal goal_;
70  bool goal_active_;
71  bool was_connected_;
72 };
73 
74 #endif /* ROS_NAVIGATOR_THREAD_H__ */
RosNavgraphBreakoutThread::loop
virtual void loop()
Code to execute in the thread.
Definition: navgraph_breakout_thread.cpp:74
RosNavgraphBreakoutThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition: navgraph_breakout_thread.h:57
fawkes::BlockedTimingAspect
Thread aspect to use blocked timing.
Definition: blocked_timing.h:51
RosNavgraphBreakoutThread
Provide navgraph-like API through ROS.
Definition: navgraph_breakout_thread.h:46
RosNavgraphBreakoutThread::init
virtual void init()
Initialize the thread.
Definition: navgraph_breakout_thread.cpp:41
fawkes::BlackBoardAspect
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
fawkes
Fawkes library namespace.
fawkes::LoggingAspect
Thread aspect to log output.
Definition: logging.h:33
RosNavgraphBreakoutThread::RosNavgraphBreakoutThread
RosNavgraphBreakoutThread()
Contructor.
Definition: navgraph_breakout_thread.cpp:34
RosNavgraphBreakoutThread::finalize
virtual void finalize()
Finalize the thread.
Definition: navgraph_breakout_thread.cpp:62
fawkes::Thread
Thread class encapsulation of pthreads.
Definition: thread.h:46
fawkes::ConfigurableAspect
Thread aspect to access configuration data.
Definition: configurable.h:33
fawkes::NavigatorInterface
NavigatorInterface Fawkes BlackBoard Interface.
Definition: NavigatorInterface.h:34