32 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
35 #include <RobotComponents/interface/components/DHParameterOptimizationLoggerInterface.h>
36 #include <RobotComponents/interface/components/ViconMarkerProviderInterface.h>
51 defineOptionalProperty<std::string>(
54 "Topic on which the marker data is published by the ViconMarkerProvider");
55 defineOptionalProperty<std::string>(
"RobotStateComponentName",
"RobotStateComponent");
56 defineOptionalProperty<std::string>(
57 "RobotUnitObserverName",
"RobotUnitObserver",
"Name of the RobotUnitObserver");
58 defineOptionalProperty<std::string>(
59 "LoggingFilePath",
"~/home/DHLogging",
"Path to the logging file");
60 defineOptionalProperty<std::string>(
61 "DebugObserverTopicName",
"DebugObserver",
"The topic where updates are send to");
62 defineOptionalProperty<int>(
65 "Window size of average filter applied to vicon marker positions.");
66 defineRequiredProperty<std::string>(
67 "Neck_ViconObjectName",
68 "Name of the object for the neck marker that is used in the vicon system. "
69 "This is needed to parse the data received from the vicon system correctly.");
70 defineRequiredProperty<std::string>(
71 "Hand_ViconObjectName",
72 "Name of the object for the hand marker that is used in the vicon system. "
73 "This is needed to parse the data received from the vicon system correctly.");
90 virtual public DHParameterOptimizationLoggerInterface
99 return "DHParameterOptimizationLogger";
106 void logData(
const Ice::Current& = Ice::emptyCurrent)
override;
110 void init(
const std::string& kinematicChainName,
111 const std::map<std::string, std::string>& neckMarkerMapping,
112 const std::map<std::string, std::string>& handMarkerMapping,
113 const std::string& loggingFileName,
114 bool logRepeatAccuracy,
115 const Ice::Current& = Ice::emptyCurrent)
override;
145 const Ice::Current& = Ice::emptyCurrent)
override;
147 const Ice::Current& = Ice::emptyCurrent)
override;
152 ObserverInterfacePrx robotUnitObserver;
156 std::string _filePath;
157 void setupFile(
const std::string& fileName);
162 StringVector3fMap _viconMarkerBuffer;
163 bool _viconBufferUpdated;
164 StringVector3fMap _filteredViconMarkerPositions_robotRootFrame;
165 bool _filteredViconMarkerPositionsUpdated;
167 mutable std::mutex _bufferMutex;
168 bool _viconLoggingActive;
172 void logViconMarkerPositions(std::vector<float>&
data);
173 void logJointValues(std::vector<float>&
data)
const;
174 void logForwardKinematicToViconMarker(std::vector<float>&
data)
const;
175 void logErrorBetweenModelAndVicon(std::vector<float>&
data);
176 void logRawTorqueTicks(std::vector<float>&
data)
const;
177 void logTorqueValues(std::vector<float>&
data)
const;
179 void logFTSensorValues(std::vector<float>&
data)
const;
181 StringVector3fMap waitBlockingForAllMarkersFiltered();
184 VirtualRobot::RobotNodeSetPtr _kc;
185 NameList _jointNames;
186 NameList _neckMarker;
187 NameList _handMarker;
188 std::map<std::string, std::string> _neckMarkerMapping;
189 std::map<std::string, std::string> _handMarkerMapping;
190 VirtualRobot::RobotNodePtr getNeckMarkerRootNode()
const;
191 VirtualRobot::RobotNodePtr getHandMarkerRootNode()
const;
192 std::string _viconObjectName_neck;
193 std::string _viconObjectName_hand;
195 bool _logRepeatAccuracy;
198 bool _observedHandPosesUpdated;
199 std::pair<float, float> calculateRepeatError();
202 const Eigen::MatrixXf& matrixB)
const;
204 transformViconMarkerPositionsIntoRobotRootFrame(
const StringVector3fMap&
values)
const;