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 
38 namespace ros {
39 class Publisher;
40 }
41 
42 namespace fawkes {
43 class LaserOccupancyGrid;
44 class Search;
45 class RoboShapeColli;
46 typedef struct point_struct point_t;
47 } // namespace fawkes
48 
49 class ColliVisualizationThread : public fawkes::Thread,
52  public fawkes::LoggingAspect,
53  public fawkes::ROSAspect
54 {
55 public:
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 
64 private:
65  fawkes::Mutex mutex_;
66 
67  fawkes::LaserOccupancyGrid *occ_grid_;
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
struct fawkes::point_struct point_t
Point with cartesian coordinates as signed integers.
Definition: astar.h:39
Thread aspect to get access to a ROS node handle.
Definition: ros.h:38
This class tries to translate the found plan to interpreteable data for the rest of the program.
Fawkes library namespace.
Thread class encapsulation of pthreads.
Definition: thread.h:45
Thread aspect to access the transform system.
Definition: tf.h:38
Costs of occupancy-grid cells.
Definition: types.h:49
This OccGrid is derived by the Occupancy Grid originally from Andreas Strack, but modified for speed ...
Definition: og_laser.h:46
virtual void finalize()
Finalize the thread.
Definition: thread.cpp:463
Thread aspect to log output.
Definition: logging.h:32
This is the plan class.
Definition: astar_search.h:44
Thread aspect to access configuration data.
Definition: configurable.h:32
virtual void loop()
Code to execute in the thread.
Definition: thread.cpp:1067
This class is mainly the same as the basic class with the difference that all data is precalculated o...
virtual void init()
Initialize the thread.
Definition: thread.cpp:343
Mutex mutual exclusion lock.
Definition: mutex.h:32