4 #include <RobotAPI/interface/units/UnitInterface.h>
5 #include <RobotAPI/interface/units/OrientedTactileSensorUnit.h>
8 #include <netinet/in.h>
12 #include <Eigen/Dense>
14 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
25 defineOptionalProperty<std::string>(
26 "SerialInterfaceDevice",
28 "The serial device the arduino is connected to.");
30 defineOptionalProperty<std::string>(
32 "OrientedTactileSensorValues",
33 "Name of the topic on which the sensor values are provided");
35 defineOptionalProperty<std::string>(
37 "65524 3 12 65534 65534 1 1208 119 58726 1000 943 ",
38 "Sensor Register Data to calibrate the sensor");
40 defineOptionalProperty<std::string>(
43 "number of orientation values to differentiate");
45 defineOptionalProperty<std::string>(
48 "number of pressure values to differentiate");
50 defineOptionalProperty<std::string>(
51 "SamplesAcceleration",
53 "number of pressure values to differentiate");
55 defineOptionalProperty<bool>(
58 "log data from sensor");
59 defineOptionalProperty<bool>(
62 "Set true to calibrate the sensor and get calibration data and false to use existent calibration data");
63 defineOptionalProperty<std::string>(
"DebugDrawerTopicName",
"DebugDrawerUpdates",
"Name of the debug drawer topic that should be used");
81 return "OrientedTactileSensorUnit";
94 int accel_offset_x,
accel_offset_y,
accel_offset_z,
gyro_offset_x,
gyro_offset_y,
gyro_offset_z,
mag_offset_x,
mag_offset_y,
mag_offset_z,
accel_radius,
mag_radius;
127 std::ifstream arduinoIn;
128 std::ofstream arduinoOut;
130 OrientedTactileSensorUnitListenerPrx topicPrx;
131 OrientedTactileSensorUnitInterfacePrx interfacePrx;
135 bool getCalibrationValues(std::string line);
136 bool loadCalibration();
141 std::vector<RotationRate> samplesRotation;
142 std::vector<PressureRate> samplesPressure;
143 std::vector<AccelerationRate> samplesAcceleration;
144 std::vector<float> pressureRates;
146 int maxSamplesRotation;
147 int sampleIndexRotation;
148 int maxSamplesPressure;
149 int sampleIndexPressure;
150 int maxSamplesAcceleration;
151 int sampleIndexAcceleration;
152 int sampleIndexPressureRate;
153 float sumPressureRates;