23 #ifndef __PLUGINS_JOYSTICK_ACQUISITION_THREAD_H_
24 #define __PLUGINS_JOYSTICK_ACQUISITION_THREAD_H_
26 #include "bb_handler.h"
28 #include <core/threading/thread.h>
29 #include <aspect/logging.h>
30 #include <aspect/configurable.h>
32 #include <utils/math/types.h>
72 protected:
virtual void run() { Thread::run(); }
75 void init(std::string device_file);
77 void open_forcefeedback();
80 std::string __cfg_device_file;
84 unsigned int __axis_array_size;
87 char __joystick_name[128];
92 unsigned int __pressed_buttons;
JoystickAcquisitionThread()
Constructor.
JoystickForceFeedback * ff() const
Access force feedback of joystick.
virtual void loop()
Code to execute in the thread.
float * axis_values()
Get values for the axes.
Fawkes library namespace.
char num_buttons() const
Get number of buttons.
Handler class for joystick data.
Thread class encapsulation of pthreads.
bool lock_if_new_data()
Lock data if fresh.
Joystick acqusition thread for Linux joystick API.
Logger * logger
This is the Logger member used to access the logger.
Cause force feedback on a joystick.
unsigned int pressed_buttons() const
Pressed buttons.
virtual void finalize()
Finalize the thread.
Thread aspect to log output.
char num_axes() const
Get number of axes.
Thread aspect to access configuration data.
virtual void run()
Stub to see name in backtrace for easier debugging.
const char * joystick_name() const
Get joystick name.
void unlock()
Unlock data.
Mutex mutual exclusion lock.
virtual void init()
Initialize the thread.