3#include <SimoxUtility/math/pose/invert.h>
4#include <SimoxUtility/math/pose/pose.h>
5#include <VirtualRobot/Nodes/RobotNode.h>
6#include <VirtualRobot/Robot.h>
7#include <VirtualRobot/RobotConfig.h>
124 framed.
changeFrame(robot, robot->getRootNode()->getName());
147 robotConfig = robot->getConfig()->getRobotNodeJointValueMap();
206 return providedObjectPose;
211 bool updateObjectPoseGlobal)
214 if (updateObjectPoseGlobal)
222 bool updateObjectPoseRobot)
225 if (updateObjectPoseRobot)
231 std::optional<simox::OrientedBoxf>
241 std::optional<simox::OrientedBoxf>
269 VirtualRobot::RobotNodePtr robotNode = agent->getRobotNode(
attachment->frameName);
278 robotConfig = agent->getConfig()->getRobotNodeJointValueMap();
296 std::optional<ObjectAttachmentInfo>& attachment)
305 attachment = std::nullopt;
309 std::optional<objpose::ObjectAttachmentInfo>
331 const std::optional<ObjectAttachmentInfo>& attachment)
335 ice =
new objpose::data::ObjectAttachmentInfo();
336 toIce(*ice, *attachment);
344 objpose::data::ObjectAttachmentInfoPtr
351 objpose::data::ObjectAttachmentInfoPtr ice =
new objpose::data::ObjectAttachmentInfo();
352 toIce(*ice, *attachment);
372 poses.reserve(ice.size());
373 for (
const auto& i : ice)
375 poses.emplace_back(i);
393 objpose::data::ObjectPose
403 ice.reserve(poses.size());
404 for (
const auto& p : poses)
406 ice.emplace_back(p.toIce());
410 objpose::data::ObjectPoseSeq
413 data::ObjectPoseSeq ice;
423 if (pose.objectID ==
id)
436 if (pose.objectID ==
id)
444 objpose::data::ObjectPose*
447 for (objpose::data::ObjectPose& pose : objectPoses)
449 if (pose.objectID ==
id)
457 const objpose::data::ObjectPose*
459 const armarx::data::ObjectID&
id)
461 for (
const objpose::data::ObjectPose& pose : objectPoses)
463 if (pose.objectID ==
id)
void changeToGlobal(const SharedRobotInterfacePrx &referenceRobot)
void changeFrame(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame)
A known object ID of the form "Dataset/ClassName" or "Dataset/ClassName/InstanceName".
virtual Eigen::Matrix4f toEigen() const
An object pose provided by an ObjectPoseProvider.
float confidence
Confidence in [0, 1] (1 = full, 0 = none).
armarx::ObjectID objectID
The object ID, i.e. dataset, class name and instance name.
std::string providerName
Name of the providing component.
bool isStatic
Whether object is static. Static objects don't decay.
Eigen::Matrix4f objectPose
DateTime timestamp
Source timestamp.
ObjectType objectType
Known or unknown object.
std::map< std::string, float > objectJointValues
The object's joint values if it is articulated.
std::optional< simox::OrientedBoxf > localOOBB
Object bounding box in object's local coordinate frame.
std::string objectPoseFrame
std::optional< PoseManifoldGaussian > objectPoseGaussian
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
#define ARMARX_CHECK_EQUAL(lhs, rhs)
This macro evaluates whether lhs is equal (==) rhs and if it turns out to be false it will throw an E...
std::string const GlobalFrame
Variable of the global coordinate system.
std::shared_ptr< class Robot > RobotPtr
void toIce(dto::ClockType::ClockTypeEnum &dto, const ClockType &bo)
void fromIce(const dto::ClockType::ClockTypeEnum &dto, ClockType &bo)
ObjectPose * findObjectPoseByID(ObjectPoseSeq &objectPoses, const ObjectID &id)
Find an object pose by the object ID.
std::vector< ObjectPose > ObjectPoseSeq
void fromIce(const Box &box, simox::OrientedBox< float > &oobb)
objpose::AABB toIce(const simox::AxisAlignedBoundingBox &aabb)
This file offers overloads of toIce() and fromIce() functions for STL container types.
void fromIce(const std::map< IceKeyT, IceValueT > &iceMap, boost::container::flat_map< CppKeyT, CppValueT > &cppMap)
void toIce(std::map< IceKeyT, IceValueT > &iceMap, const boost::container::flat_map< CppKeyT, CppValueT > &cppMap)
Eigen::Matrix4f poseInFrame
An object pose as stored by the ObjectPoseStorage.
float confidence
Confidence in [0, 1] (1 = full, 0 = none).
armarx::ObjectID objectID
The object ID, i.e. dataset, class name and instance name.
objpose::ObjectPose getAttached(VirtualRobot::RobotPtr agent) const
Get a copy of *this with updated attachment.
std::optional< ObjectAttachmentInfo > attachment
Attachment information.
std::map< std::string, float > robotConfig
The robot config when the object was observed.
std::string providerName
Name of the providing component.
void fromProvidedPose(const data::ProvidedObjectPose &provided, VirtualRobot::RobotPtr robot=nullptr)
data::ObjectPose toIce() const
void setObjectPoseGlobal(const Eigen::Matrix4f &objectPoseGlobal, bool updateObjectPoseRobot=true)
bool isStatic
Whether object is static. Static objects don't decay.
void updateAttached(VirtualRobot::RobotPtr agent)
Update an the object pose and robot state of an attached object pose according to the given agent sta...
std::optional< simox::OrientedBoxf > oobbRobot() const
Get the OOBB in the robot frame (according to objectPoseRobot).
DateTime timestamp
Source timestamp.
Eigen::Matrix4f objectPoseRobot
The object pose in the robot root frame.
Eigen::Matrix4f robotPose
The robot pose when the object was observed.
Eigen::Matrix4f objectPoseOriginal
The object pose in the frame it was originally localized in.
ObjectType objectType
Known or unknown object.
std::optional< PoseManifoldGaussian > objectPoseGlobalGaussian
... and with uncertainty.
void setObjectPoseRobot(const Eigen::Matrix4f &objectPoseRobot, bool updateObjectPoseGlobal=true)
std::map< std::string, float > objectJointValues
The object's joint values if it is articulated.
std::optional< simox::OrientedBoxf > localOOBB
Object bounding box in object's local coordinate frame.
void fromIce(const data::ObjectPose &ice)
std::optional< simox::OrientedBoxf > oobbGlobal() const
Get the OOBB in the global frame (according to objectPoseGlobal).
std::optional< PoseManifoldGaussian > objectPoseOriginalGaussian
... and with uncertainty.
objpose::ProvidedObjectPose toProvidedObjectPoseGlobal() const
Eigen::Matrix4f objectPoseGlobal
The object pose in the global frame.
std::string robotName
The name of the robot.
std::optional< PoseManifoldGaussian > objectPoseRobotGaussian
... and with uncertainty.
std::string objectPoseOriginalFrame
The frame the object was originally localized in.