kinematics-dynamics
Loading...
Searching...
No Matches
SpnavSensorDevice.hpp
1#ifndef __SPNAV_SENSOR_DEVICE_HPP__
2#define __SPNAV_SENSOR_DEVICE_HPP__
3
4#include "StreamingDevice.hpp"
5
6#include <yarp/dev/IJoypadController.h>
7
8namespace roboticslab
9{
10
18{
19public:
20 SpnavSensorDevice(yarp::os::Searchable & config, bool usingPose, double gain = 0.0);
21
22 bool acquireInterfaces() override;
23 bool initialize(bool usingStreamingPreset) override;
24 bool acquireData() override;
25 bool transformData(double scaling) override;
26 int getActuatorState() override;
27 bool hasValidMovementData() const override;
28 void sendMovementCommand(double timestamp) override;
29 void stopMotion() override;
30
31private:
32 yarp::dev::IJoypadController * iJoypadController {nullptr};
33 std::vector<double> currentX;
34 bool usingPose {false};
35 double gain {0.0};
36 bool buttonClose {false};
37 bool buttonOpen {false};
38};
39
40} // namespace roboticslab
41
42#endif // __SPNAV_SENSOR_DEVICE_HPP__
Represents a spacenav-compatible device, like the SpaceNavigator 6-DOF mouse from 3Dconnexion.
Definition SpnavSensorDevice.hpp:18
bool acquireData() override
Acquires data from remote device.
Definition SpnavSensorDevice.cpp:80
void stopMotion() override
Sends a movement command that would stop motion.
Definition SpnavSensorDevice.cpp:199
void sendMovementCommand(double timestamp) override
Sends movement command to the cartesian controller.
Definition SpnavSensorDevice.cpp:182
bool transformData(double scaling) override
Performs required operations on stored data.
Definition SpnavSensorDevice.cpp:109
bool acquireInterfaces() override
Acquires plugin interfaces.
Definition SpnavSensorDevice.cpp:17
int getActuatorState() override
If actuator command data is available, return its current state.
Definition SpnavSensorDevice.cpp:133
bool initialize(bool usingStreamingPreset) override
Perform any custom initialization needed. This method is called after the successful creation of the ...
Definition SpnavSensorDevice.cpp:46
bool hasValidMovementData() const override
Checks whether the device may forward acquired and processed data to the controller.
Definition SpnavSensorDevice.cpp:162
Abstract class for a YARP streaming device.
Definition StreamingDevice.hpp:46
The main, catch-all namespace for Robotics Lab UC3M.
Definition groups.dox:6