From 5cdd8ae0c5ef48dba93db2dbcabf15063af4d6b8 Mon Sep 17 00:00:00 2001
From: Andreas Gaukel <ucesn@student.kit.edu>
Date: Mon, 9 Sep 2024 11:36:43 +0200
Subject: [PATCH] Added conversion operation for objectWidthatGraspPoseInMM as
 part of objInfo which is part of ActionHypothesis

---
 .../manipulation/core/aron_conversions.cpp     | 18 ++++++++++++++++--
 1 file changed, 16 insertions(+), 2 deletions(-)

diff --git a/source/armarx/manipulation/core/aron_conversions.cpp b/source/armarx/manipulation/core/aron_conversions.cpp
index 9c2bbd44..92a55ee4 100644
--- a/source/armarx/manipulation/core/aron_conversions.cpp
+++ b/source/armarx/manipulation/core/aron_conversions.cpp
@@ -132,6 +132,12 @@ namespace armarx::manipulation::core
             {
                 objInfo->segmentLabel = dto.objectInformation->segmentLabel.value();
             }
+            if (dto.objectInformation->objectWidthAtGraspPoseInMM.has_value())
+            {
+                objInfo->objectWidthAtGraspPoseInMM.emplace();
+                objInfo->objectWidthAtGraspPoseInMM =
+                    dto.objectInformation->objectWidthAtGraspPoseInMM.value();
+            }
         }
         if (dto.approachInformation.has_value())
         {
@@ -162,7 +168,8 @@ namespace armarx::manipulation::core
     }
 
     void
-    toAron(arondto::executable_action::EndEffectorState& dto, const executable_action::EndEffectorState& bo)
+    toAron(arondto::executable_action::EndEffectorState& dto,
+           const executable_action::EndEffectorState& bo)
     {
         armarx::toAron(dto.pose, bo.pose);
         dto.fingerValues = bo.fingerValues;
@@ -178,7 +185,8 @@ namespace armarx::manipulation::core
     }
 
     void
-    fromAron(const arondto::executable_action::EndEffectorState& dto, executable_action::EndEffectorState& bo)
+    fromAron(const arondto::executable_action::EndEffectorState& dto,
+             executable_action::EndEffectorState& bo)
     {
         bo = fromAron(dto);
     }
@@ -292,6 +300,12 @@ namespace armarx::manipulation::core
                 toAron(dto.objectInformation->referenceObjectPose.value(),
                        bo.objectInformation->referenceObjectPose.value());
             }
+            if (bo.objectInformation->objectWidthAtGraspPoseInMM.has_value())
+            {
+                dto.objectInformation->objectWidthAtGraspPoseInMM.emplace();
+                dto.objectInformation->objectWidthAtGraspPoseInMM =
+                    bo.objectInformation->objectWidthAtGraspPoseInMM;
+            }
         }
         if (bo.approachInformation.has_value())
         {
-- 
GitLab