From c24fcec9a2d81c1892ba69165f6b1395d4df8065 Mon Sep 17 00:00:00 2001
From: andreeatulbure <andreea_tulbure@yahoo.de>
Date: Thu, 9 Mar 2017 19:43:03 +0100
Subject: [PATCH] added proxy info and debug output

---
 data/RobotAPI/VariantInfo-RobotAPI.xml                    | 8 ++++++++
 scenarios/OrientedTactileSensor/OrientedTactileSensor.scx | 2 +-
 .../config/OrientedTactileSensorUnitApp.cfg               | 6 +++---
 .../OrientedTactileSensor/OrientedTactileSensorUnit.cpp   | 8 ++++++++
 4 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/data/RobotAPI/VariantInfo-RobotAPI.xml b/data/RobotAPI/VariantInfo-RobotAPI.xml
index 0fb95ad0c..c83166f81 100644
--- a/data/RobotAPI/VariantInfo-RobotAPI.xml
+++ b/data/RobotAPI/VariantInfo-RobotAPI.xml
@@ -53,6 +53,14 @@
             propertyName="IMUObserverName"
             propertyIsOptional="true"
             propertyDefaultValue="InertialMeasurementUnitObserver" />
+        <Proxy include="RobotAPI/interface/units/OrientedTactileSensorUnit.h"
+            humanName="Oriented Tactile Sensor Unit Observer"
+            typeName="OrientedTactileSensorUnitObserverInterfacePrx"
+            memberName="orientedTactileSensorUnitObserver"
+            getterName="getOrientedTactileSensorUnitObserver"
+            propertyName="OrientedTactileSensorUnitObserverName"
+            propertyIsOptional="true"
+            propertyDefaultValue="OrientedTactileSensorUnitObserver" />
         <Proxy include="RobotAPI/interface/units/ForceTorqueUnit.h"
             humanName="Force Torque Unit Observer"
             typeName="ForceTorqueUnitObserverInterfacePrx"
diff --git a/scenarios/OrientedTactileSensor/OrientedTactileSensor.scx b/scenarios/OrientedTactileSensor/OrientedTactileSensor.scx
index 443162d74..3d823be1c 100644
--- a/scenarios/OrientedTactileSensor/OrientedTactileSensor.scx
+++ b/scenarios/OrientedTactileSensor/OrientedTactileSensor.scx
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="utf-8"?>
-<scenario name="OrientedTactileSensor" lastChange="2017-03-06.17:30:06" creation="2017-02-27.01:48:55 PM" globalConfigName="./config/global.cfg" package="RobotAPI">
+<scenario name="OrientedTactileSensor" lastChange="2017-03-09.19:07:21" creation="2017-02-27.01:48:55 PM" globalConfigName="./config/global.cfg" package="RobotAPI">
 	<application name="OrientedTactileSensorUnitApp" instance="" package="RobotAPI"/>
 	<application name="OrientedTactileSensorUnitObserverApp" instance="" package="RobotAPI"/>
 </scenario>
diff --git a/scenarios/OrientedTactileSensor/config/OrientedTactileSensorUnitApp.cfg b/scenarios/OrientedTactileSensor/config/OrientedTactileSensorUnitApp.cfg
index 1ec6764f3..14eba70f3 100644
--- a/scenarios/OrientedTactileSensor/config/OrientedTactileSensorUnitApp.cfg
+++ b/scenarios/OrientedTactileSensor/config/OrientedTactileSensorUnitApp.cfg
@@ -130,12 +130,12 @@ ArmarX.OrientedTactileSensorUnit.SamplesPressure = 20
 ArmarX.OrientedTactileSensorUnit.SamplesRotation = 20
 
 
-# ArmarX.OrientedTactileSensorUnit.SerialInterfaceDevice:  The serial device the arduino is connected to.
+# ArmarX.OrientedTactileSensorUnit.SerialInterfaceDevice:  Custom Property
 #  Attributes:
-#  - Default:            /dev/ttyACM0
+#  - Default:            ::NOT_DEFINED::
 #  - Case sensitivity:   no
 #  - Required:           no
-ArmarX.OrientedTactileSensorUnit.SerialInterfaceDevice = /dev/ttyACM0
+ArmarX.OrientedTactileSensorUnit.SerialInterfaceDevice = /dev/ttyACM3
 
 
 # ArmarX.OrientedTactileSensorUnit.TopicName:  Name of the topic on which the sensor values are provided
diff --git a/source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.cpp b/source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.cpp
index eaafd8eca..858081e66 100644
--- a/source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.cpp
+++ b/source/RobotAPI/drivers/OrientedTactileSensor/OrientedTactileSensorUnit.cpp
@@ -227,36 +227,44 @@ OrientedTactileSensorUnit::SensorData OrientedTactileSensorUnit::getValues(std::
 std::string space = " ";
 bool OrientedTactileSensorUnit::loadCalibration()
 {
+    ARMARX_INFO << "loadCalibration started";
     std::string calibrationStream = getProperty<std::string>("CalibrationData").getValue();
     std::string arduinoLine;
     while (arduinoLine.find("mode") == std::string::npos)
     {
         getline(arduino, arduinoLine, '\n');
+        ARMARX_INFO << "ARDUINO: '" << arduinoLine << "'";
     }
     arduino.close();
 
+    ARMARX_INFO << "opening arduino out mode";
     arduino.open(getProperty<std::string>("SerialInterfaceDevice").getValue(), std::ios::out);
     arduino << "load";
     arduino.flush();
     arduino.close();
 
+    ARMARX_INFO << "opening arduino in mode";
     arduino.open(getProperty<std::string>("SerialInterfaceDevice").getValue(), std::ios::in);
     while (arduinoLine.find("calibration data") == std::string::npos)
     {
         getline(arduino, arduinoLine, '\n');
+        ARMARX_INFO << "ARDUINO: '" << arduinoLine << "'";
     }
     arduino.close();
 
+    ARMARX_INFO << "opening arduino out mode";
     arduino.open(getProperty<std::string>("SerialInterfaceDevice").getValue(), std::ios::out);
     arduino << calibrationStream;
     arduino.flush();
     arduino.close();
 
+    ARMARX_INFO << "opening arduino in mode";
     arduino.open(getProperty<std::string>("SerialInterfaceDevice").getValue(), std::ios::in);
 
     while (arduinoLine.find("Calibration Sucessfull") == std::string::npos)
     {
         getline(arduino, arduinoLine, '\n');
+        ARMARX_INFO << "ARDUINO: '" << arduinoLine << "'";
     }
     return true;
 }
-- 
GitLab