Fawkes API  Fawkes Development Version
imu_thread.h
1 /***************************************************************************
2  * imu_thread.h - Thread to publish IMU data to ROS
3  *
4  * Created: Mon 03 Apr 2017 12:41:33 CEST 12:41
5  * Copyright 2017 Till Hofmann <hofmann@kbsg.rwth-aachen.de>
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_ROS_IMU_THREAD_H_
22 #define _PLUGINS_ROS_IMU_THREAD_H_
23 
24 #include <aspect/blackboard.h>
25 #include <aspect/configurable.h>
26 #include <aspect/logging.h>
27 #include <blackboard/interface_listener.h>
28 #include <core/threading/thread.h>
29 #include <interfaces/IMUInterface.h>
30 #include <plugins/ros/aspect/ros.h>
31 #include <ros/node_handle.h>
32 
35  public fawkes::LoggingAspect,
36  public fawkes::ROSAspect,
39 {
40 public:
41  RosIMUThread();
42  virtual ~RosIMUThread();
43 
44  virtual void init();
45  virtual void finalize();
46 
47  virtual void bb_interface_data_changed(fawkes::Interface *interface) throw();
48 
49 private:
50  ros::Publisher ros_pub_;
51  fawkes::IMUInterface *iface_;
52 };
53 
54 #endif /* PLUGINS_ROS_IMU_THREAD_H__ */
Thread aspect to access to BlackBoard.
Definition: blackboard.h:33
Thread aspect to get access to a ROS node handle.
Definition: ros.h:38
virtual void finalize()
Close all interfaces and ROS handles.
Definition: imu_thread.cpp:89
Thread class encapsulation of pthreads.
Definition: thread.h:45
Base class for all Fawkes BlackBoard interfaces.
Definition: interface.h:78
virtual ~RosIMUThread()
Destructor.
Definition: imu_thread.cpp:43
virtual void init()
Initialize the thread.
Definition: imu_thread.cpp:52
Thread aspect to log output.
Definition: logging.h:32
Thread aspect to access configuration data.
Definition: configurable.h:32
IMUInterface Fawkes BlackBoard Interface.
Definition: IMUInterface.h:33
Thread to publish IMU data to ROS.
Definition: imu_thread.h:33
RosIMUThread()
Constructor.
Definition: imu_thread.cpp:37
virtual void bb_interface_data_changed(fawkes::Interface *interface)
Handle interface changes.
Definition: imu_thread.cpp:101
BlackBoard interface listener.