3 #ifndef __WIIMOTE_SENSOR_HPP__
4 #define __WIIMOTE_SENSOR_HPP__
11 #include <yarp/os/Thread.h>
13 #include <yarp/dev/DeviceDriver.h>
14 #include <yarp/dev/IAnalogSensor.h>
32 : accelX(0), accelY(0), accelZ(0),
33 buttonA(
false), buttonB(
false),
34 button1(
false), button2(
false)
77 struct xwii_iface * iface;
78 struct xwii_event event;
81 mutable std::mutex eventDataMutex;
92 public yarp::dev::IAnalogSensor
98 calibZeroX(0), calibZeroY(0), calibZeroZ(0),
99 calibOneX(0), calibOneY(0), calibOneZ(0)
106 bool open(yarp::os::Searchable& config)
override;
107 bool close()
override;
115 int read(yarp::sig::Vector &out)
override;
160 static char * getDevicePath(
int id);
162 struct xwii_iface * iface;
164 int calibZeroX, calibZeroY, calibZeroZ;
165 int calibOneX, calibOneY, calibOneZ;
Thread that listens to Wiimote events.
Definition: WiimoteSensor.hpp:53
void setInterfacePointer(struct xwii_iface *iface)
Set pointer to xwii_iface.
Definition: WiimoteSensor.hpp:67
void run() override
Main body of the new thread.
Definition: WiimoteDispatcherThread.cpp:31
WiimoteDispatcherThread()
Constructor.
Definition: WiimoteSensor.hpp:57
void beforeStart() override
Called just before a new thread starts.
Definition: WiimoteDispatcherThread.cpp:16
WiimoteEventData getEventData() const
Retrieve event data object.
Definition: WiimoteDispatcherThread.cpp:102
Implementation for the Wiimote controller.
Definition: WiimoteSensor.hpp:93
int getState(int ch) override
Definition: IAnalogSensorImpl.cpp:39
int calibrateChannel(int ch) override
Definition: IAnalogSensorImpl.cpp:67
int getChannels() override
Definition: IAnalogSensorImpl.cpp:46
int calibrateSensor() override
Definition: IAnalogSensorImpl.cpp:53
int read(yarp::sig::Vector &out) override
Definition: IAnalogSensorImpl.cpp:9
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:6
Holds key state data from input events.
Definition: WiimoteSensor.hpp:30