diff --git a/source/RobotAPI/libraries/armem_objects/aron/ObjectClass.xml b/source/RobotAPI/libraries/armem_objects/aron/ObjectClass.xml index 650082eb4ef8b924c8368fdd6cdf8da4578e105a..cb3c418e68b53cb24b781b22ff057386f995d2dc 100644 --- a/source/RobotAPI/libraries/armem_objects/aron/ObjectClass.xml +++ b/source/RobotAPI/libraries/armem_objects/aron/ObjectClass.xml @@ -31,6 +31,10 @@ Core segment type of Object/Class. <armarx::arondto::PackagePath /> </ObjectChild> + <ObjectChild key="articulatedSimoxXmlPath"> + <armarx::arondto::PackagePath /> + </ObjectChild> + <ObjectChild key="meshWrlPath"> <armarx::arondto::PackagePath /> </ObjectChild> diff --git a/source/RobotAPI/libraries/armem_objects/server/class/Segment.cpp b/source/RobotAPI/libraries/armem_objects/server/class/Segment.cpp index ad3027f5032eef26cf60ff768eeb97a9c15aa918..3e6ecfed37e3d75d60b3d509f97520c7627f0fcc 100644 --- a/source/RobotAPI/libraries/armem_objects/server/class/Segment.cpp +++ b/source/RobotAPI/libraries/armem_objects/server/class/Segment.cpp @@ -172,18 +172,23 @@ namespace armarx::armem::server::obj::clazz toAron(data.id, info.id()); - if (fs::is_regular_file(info.simoxXML().absolutePath)) + auto setPathIfExists = []( + armarx::arondto::PackagePath & aron, + const PackageFileLocation & location) { - toAron(data.simoxXmlPath, info.simoxXML()); - } - if (fs::is_regular_file(info.wavefrontObj().absolutePath)) - { - toAron(data.meshObjPath, info.wavefrontObj()); - } - if (fs::is_regular_file(info.file(".wrl").absolutePath)) - { - toAron(data.meshWrlPath, info.file(".wrl")); - } + if (fs::is_regular_file(location.absolutePath)) + { + toAron(aron, location); + } + else + { + toAron(aron, PackageFileLocation()); + } + }; + setPathIfExists(data.simoxXmlPath, info.simoxXML()); + setPathIfExists(data.articulatedSimoxXmlPath, info.articulatedSimoxXML()); + setPathIfExists(data.meshObjPath, info.wavefrontObj()); + setPathIfExists(data.meshWrlPath, info.meshWrl()); auto aabb = info.loadAABB(); toAron(data.aabb, aabb ? aabb.value() : simox::AxisAlignedBoundingBox());