27#include <VirtualRobot/Robot.h>
42 for (
const auto& objectID :
missing)
56 VirtualRobot::RobotIO::RobotDescription loadMode)
60 for (
const auto& objectPose : articulatedObjectPoses)
77 catch (
const armarx::LocalException&)
79 ARMARX_WARNING <<
"Could not load articulated object `" << objectID
81 result.
missing.push_back(objectID);
85 if (articulatedObject ==
nullptr)
87 ARMARX_WARNING <<
"Could not load articulated object `" << objectID
88 <<
"`: the robot model could not be loaded.";
89 result.
missing.push_back(objectID);
96 ARMARX_WARNING <<
"Could not synchronize articulated object `" << objectID
97 <<
"`: no state available.";
98 result.
missing.push_back(objectID);
102 if (articulatedObject->getCollisionModels().empty())
104 ARMARX_VERBOSE <<
"The articulated object `" << articulatedObject->getType() <<
"/"
105 << articulatedObject->getName()
106 <<
"` does not have a collision model. Using primitive model "
109 std::set<std::string> primitiveIDs;
110 articulatedObject->getPrimitiveApproximationIDs(primitiveIDs);
114 const std::vector<std::string> usedPrimitiveModelIDs(primitiveIDs.begin(),
116 articulatedObject->setPrimitiveApproximationModel(usedPrimitiveModelIDs);
119 result.
objects.push_back(articulatedObject);
static DateTime Now()
Current time on the virtual clock.
A known object ID of the form "Dataset/ClassName" or "Dataset/ClassName/InstanceName".
ObjectID getClassID() const
Return just the class ID without an intance name.
std::string instanceName() const
std::string str() const
Return "dataset/className" or "dataset/className/instanceName".
VirtualRobot::RobotPtr getArticulatedObject(const std::string &typeName, const armem::Time ×tamp, const std::optional< std::string > &providerName, const std::string &instanceName="", VirtualRobot::RobotIO::RobotDescription loadMode=VirtualRobot::RobotIO::eStructure)
bool synchronizeArticulatedObject(VirtualRobot::Robot &object, const armem::Time ×tamp, const std::optional< std::string > &providerName)
#define ARMARX_WARNING
The logging level for unexpected behaviour, but not a serious problem.
#define ARMARX_VERBOSE
The logging level for verbose information.
std::shared_ptr< class Robot > RobotPtr
This file is part of ArmarX.
ArticulatedObjectsResult loadArticulatedObjects(armem::articulated_object::ArticulatedObjectReader &reader, const objpose::ObjectPoseSeq &articulatedObjectPoses, VirtualRobot::RobotIO::RobotDescription loadMode)
Loads the articulated objects for the given (already filtered) articulated object poses.
std::vector< ObjectPose > ObjectPoseSeq
std::string GetHandledExceptionString()
std::vector< armarx::ObjectID > missing
Objects whose description or state was not (yet) available in the object memory.
std::string missingToString() const
The missing object IDs, for logging.
std::vector< VirtualRobot::RobotPtr > objects