8 #include <netinet/in.h>
10 #include <Eigen/Dense>
16 #include <RobotAPI/interface/units/OrientedTactileSensorUnit.h>
17 #include <RobotAPI/interface/units/UnitInterface.h>
18 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
29 defineOptionalProperty<std::string>(
"SerialInterfaceDevice",
31 "The serial device the arduino is connected to.");
33 defineOptionalProperty<std::string>(
35 "OrientedTactileSensorValues",
36 "Name of the topic on which the sensor values are provided");
38 defineOptionalProperty<std::string>(
"CalibrationData",
39 "65524 3 12 65534 65534 1 1208 119 58726 1000 943 ",
40 "Sensor Register Data to calibrate the sensor");
42 defineOptionalProperty<std::string>(
43 "SamplesRotation",
"20",
"number of orientation values to differentiate");
45 defineOptionalProperty<std::string>(
46 "SamplesPressure",
"10",
"number of pressure values to differentiate");
48 defineOptionalProperty<std::string>(
49 "SamplesAcceleration",
"20",
"number of pressure values to differentiate");
51 defineOptionalProperty<bool>(
"logData",
"false",
"log data from sensor");
52 defineOptionalProperty<bool>(
"calibrateSensor",
54 "Set true to calibrate the sensor and get calibration "
55 "data and false to use existent calibration data");
56 defineOptionalProperty<std::string>(
57 "DebugDrawerTopicName",
59 "Name of the debug drawer topic that should be used");
77 return "OrientedTactileSensorUnit";
125 std::ifstream arduinoIn;
126 std::ofstream arduinoOut;
128 OrientedTactileSensorUnitListenerPrx topicPrx;
129 OrientedTactileSensorUnitInterfacePrx interfacePrx;
133 bool getCalibrationValues(std::string line);
134 bool loadCalibration();
139 std::vector<RotationRate> samplesRotation;
140 std::vector<PressureRate> samplesPressure;
141 std::vector<AccelerationRate> samplesAcceleration;
142 std::vector<float> pressureRates;
144 int maxSamplesRotation;
145 int sampleIndexRotation;
146 int maxSamplesPressure;
147 int sampleIndexPressure;
148 int maxSamplesAcceleration;
149 int sampleIndexAcceleration;
150 int sampleIndexPressureRate;
151 float sumPressureRates;