Fawkes API Fawkes Development Version
visualization_thread.h
1
2/***************************************************************************
3 * visualization_thread.h - Visualization for colli
4 *
5 * Created: Fri Oct 18 15:16:23 2013
6 * Copyright 2013 Bahram Maleki-Fard
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_COLLI_VISUALIZATION_THREAD_H_
23#define _PLUGINS_COLLI_VISUALIZATION_THREAD_H_
24
25#ifdef HAVE_VISUAL_DEBUGGING
26
27# include "common/types.h"
28
29# include <aspect/configurable.h>
30# include <aspect/logging.h>
31# include <aspect/tf.h>
32# include <core/threading/mutex.h>
33# include <core/threading/thread.h>
34# include <plugins/ros/aspect/ros.h>
35
36# include <vector>
37
38namespace ros {
39class Publisher;
40}
41
42namespace fawkes {
43class LaserOccupancyGrid;
44class Search;
45class RoboShapeColli;
46typedef struct point_struct point_t;
47} // namespace fawkes
48
49class ColliVisualizationThread : public fawkes::Thread,
54{
55public:
56 ColliVisualizationThread();
57
58 virtual void init();
59 virtual void loop();
60 virtual void finalize();
61
62 virtual void setup(fawkes::LaserOccupancyGrid *occ_grid, fawkes::Search *search);
63
64private:
65 fawkes::Mutex mutex_;
66
68 fawkes::Search * search_;
69 fawkes::RoboShapeColli * roboshape_;
70 fawkes::colli_cell_cost_t cell_costs_;
71
72 ros::Publisher *pub_roboshape_;
73
74 ros::Publisher *pub_cells_occ_;
75 ros::Publisher *pub_cells_near_;
76 ros::Publisher *pub_cells_mid_;
77 ros::Publisher *pub_cells_far_;
78 ros::Publisher *pub_cells_free_;
79 ros::Publisher *pub_search_path_;
80
81 std::vector<fawkes::point_t> cells_occ_;
82 std::vector<fawkes::point_t> cells_near_;
83 std::vector<fawkes::point_t> cells_mid_;
84 std::vector<fawkes::point_t> cells_far_;
85 std::vector<fawkes::point_t> cells_free_;
86
87 std::string frame_base_;
88 std::string frame_laser_;
89};
90
91#endif
92#endif
Thread aspect to access configuration data.
Definition: configurable.h:33
This OccGrid is derived by the Occupancy Grid originally from Andreas Strack, but modified for speed ...
Definition: og_laser.h:47
Thread aspect to log output.
Definition: logging.h:33
Mutex mutual exclusion lock.
Definition: mutex.h:33
Thread aspect to get access to a ROS node handle.
Definition: ros.h:39
This class is mainly the same as the basic class with the difference that all data is precalculated o...
This is the plan class.
Definition: astar_search.h:45
Thread class encapsulation of pthreads.
Definition: thread.h:46
virtual void init()
Initialize the thread.
Definition: thread.cpp:343
virtual void loop()
Code to execute in the thread.
Definition: thread.cpp:1067
virtual void finalize()
Finalize the thread.
Definition: thread.cpp:463
Thread aspect to access the transform system.
Definition: tf.h:39
This class tries to translate the found plan to interpreteable data for the rest of the program.
Fawkes library namespace.
struct fawkes::point_struct point_t
Point with cartesian coordinates as signed integers.
Definition: astar.h:39
Costs of occupancy-grid cells.
Definition: types.h:50