Fawkes API  Fawkes Development Version
gazsim_vis_localization_thread.h
1 /***************************************************************************
2  * gazsim_vis_localization_thread.h - Plugin visualizes the localization
3  *
4  * Created: Tue Sep 17 15:36:25 2013
5  * Copyright 2013 Frederik Zwilling
6  ****************************************************************************/
7 
8 /* This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU Library General Public License for more details.
17  *
18  * Read the full text in the LICENSE.GPL file in the doc directory.
19  */
20 
21 #ifndef __PLUGINS_GAZSIM_VIS_LOCALIZATION_THREAD_H_
22 #define __PLUGINS_GAZSIM_VIS_LOCALIZATION_THREAD_H_
23 
24 #include <core/threading/thread.h>
25 #include <aspect/clock.h>
26 #include <aspect/configurable.h>
27 #include <aspect/logging.h>
28 #include <aspect/blackboard.h>
29 #include <aspect/blocked_timing.h>
30 #include <plugins/gazebo/aspect/gazebo.h>
31 #include <utils/time/clock.h>
32 #include <utils/time/time.h>
33 #include <string.h>
34 
35 //from Gazebo
36 #include <gazebo/transport/TransportTypes.hh>
37 #include <gazebo/msgs/MessageTypes.hh>
38 #include <gazebo/transport/transport.hh>
39 
40 
41 namespace fawkes {
42  class Position3DInterface;
43 }
44 
46 : public fawkes::Thread,
47  public fawkes::ClockAspect,
48  public fawkes::LoggingAspect,
53 {
54  public:
56 
57  virtual void init();
58  virtual void loop();
59  virtual void finalize();
60 
61  private:
62  //read pose interface
64 
65  //Publisher for visual msgs
66  gazebo::transport::PublisherPtr visual_publisher_;
67 
68  double update_rate_;
69  fawkes::Time last_update_time_;
70 
71  //config values
72  std::string robot_name_, label_script_name_, location_scripts_, location_textures_, parent_name_, arrow_script_name_;
73  float label_size_;
74  float label_height_;
75 };
76 #endif
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:36
Fawkes library namespace.
Thread aspect to get access to a Gazebo node handle.
Definition: gazebo.h:37
A class for handling time.
Definition: time.h:91
Thread class encapsulation of pthreads.
Definition: thread.h:42
Thread aspect to use blocked timing.
Position3DInterface Fawkes BlackBoard Interface.
Thread aspect to log output.
Definition: logging.h:35
Thread aspect to access configuration data.
Definition: configurable.h:35
Thread simulates the Localization in Gazebo.