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 <aspect/blackboard.h>
25 #include <aspect/blocked_timing.h>
26 #include <aspect/clock.h>
27 #include <aspect/configurable.h>
28 #include <aspect/logging.h>
29 #include <core/threading/thread.h>
30 #include <plugins/gazebo/aspect/gazebo.h>
31 #include <utils/time/clock.h>
32 #include <utils/time/time.h>
33 
34 #include <string.h>
35 
36 //from Gazebo
37 #include <gazebo/msgs/MessageTypes.hh>
38 #include <gazebo/transport/TransportTypes.hh>
39 #include <gazebo/transport/transport.hh>
40 
41 namespace fawkes {
42 class Position3DInterface;
43 }
44 
46  public fawkes::ClockAspect,
47  public fawkes::LoggingAspect,
52 {
53 public:
55 
56  virtual void init();
57  virtual void loop();
58  virtual void finalize();
59 
60 private:
61  //read pose interface
63 
64  //Publisher for visual msgs
65  gazebo::transport::PublisherPtr visual_publisher_;
66 
67  double update_rate_;
68  fawkes::Time last_update_time_;
69 
70  //config values
71  std::string robot_name_, label_script_name_, location_scripts_, location_textures_, parent_name_,
72  arrow_script_name_;
73  float label_size_;
74  float label_height_;
75 };
76 #endif
Thread simulates the Localization in Gazebo.
virtual void loop()
Code to execute in the thread.
virtual void finalize()
Finalize the thread.
virtual void init()
Initialize the thread.
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect to use blocked timing.
Thread aspect that allows to obtain the current time from the clock.
Definition: clock.h:34
Thread aspect to access configuration data.
Definition: configurable.h:33
Thread aspect to get access to a Gazebo node handle.
Definition: gazebo.h:37
Thread aspect to log output.
Definition: logging.h:33
Position3DInterface Fawkes BlackBoard Interface.
Thread class encapsulation of pthreads.
Definition: thread.h:46
A class for handling time.
Definition: time.h:93
Fawkes library namespace.