diff --git a/source/RobotAPI/libraries/armem_objects/CMakeLists.txt b/source/RobotAPI/libraries/armem_objects/CMakeLists.txt index 04be23c592090629a5c6ae1bbc5e3308bf77b02a..d7d6e97391aff7d7b6dd19a30def80b7c40fb49a 100644 --- a/source/RobotAPI/libraries/armem_objects/CMakeLists.txt +++ b/source/RobotAPI/libraries/armem_objects/CMakeLists.txt @@ -14,12 +14,16 @@ armarx_add_library( RobotAPI::Core RobotAPI::libraries::armem HEADERS + aron_conversions.h + server/instance/SegmentAdapter.h server/instance/Segment.h server/instance/Decay.h server/instance/RobotHeadMovement.h server/instance/Visu.h SOURCES + aron_conversions.cpp + server/instance/SegmentAdapter.cpp server/instance/Segment.cpp server/instance/Decay.cpp @@ -31,7 +35,7 @@ armarx_enable_aron_file_generation_for_target( TARGET_NAME "${LIB_NAME}" ARON_FILES - # aron/ObjectID.xml + aron/ObjectInstance.xml ) add_library(${PROJECT_NAME}::armem_objects ALIAS armem_objects) diff --git a/source/RobotAPI/libraries/armem_objects/aron/ObjectInstance.xml b/source/RobotAPI/libraries/armem_objects/aron/ObjectInstance.xml new file mode 100644 index 0000000000000000000000000000000000000000..46c9ef53968f0bd8a31d3424273289f432b27b93 --- /dev/null +++ b/source/RobotAPI/libraries/armem_objects/aron/ObjectInstance.xml @@ -0,0 +1,28 @@ +<!-- ARON DTO of armarx::objpose::ObjectPose. --> +<?xml version="1.0" encoding="UTF-8" ?> +<AronTypeDefinition> + <CodeIncludes> + <Include include="<RobotAPI/libraries/ArmarXObjects/aron/ObjectPose.aron.generated.h>" /> + <Include include="<RobotAPI/libraries/armem/aron/MemoryID.aron.generated.h>" /> + </CodeIncludes> + <AronIncludes> + <Include include="<RobotAPI/libraries/ArmarXObjects/aron/ObjectPose.xml>" /> + <Include include="<RobotAPI/libraries/armem/aron/MemoryID.xml>" /> + </AronIncludes> + <GenerateTypes> + + <Object name="armarx::armem::arondto::ObjectInstance"> + + <ObjectChild key="pose"> + <armarx::objpose::arondto::ObjectPose /> + </ObjectChild> + + <ObjectChild key="sourceID"> + <armarx::armem::arondto::MemoryID /> + </ObjectChild> + + </Object> + + </GenerateTypes> +</AronTypeDefinition> + diff --git a/source/RobotAPI/libraries/armem_objects/aron_conversions.cpp b/source/RobotAPI/libraries/armem_objects/aron_conversions.cpp new file mode 100644 index 0000000000000000000000000000000000000000..859f3d601024ba97dd0e59e938afaba2718a95a1 --- /dev/null +++ b/source/RobotAPI/libraries/armem_objects/aron_conversions.cpp @@ -0,0 +1,27 @@ +#include "aron_conversions.h" + +#include <RobotAPI/libraries/ArmarXObjects/aron_conversions.h> + + +void armarx::armem::fromAron(const arondto::ObjectInstance& dto, objpose::arondto::ObjectPose& bo) +{ + bo = dto.pose; +} + +void armarx::armem::toAron(arondto::ObjectInstance& dto, const objpose::arondto::ObjectPose& bo) +{ + dto.pose = bo; +} + + +void armarx::armem::fromAron(const arondto::ObjectInstance& dto, objpose::ObjectPose& bo) +{ + objpose::fromAron(dto.pose, bo); +} + +void armarx::armem::toAron(arondto::ObjectInstance& dto, const objpose::ObjectPose& bo) +{ + objpose::toAron(dto.pose, bo); +} + + diff --git a/source/RobotAPI/libraries/armem_objects/aron_conversions.h b/source/RobotAPI/libraries/armem_objects/aron_conversions.h new file mode 100644 index 0000000000000000000000000000000000000000..7ea733e99c75895ff7aba463f36a0f53d0c4bd38 --- /dev/null +++ b/source/RobotAPI/libraries/armem_objects/aron_conversions.h @@ -0,0 +1,15 @@ +#pragma once + +#include <RobotAPI/libraries/ArmarXObjects/ObjectPose.h> + +#include <RobotAPI/libraries/armem_objects/aron/ObjectInstance.aron.generated.h> + + +namespace armarx::armem +{ + void fromAron(const arondto::ObjectInstance& dto, objpose::arondto::ObjectPose& bo); + void toAron(arondto::ObjectInstance& dto, const objpose::arondto::ObjectPose& bo); + + void fromAron(const arondto::ObjectInstance& dto, objpose::ObjectPose& bo); + void toAron(arondto::ObjectInstance& dto, const objpose::ObjectPose& bo); +}