10#include <yarp/os/Thread.h>
12#include <yarp/dev/DeviceDriver.h>
13#include <yarp/dev/IJoypadController.h>
17#include "Wiimote_ParamsParser.h"
67 struct xwii_iface * iface {
nullptr};
68 struct xwii_event event;
71 mutable std::mutex eventDataMutex;
81class Wiimote :
public yarp::dev::DeviceDriver,
82 public yarp::dev::IJoypadController,
87 bool open(yarp::os::Searchable& config)
override;
88 bool close()
override;
91 bool getAxisCount(
unsigned int & axis_count)
override;
92 bool getButtonCount(
unsigned int & button_count)
override;
93 bool getTrackballCount(
unsigned int & trackball_count)
override;
94 bool getHatCount(
unsigned int & hat_count)
override;
95 bool getTouchSurfaceCount(
unsigned int & touch_count)
override;
96 bool getStickCount(
unsigned int & stick_count)
override;
97 bool getStickDoF(
unsigned int stick_id,
unsigned int & DoF)
override;
98 bool getButton(
unsigned int button_id,
float & value)
override;
99 bool getTrackball(
unsigned int trackball_id, yarp::sig::Vector & value)
override;
100 bool getHat(
unsigned int hat_id,
unsigned char & value)
override;
101 bool getAxis(
unsigned int axis_id,
double & value)
override;
102 bool getStick(
unsigned int stick_id, yarp::sig::Vector & value, yarp::dev::IJoypadController::JoypadCtrl_coordinateMode coordinate_mode)
override;
103 bool getTouch(
unsigned int touch_id, yarp::sig::Vector & value)
override;
106 static char * getDevicePath(
int id);
108 struct xwii_iface * iface {
nullptr};
Thread that listens to Wiimote events.
Definition Wiimote.hpp:47
void run() override
Main body of the new thread.
Definition WiimoteDispatcherThread.cpp:29
void beforeStart() override
Called just before a new thread starts.
Definition WiimoteDispatcherThread.cpp:14
WiimoteEventData getEventData() const
Retrieve event data object.
Definition WiimoteDispatcherThread.cpp:100
void setInterfacePointer(struct xwii_iface *iface)
Set pointer to xwii_iface.
Definition Wiimote.hpp:57
Definition Wiimote_ParamsParser.h:48
Implementation for the Wiimote controller.
Definition Wiimote.hpp:84
Holds key state data from input events.
Definition Wiimote.hpp:30