Skip to content
Snippets Groups Projects
Commit 02e764a1 authored by Rainer Kartmann's avatar Rainer Kartmann
Browse files

Add setters for object pose robot and global

parent d9038dde
No related branches found
No related tags found
1 merge request!157armem/dev => master
#include "ObjectPose.h"
#include <SimoxUtility/math/pose/invert.h>
#include <VirtualRobot/Robot.h>
#include <VirtualRobot/RobotConfig.h>
......@@ -100,6 +102,26 @@ namespace armarx::objpose
objpose::fromIce(provided.localOOBB, localOOBB);
}
void ObjectPose::setObjectPoseRobot(
const Eigen::Matrix4f& objectPoseRobot, bool updateObjectPoseGlobal)
{
this->objectPoseRobot = objectPoseRobot;
if (updateObjectPoseGlobal)
{
this->objectPoseGlobal = robotPose * objectPoseRobot;
}
}
void ObjectPose::setObjectPoseGlobal(
const Eigen::Matrix4f& objectPoseGlobal, bool updateObjectPoseRobot)
{
this->objectPoseGlobal = objectPoseGlobal;
if (updateObjectPoseRobot)
{
this->objectPoseRobot = simox::math::inverted_pose(robotPose) * objectPoseGlobal;
}
}
std::optional<simox::OrientedBoxf> ObjectPose::oobbRobot() const
{
......
......@@ -39,6 +39,9 @@ namespace armarx::objpose
void fromProvidedPose(const data::ProvidedObjectPose& provided, VirtualRobot::RobotPtr robot);
void setObjectPoseRobot(const Eigen::Matrix4f& objectPoseRobot, bool updateObjectPoseGlobal = true);
void setObjectPoseGlobal(const Eigen::Matrix4f& objectPoseGlobal, bool updateObjectPoseRobot = true);
/// Name of the providing component.
std::string providerName;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment