kinematics-dynamics
Loading...
Searching...
No Matches
LeapMotionSensorDevice.hpp
1#ifndef __LEAP_MOTION_SENSOR_DEVICE_HPP__
2#define __LEAP_MOTION_SENSOR_DEVICE_HPP__
3
4#include "StreamingDevice.hpp"
5
6#include <vector>
7
8#include <kdl/frames.hpp>
9
10#include <yarp/dev/IAnalogSensor.h>
11
12namespace roboticslab
13{
14
22{
23public:
25 LeapMotionSensorDevice(yarp::os::Searchable & config, bool usingPose);
26
27 bool acquireInterfaces() override;
28
29 bool initialize(const std::map<ICartesianControl::Config, double> & params) override;
30
31 bool acquireData() override;
32
33 bool transformData(double scaling) override;
34
36
37 void sendMovementCommand(double timestamp) override;
38
39 void stopMotion() override
40 {}
41
42private:
43 yarp::dev::IAnalogSensor * iAnalogSensor;
44
45 bool usingPose;
46
47 std::vector<double> initialTcpOffset;
48 std::vector<double> initialLeapOffset;
49
50 KDL::Frame frame_base_leap, frame_ee_leap, frame_leap_ee;
51
52 KDL::Frame previousPose;
53 double previousTimestamp;
54
55 bool hasActuator;
56 bool grab, pinch;
57};
58
59} // namespace roboticslab
60
61#endif // __LEAP_MOTION_SENSOR_DEVICE_HPP__
Actuator
Actuator control vocabs.
Definition ICartesianControl.h:90
Represents a LeapMotion device wrapped as an analog sensor by YARP.
Definition LeapMotionSensorDevice.hpp:22
void sendMovementCommand(double timestamp) override
Sends movement command to the cartesian controller.
Definition LeapMotionSensorDevice.cpp:223
bool initialize(const std::map< ICartesianControl::Config, double > &params) override
Perform any custom initialization needed. This method is called after the successful creation of the ...
Definition LeapMotionSensorDevice.cpp:59
bool transformData(double scaling) override
Performs required operations on stored data.
Definition LeapMotionSensorDevice.cpp:152
ICartesianControl::Actuator getActuatorState() override
If actuator command data is available, return its current state.
Definition LeapMotionSensorDevice.cpp:189
bool acquireInterfaces() override
Acquires plugin interfaces.
Definition LeapMotionSensorDevice.cpp:46
void stopMotion() override
Sends a movement command that would stop motion.
Definition LeapMotionSensorDevice.hpp:39
bool acquireData() override
Acquires data from remote device.
Definition LeapMotionSensorDevice.cpp:118
Abstract class for a YARP streaming device.
Definition StreamingDevice.hpp:47
The main, catch-all namespace for Robotics Lab UC3M.
Definition groups.dox:6