23 #ifndef __PLUGINS_NAO_BUTTON_THREAD_H_
24 #define __PLUGINS_NAO_BUTTON_THREAD_H_
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 #include <core/utils/lock_vector.h>
35 #include <interfaces/SwitchInterface.h>
37 #include <alcommon/alproxy.h>
42 class ALAudioPlayerProxy;
45 class NaoSensorInterface;
46 class SwitchInterface;
67 protected:
virtual void run() { Thread::run(); }
71 bool enabled,
float value,
float history,
72 unsigned int activations,
73 unsigned int short_act,
unsigned int long_act);
76 bool &remote_enabled,
float &value);
78 void pattern_button_logic(
float value,
float time_diff_sec,
79 bool &enabled,
float &history,
80 unsigned int &activations,
81 unsigned int &short_act,
unsigned int &long_act,
82 int sound_short,
int sound_long);
84 void bumpers_logic(
float value,
float time_diff_sec,
85 bool &enabled,
float &history,
86 unsigned int &activations,
int sound_id);
89 float sensor_value,
float time_diff_sec,
91 int sound_short = -1,
int sound_long = -1);
93 float left_value,
float right_value,
95 bool &remote_enabled,
int sound_id = -1);
98 AL::ALPtr<AL::ALAudioPlayerProxy> __auplayer;
100 AL::ALProcessSignals::ProcessSignalConnection __dcm_sigconn;
113 int __sound_longpling;
115 int __sound_bumper_left;
116 int __sound_bumper_right;
118 bool __chestbut_remote_enabled;
119 bool __lfoot_bumper_remote_enabled;
120 bool __rfoot_bumper_remote_enabled;
121 bool __head_front_remote_enabled;
122 bool __head_middle_remote_enabled;
123 bool __head_rear_remote_enabled;
125 unsigned int last_shutdown_actcount;
126 bool __cfg_chest_triple_long_click_shutdown;