Fawkes API  Fawkes Development Version
visualization_thread.h
1 
2 /***************************************************************************
3  * visualization_thread.h - Visualization for navgraph-generator via rviz
4  *
5  * Created: Fri Mar 27 12:07:00 2015
6  * Copyright 2011-2015 Tim Niemueller [www.niemueller.de]
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_NAVGRAPH_GENERATOR_VISUALIZATION_THREAD_H_
23 #define __PLUGINS_NAVGRAPH_GENERATOR_VISUALIZATION_THREAD_H_
24 
25 #include "navgraph_generator_thread.h"
26 
27 #include <core/threading/thread.h>
28 #include <core/threading/mutex.h>
29 #include <aspect/configurable.h>
30 #include <aspect/logging.h>
31 #include <plugins/ros/aspect/ros.h>
32 
33 #include <ros/publisher.h>
34 #include <visualization_msgs/MarkerArray.h>
35 
36 
38 : public fawkes::Thread,
40  public fawkes::LoggingAspect,
41  public fawkes::ROSAspect
42 {
43  public:
45 
46  virtual void init();
47  virtual void loop();
48  virtual void finalize();
49 
50  void publish(const NavGraphGeneratorThread::ObstacleMap &obstacles,
51  const NavGraphGeneratorThread::ObstacleMap &map_obstacles,
52  const NavGraphGeneratorThread::PoiMap &pois);
53 
54  private:
55  std::string cfg_global_frame_;
56 
57  size_t last_id_num_;
58  ros::Publisher vispub_;
59 
60  NavGraphGeneratorThread::ObstacleMap obstacles_;
61  NavGraphGeneratorThread::ObstacleMap map_obstacles_;
62  NavGraphGeneratorThread::PoiMap pois_;
63 };
64 
65 #endif
Thread aspect to get access to a ROS node handle.
Definition: ros.h:39
void publish(const NavGraphGeneratorThread::ObstacleMap &obstacles, const NavGraphGeneratorThread::ObstacleMap &map_obstacles, const NavGraphGeneratorThread::PoiMap &pois)
Trigger publishing of visualization.
Thread class encapsulation of pthreads.
Definition: thread.h:42
virtual void loop()
Code to execute in the thread.
Thread aspect to log output.
Definition: logging.h:35
Send Marker messages to rviz to show navgraph-generator info.
Thread aspect to access configuration data.
Definition: configurable.h:35
virtual void init()
Initialize the thread.
virtual void finalize()
Finalize the thread.