Fawkes API
Fawkes Development Version
cmdvel_thread.h
1
/***************************************************************************
2
* cmdvel_thread.h - Translate ROS Twist messages to Navgiator transrot
3
*
4
* Created: Fri Jun 1 13:29:39 CEST 2012
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_CMDVEL_THREAD_H_
22
#define _PLUGINS_ROS_CMDVEL_THREAD_H_
23
24
#include <aspect/blackboard.h>
25
#include <aspect/blocked_timing.h>
26
#include <aspect/configurable.h>
27
#include <aspect/logging.h>
28
#include <core/threading/thread.h>
29
#include <core/utils/lockptr.h>
30
#include <geometry_msgs/Twist.h>
31
#include <plugins/ros/aspect/ros.h>
32
#include <ros/subscriber.h>
33
34
namespace
fawkes
{
35
class
MotorInterface;
36
}
37
38
class
ROSCmdVelThread
:
public
fawkes::Thread
,
39
public
fawkes::LoggingAspect
,
40
public
fawkes::ConfigurableAspect
,
41
public
fawkes::BlackBoardAspect
,
42
public
fawkes::ROSAspect
43
{
44
public
:
45
ROSCmdVelThread
();
46
47
virtual
void
init
();
48
virtual
void
loop
();
49
virtual
bool
prepare_finalize_user
();
50
virtual
void
finalize
();
51
52
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
53
protected
:
54
virtual
void
55
run
()
56
{
57
Thread::run();
58
}
59
60
private
:
61
void
stop();
//stops all Motors
62
void
send_transrot(
float
vx,
float
vy,
float
omega);
//sends Controls to the Motors
63
void
twist_msg_cb(
const
geometry_msgs::Twist::ConstPtr &msg);
64
65
private
:
66
fawkes::MotorInterface
*motor_if_;
67
ros::Subscriber sub_;
68
};
69
70
#endif
ROSCmdVelThread::init
virtual void init()
Initialize the thread.
Definition:
cmdvel_thread.cpp:40
ROSCmdVelThread::ROSCmdVelThread
ROSCmdVelThread()
Constructor.
Definition:
cmdvel_thread.cpp:35
ROSCmdVelThread::run
virtual void run()
Stub to see name in backtrace for easier debugging.
Definition:
cmdvel_thread.h:54
fawkes::MotorInterface
Definition:
MotorInterface.h:37
ROSCmdVelThread::finalize
virtual void finalize()
Finalize the thread.
Definition:
cmdvel_thread.cpp:61
ROSCmdVelThread
Definition:
cmdvel_thread.h:37
fawkes::BlackBoardAspect
Definition:
blackboard.h:36
fawkes
fawkes::LoggingAspect
Definition:
logging.h:36
fawkes::ROSAspect
Definition:
ros.h:37
ROSCmdVelThread::loop
virtual void loop()
Code to execute in the thread.
Definition:
cmdvel_thread.cpp:85
ROSCmdVelThread::prepare_finalize_user
virtual bool prepare_finalize_user()
Prepare finalization user implementation.
Definition:
cmdvel_thread.cpp:54
fawkes::Thread
Definition:
thread.h:44
fawkes::ConfigurableAspect
Definition:
configurable.h:36
src
plugins
ros
cmdvel_thread.h
Generated by
1.8.16