Fawkes API
Fawkes Development Version
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
All
Classes
Namespaces
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Groups
Pages
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 <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/subscriber.h>
32
#include <geometry_msgs/Twist.h>
33
34
35
namespace
fawkes {
36
class
MotorInterface;
37
}
38
39
class
ROSCmdVelThread
40
:
public
fawkes::Thread
,
41
public
fawkes::LoggingAspect
,
42
public
fawkes::ConfigurableAspect
,
43
public
fawkes::BlackBoardAspect
,
44
public
fawkes::ROSAspect
45
{
46
public
:
47
ROSCmdVelThread
();
48
49
virtual
void
init
();
50
virtual
void
loop
();
51
virtual
bool
prepare_finalize_user
();
52
virtual
void
finalize
();
53
54
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
55
protected
:
virtual
void
run
() {
Thread::run
(); }
56
57
private
:
58
void
stop();
//stops all Motors
59
void
send_transrot(
float
vx,
float
vy,
float
omega);
//sends Controls to the Motors
60
void
twist_msg_cb(
const
geometry_msgs::Twist::ConstPtr &msg);
61
62
private
:
63
fawkes::MotorInterface
*motor_if_;
64
ros::Subscriber sub_;
65
};
66
67
#endif
src
plugins
ros
cmdvel_thread.h
Generated by
1.8.1.1