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 ICartesianControl::config_map_t & params) override;
30
31 bool acquireData() override;
32
33 bool transformData(double scaling) override;
34
36
37 void sendMovementCommand(double timestamp) override;
38
39private:
40 yarp::dev::IAnalogSensor * iAnalogSensor;
41
42 bool usingPose;
43
44 std::vector<double> initialTcpOffset;
45 std::vector<double> initialLeapOffset;
46
47 KDL::Frame frame_base_leap, frame_ee_leap, frame_leap_ee;
48
49 KDL::Frame previousPose;
50 double previousTimestamp;
51
52 bool hasActuator;
53 bool grab, pinch;
54};
55
56} // namespace roboticslab
57
58#endif // __LEAP_MOTION_SENSOR_DEVICE_HPP__
Actuator
Actuator control vocabs.
Definition ICartesianControl.h:72
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 ICartesianControl::config_map_t &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
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