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 <aspect/configurable.h>
28#include <aspect/logging.h>
29#include <core/threading/mutex.h>
30#include <core/threading/thread.h>
31#include <plugins/ros/aspect/ros.h>
32#include <ros/publisher.h>
33#include <visualization_msgs/MarkerArray.h>
34
39{
40public:
42
43 virtual void init();
44 virtual void loop();
45 virtual void finalize();
46
47 void publish(const NavGraphGeneratorThread::ObstacleMap &obstacles,
48 const NavGraphGeneratorThread::ObstacleMap &map_obstacles,
49 const NavGraphGeneratorThread::PoiMap & pois);
50
51private:
52 std::string cfg_global_frame_;
53
54 size_t last_id_num_;
55 ros::Publisher vispub_;
56
57 NavGraphGeneratorThread::ObstacleMap obstacles_;
58 NavGraphGeneratorThread::ObstacleMap map_obstacles_;
59 NavGraphGeneratorThread::PoiMap pois_;
60};
61
62#endif
Send Marker messages to rviz to show navgraph-generator info.
virtual void loop()
Code to execute in the thread.
void publish(const NavGraphGeneratorThread::ObstacleMap &obstacles, const NavGraphGeneratorThread::ObstacleMap &map_obstacles, const NavGraphGeneratorThread::PoiMap &pois)
Trigger publishing of visualization.
virtual void init()
Initialize the thread.
virtual void finalize()
Finalize the thread.
Thread aspect to access configuration data.
Definition: configurable.h:33
Thread aspect to log output.
Definition: logging.h:33
Thread aspect to get access to a ROS node handle.
Definition: ros.h:39
Thread class encapsulation of pthreads.
Definition: thread.h:46