kinematics-dynamics
Loading...
Searching...
No Matches
WiimoteDevice.hpp
1#ifndef __WIIMOTE_SENSOR_DEVICE_HPP__
2#define __WIIMOTE_SENSOR_DEVICE_HPP__
3
4#include "StreamingDevice.hpp"
5
6#include <yarp/os/Value.h>
7#include <yarp/dev/IJoypadController.h>
8
9namespace roboticslab
10{
11
19{
20public:
21 WiimoteDevice(yarp::os::Searchable & config, bool usingPose);
22
23 bool acquireInterfaces() override;
24 bool initialize(bool usingStreamingPreset) override;
25 bool acquireData() override;
26 bool transformData(double scaling) override;
27 bool hasValidMovementData() const override;
28 void sendMovementCommand(double timestamp) override;
29 void stopMotion() override;
30
31private:
32 enum cmd_mode { NONE, FWD, BKWD, ROT };
33
34 yarp::dev::IJoypadController * iJoypadController {nullptr};
35 cmd_mode mode {NONE};
36 bool usingPose {false};
37 double step {0.0};
38 bool buttonA {false};
39 bool buttonB {false};
40 bool yawActive {false};
41};
42
43} // namespace roboticslab
44
45#endif // __WIIMOTE_SENSOR_DEVICE_HPP__
Abstract class for a YARP streaming device.
Definition StreamingDevice.hpp:46
Represents a Wiimote device wrapped as an analog sensor by YARP.
Definition WiimoteDevice.hpp:19
bool acquireData() override
Acquires data from remote device.
Definition WiimoteDevice.cpp:73
void stopMotion() override
Sends a movement command that would stop motion.
Definition WiimoteDevice.cpp:178
void sendMovementCommand(double timestamp) override
Sends movement command to the cartesian controller.
Definition WiimoteDevice.cpp:148
bool hasValidMovementData() const override
Checks whether the device may forward acquired and processed data to the controller.
Definition WiimoteDevice.cpp:143
bool initialize(bool usingStreamingPreset) override
Perform any custom initialization needed. This method is called after the successful creation of the ...
Definition WiimoteDevice.cpp:45
bool transformData(double scaling) override
Performs required operations on stored data.
Definition WiimoteDevice.cpp:108
bool acquireInterfaces() override
Acquires plugin interfaces.
Definition WiimoteDevice.cpp:22
The main, catch-all namespace for Robotics Lab UC3M.
Definition groups.dox:6