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 <core/threading/thread.h>
30 #include <core/threading/mutex.h>
31 #include <aspect/tf.h>
32 #include <aspect/configurable.h>
33 #include <aspect/logging.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 }
48 
49 class ColliVisualizationThread
50 : public fawkes::Thread,
53  public fawkes::LoggingAspect,
54  public fawkes::ROSAspect
55 {
56  public:
57  ColliVisualizationThread();
58 
59  virtual void init();
60  virtual void loop();
61  virtual void finalize();
62 
63  virtual void setup(fawkes::LaserOccupancyGrid* occ_grid,
65 
66  private:
67  fawkes::Mutex mutex_;
68 
69  fawkes::LaserOccupancyGrid *occ_grid_;
70  fawkes::Search *search_;
71  fawkes::RoboShapeColli *roboshape_;
72  fawkes::colli_cell_cost_t cell_costs_;
73 
74  ros::Publisher *pub_roboshape_;
75 
76  ros::Publisher *pub_cells_occ_;
77  ros::Publisher *pub_cells_near_;
78  ros::Publisher *pub_cells_mid_;
79  ros::Publisher *pub_cells_far_;
80  ros::Publisher *pub_cells_free_;
81  ros::Publisher *pub_search_path_;
82 
83  std::vector<fawkes::point_t> cells_occ_;
84  std::vector<fawkes::point_t> cells_near_;
85  std::vector<fawkes::point_t> cells_mid_;
86  std::vector<fawkes::point_t> cells_far_;
87  std::vector<fawkes::point_t> cells_free_;
88 
89  std::string frame_base_;
90  std::string frame_laser_;
91 };
92 
93 #endif
94 #endif
struct fawkes::point_struct point_t
Point with cartesian coordinates as signed integers.
Definition: astar.h:43
Thread aspect to get access to a ROS node handle.
Definition: ros.h:39
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:42
Thread aspect to access the transform system.
Definition: tf.h:42
Costs of occupancy-grid cells.
Definition: types.h:51
This OccGrid is derived by the Occupancy Grid originally from Andreas Strack, but modified for speed ...
Definition: og_laser.h:49
Definition: act_thread.h:37
Thread aspect to log output.
Definition: logging.h:35
This is the plan class.
Definition: astar_search.h:47
Thread aspect to access configuration data.
Definition: configurable.h:35
This class is mainly the same as the basic class with the difference that all data is precalculated o...
Mutex mutual exclusion lock.
Definition: mutex.h:32