Fawkes API  Fawkes Development Version
odometry_thread.h
1 /***************************************************************************
2  * odometry_thread.h - Thread to publish odometry to ROS
3  *
4  * Created: Fri Jun 1 13:29:39 CEST
5  * Copyright 2012 Sebastian Reuter
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_ODOMETRY_THREAD_H_
22 #define __PLUGINS_ROS_ODOMETRY_THREAD_H_
23 
24 #include <core/threading/thread.h>
25 #include <core/utils/lockptr.h>
26 #include <aspect/logging.h>
27 #include <aspect/configurable.h>
28 #include <aspect/blocked_timing.h>
29 #include <aspect/blackboard.h>
30 #include <plugins/ros/aspect/ros.h>
31 #include <ros/node_handle.h>
32 
33 
34 namespace fawkes {
35  class MotorInterface;
36 }
37 
39 : public fawkes::Thread,
41  public fawkes::LoggingAspect,
44  public fawkes::ROSAspect
45 {
46  public:
48 
49  virtual void init();
50  virtual void loop();
51  virtual void finalize();
52 
53  /** Stub to see name in backtrace for easier debugging. @see Thread::run() */
54  protected: virtual void run() { Thread::run(); }
55 
56  private:
57  void publish_odom();
58 
59 private:
60  fawkes::MotorInterface *motor_if_;
61  ros::Publisher pub_;
62  std::string cfg_odom_frame_id_;
63  std::string cfg_base_frame_id_;
64 };
65 
66 #endif
virtual void run()
Stub to see name in backtrace for easier debugging.
Thread aspect to access to BlackBoard.
Definition: blackboard.h:34
Thread aspect to get access to a ROS node handle.
Definition: ros.h:39
Fawkes library namespace.
virtual void run()
Code to execute in the thread.
Definition: thread.cpp:939
Thread class encapsulation of pthreads.
Definition: thread.h:42
Thread aspect to use blocked timing.
Thread to publish odometry to ROS.
Thread aspect to log output.
Definition: logging.h:35
Thread aspect to access configuration data.
Definition: configurable.h:35
MotorInterface Fawkes BlackBoard Interface.