-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathStreamingDeviceController.hpp
68 lines (51 loc) · 1.68 KB
/
StreamingDeviceController.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#ifndef __STREAMING_DEVICE_CONTROLLER_HPP__
#define __STREAMING_DEVICE_CONTROLLER_HPP__
#include <vector>
#include <yarp/os/Bottle.h>
#include <yarp/os/BufferedPort.h>
#include <yarp/os/RFModule.h>
#include <yarp/os/TypedReaderCallback.h>
#include <yarp/dev/PolyDriver.h>
#include "StreamingDevice.hpp"
#include "CentroidTransform.hpp"
#include "ICartesianControl.h"
namespace roboticslab
{
/**
* @ingroup streamingDeviceController
*
* @brief Sends streaming commands to the cartesian controller from
* a streaming input device like the 3Dconnexion Space Navigator.
*
* @see @cite lukawski2023jjaa
*/
class StreamingDeviceController : public yarp::os::RFModule,
public yarp::os::TypedReaderCallback<yarp::os::Bottle>
{
public:
~StreamingDeviceController() override
{ close(); }
bool configure(yarp::os::ResourceFinder & rf) override;
bool updateModule() override;
bool interruptModule() override;
bool close() override;
double getPeriod() override;
void onRead(yarp::os::Bottle & bot) override;
private:
bool update(double timestamp);
StreamingDevice * streamingDevice;
yarp::dev::PolyDriver cartesianControlClientDevice;
roboticslab::ICartesianControl * iCartesianControl;
yarp::os::BufferedPort<yarp::os::Bottle> proximityPort;
int thresholdAlertHigh;
int thresholdAlertLow;
bool disableSensorsLowLevel;
yarp::os::BufferedPort<yarp::os::Bottle> centroidPort;
CentroidTransform centroidTransform;
yarp::os::BufferedPort<yarp::os::Bottle> syncPort;
double period;
double scaling;
bool isStopped;
};
} // namespace roboticslab
#endif // __STREAMING_DEVICE_CONTROLLER_HPP__