kinematics-dynamics
Loading...
Searching...
No Matches
XTrainerDevice.hpp
1#ifndef __XTRAINER_DEVICE_HPP__
2#define __XTRAINER_DEVICE_HPP__
3
4#include "StreamingDevice.hpp"
5
6#include <yarp/dev/IJoypadController.h>
7#include <yarp/dev/PolyDriver.h>
8
9#include <kdl/frames.hpp>
10
11#include "ICartesianSolver.h"
12
13namespace roboticslab
14{
15
21class XTrainerDevice : public StreamingDevice
22{
23public:
24 XTrainerDevice(yarp::os::Searchable & config);
25
26 bool acquireInterfaces() override;
27 bool initialize(const ICartesianControl::config_map_t & params) override;
28 bool acquireData() override;
29 bool transformData(double scaling) override;
31 void sendMovementCommand(double timestamp) override;
32
33private:
34 yarp::dev::IJoypadController * iJoypadController {nullptr};
35 ICartesianSolver * iCartesianSolver {nullptr};
36 yarp::dev::PolyDriver solverDevice;
37
38 double smoothFactor {1.0};
39 std::string kinematics;
40 std::vector<double> prevJointData;
41
42 KDL::Frame H_robot_device;
43 KDL::Frame H_device_robot;
44 KDL::Frame H_robot_device_initial;
45 KDL::Frame H_device_initial_inv;
46
47 bool buttonClose {false};
48 bool buttonOpen {false};
49};
50
51} // namespace roboticslab
52
53#endif // __XTRAINER_DEVICE_HPP__
Actuator
Actuator control vocabs.
Definition ICartesianControl.h:72
Abstract base class for a cartesian solver.
Definition ICartesianSolver.h:19
StreamingDevice(yarp::os::Searchable &config)
Constructor.
Definition StreamingDevice.cpp:50
void sendMovementCommand(double timestamp) override
Sends movement command to the cartesian controller.
Definition XTrainerDevice.cpp:282
bool acquireInterfaces() override
Acquires plugin interfaces.
Definition XTrainerDevice.cpp:49
bool transformData(double scaling) override
Performs required operations on stored data.
Definition XTrainerDevice.cpp:205
ICartesianControl::Actuator getActuatorState() override
If actuator command data is available, return its current state.
Definition XTrainerDevice.cpp:253
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 XTrainerDevice.cpp:93
bool acquireData() override
Acquires data from remote device.
Definition XTrainerDevice.cpp:166
The main, catch-all namespace for Robotics Lab UC3M.
Definition groups.dox:6