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
motion_thread.h
1
2
/***************************************************************************
3
* motion_thread.h - Provide NaoQi motion to Fawkes
4
*
5
* Created: Thu Jun 09 12:56:42 2011
6
* Copyright 2006-2011 Tim Niemueller [www.niemueller.de]
7
*
8
****************************************************************************/
9
10
/* This program is free software; you can redistribute it and/or modify
11
* it under the terms of the GNU General Public License as published by
12
* the Free Software Foundation; either version 2 of the License, or
13
* (at your option) any later version.
14
*
15
* This program is distributed in the hope that it will be useful,
16
* but WITHOUT ANY WARRANTY; without even the implied warranty of
17
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18
* GNU Library General Public License for more details.
19
*
20
* Read the full text in the LICENSE.GPL file in the doc directory.
21
*/
22
23
#ifndef __PLUGINS_NAO_MOTION_THREAD_H_
24
#define __PLUGINS_NAO_MOTION_THREAD_H_
25
26
#include <core/threading/thread.h>
27
#include <aspect/clock.h>
28
#include <aspect/logging.h>
29
#include <aspect/configurable.h>
30
#include <aspect/blackboard.h>
31
#include <aspect/blocked_timing.h>
32
#include <plugins/nao/aspect/naoqi.h>
33
34
#include <vector>
35
36
namespace
AL {
37
class
ALMotionProxy;
38
class
ALTask;
39
}
40
namespace
fawkes {
41
class
HumanoidMotionInterface;
42
class
NaoSensorInterface;
43
}
44
45
class
NaoQiMotionThread
46
:
public
fawkes::Thread
,
47
public
fawkes::LoggingAspect
,
48
public
fawkes::ConfigurableAspect
,
49
public
fawkes::ClockAspect
,
50
public
fawkes::BlackBoardAspect
,
51
public
fawkes::BlockedTimingAspect
,
52
public
fawkes::NaoQiAspect
53
{
54
public
:
55
NaoQiMotionThread
();
56
virtual
~NaoQiMotionThread
();
57
58
virtual
void
init
();
59
virtual
void
loop
();
60
virtual
void
finalize
();
61
62
/** Stub to see name in backtrace for easier debugging. @see Thread::run() */
63
protected
:
virtual
void
run
() {
Thread::run
(); }
64
65
private
:
66
void
stop_motion();
67
void
process_messages();
68
void
fix_angles();
69
70
void
goto_body_angles(
float
head_yaw,
float
head_pitch,
71
float
l_shoulder_pitch,
float
l_shoulder_roll,
72
float
l_elbow_yaw,
float
l_elbow_roll,
73
float
l_wrist_yaw,
float
l_hand,
74
float
l_hip_yaw_pitch,
float
l_hip_roll,
75
float
l_hip_pitch,
float
l_knee_pitch,
76
float
l_ankle_pitch,
float
l_ankle_roll,
77
float
r_shoulder_pitch,
float
r_shoulder_roll,
78
float
r_elbow_yaw,
float
r_elbow_roll,
79
float
r_wrist_yaw,
float
r_hand,
80
float
r_hip_yaw_pitch,
float
r_hip_roll,
81
float
r_hip_pitch,
float
r_knee_pitch,
82
float
r_ankle_pitch,
float
r_ankle_roll,
83
float
time_sec);
84
85
86
private
:
87
AL::ALPtr<AL::ALMotionProxy> __almotion;
88
AL::ALPtr<AL::ALThreadPool> __thread_pool;
89
90
fawkes::HumanoidMotionInterface
*__hummot_if;
91
fawkes::NaoSensorInterface
*__sensor_if;
92
93
int
__motion_task_id;
94
int
__head_task_id;
95
AL::ALPtr<AL::ALTask> __motion_task;
96
};
97
98
#endif
src
plugins
nao
motion_thread.h
Generated by
1.8.1.2