utils.cpp
Go to the documentation of this file.
1#include "utils.h"
2
4
7
9{
10 std::optional<robot_state::description::RobotDescription>
12 {
13
14 arondto::ObjectClass aronObjectInfo;
15 try
16 {
17 aronObjectInfo.fromAron(instance.data());
18 }
19 catch (...)
20 {
21 ARMARX_WARNING << "Conversion to ObjectPose failed!";
22 return std::nullopt;
23 }
24
26 fromAron(aronObjectInfo, robotDescription);
27
28 // check if robot description is valid
29 const auto xml = robotDescription.xml.serialize();
30 if (robotDescription.name.empty() or xml.package.empty() or xml.path.empty())
31 {
32 return std::nullopt;
33 }
34
35 return robotDescription;
36 }
37
38} // namespace armarx::armem::articulated_object
data::PackagePath serialize() const
Client-side working entity instance.
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
Definition Logging.h:193
std::optional< robot_state::description::RobotDescription > convertRobotDescription(const armem::wm::EntityInstance &instance)
Definition utils.cpp:11
void fromAron(const arondto::MemoryID &dto, MemoryID &bo)