27#include <Eigen/Geometry>
29#include <Ice/ObjectAdapter.h>
31#include <VirtualRobot/LinkedCoordinate.h>
32#include <VirtualRobot/VirtualRobot.h>
44 this->referenceRobot =
nullptr;
49 armarx::Serializable(other),
50 armarx::VariantDataClass(other),
52 FramedPoseBase(other),
53 LinkedPoseBase(other),
60 referenceRobot->ref();
67 FramedPoseBase(other),
72 this->referenceRobot = referenceRobot;
77 referenceRobot->ref();
82 const Eigen::Vector3f& v,
88 referenceRobot->ref();
89 this->referenceRobot = referenceRobot;
98 referenceRobot->ref();
99 this->referenceRobot = referenceRobot;
108 referenceRobot->unref();
117 VirtualRobot::LinkedCoordinate
121 VirtualRobot::LinkedCoordinate
c(sharedRobot);
122 std::string frame = this->
getFrame();
124 Eigen::Matrix4f pose = Eigen::Matrix4f::Identity();
126 pose.block<3, 3>(0, 0) = QuaternionPtr::dynamicCast(orientation)->toEigen();
127 pose.block<3, 1>(0, 3) = Vector3Ptr::dynamicCast(position)->toEigen();
137 return this->
clone();
151 <<
"reference robot: " << referenceRobot->ice_toString();
193 obj->setString(
"referenceRobot",
"");
203 std::string remoteRobotId = obj->getString(
"referenceRobot");
204 referenceRobot = SharedRobotInterfacePrx::uncheckedCast(
205 c.adapter->getCommunicator()->stringToProxy(remoteRobotId));
209 ARMARX_ERROR_S <<
"ReferenceRobot for LinkedPose not registered: " << remoteRobotId
220 referenceRobot->ref();
230 armarx::Serializable(source),
232 FramedDirectionBase(source),
233 LinkedDirectionBase(source),
237 referenceRobot = source.referenceRobot;
242 referenceRobot->ref();
247 const std::string& frame,
251 referenceRobot->ref();
252 this->referenceRobot = referenceRobot;
261 referenceRobot->unref();
273 if (newFrame == frame)
284 frame = frVec->frame;
290 throw LocalException(
"LinkedDirection cannot be serialized! Serialize FramedDirection");
296 throw LocalException(
"LinkedDirection cannot be deserialized! Deserialize FramedDirection");
305 referenceRobot->ref();
308 FramedDirection::ice_postUnmarshal();
static FramedDirectionPtr ChangeFrame(const VirtualRobot::RobotConstPtr &robot, const FramedDirection &framedVec, const std::string &newFrame)
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
void changeToGlobal(const SharedRobotInterfacePrx &referenceRobot)
FramedPosePtr toGlobal(const SharedRobotInterfacePrx &referenceRobot) const
std::string getFrame() const
void changeFrame(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame)
void ice_postUnmarshal() override
void changeFrame(const std::string &newFrame, const Ice::Current &c=Ice::emptyCurrent) override
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
~LinkedDirection() override
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
void ice_postUnmarshal() override
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
void changeFrame(const std::string &newFrame, const Ice::Current &c=Ice::emptyCurrent) override
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
VirtualRobot::LinkedCoordinate createLinkedCoordinate()
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
LinkedPosePtr toGlobal() const
Ice::ObjectPtr ice_clone() const override
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
void ice_postUnmarshal() override
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Mimics the behaviour of the VirtualRobot::Robot class while redirecting everything to an Ice proxy.
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
#define ARMARX_DEBUG_S
The logging level for output that is only interesting while debugging.
#define ARMARX_ERROR_S
The logging level for unexpected behaviour, that must be fixed.
std::shared_ptr< class Robot > RobotPtr
const VariantTypeId LinkedDirection
void suppressWarningUnusedVariableForLinkedPoseAndDirection()
const VariantTypeId LinkedPose
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceInternal::Handle< LinkedPose > LinkedPosePtr
IceInternal::Handle< FramedDirection > FramedDirectionPtr
IceInternal::Handle< AbstractObjectSerializer > AbstractObjectSerializerPtr
::IceInternal::ProxyHandle<::IceProxy::armarx::SharedRobotInterface > SharedRobotInterfacePrx
const LogSender::manipulator flush
IceInternal::Handle< FramedPose > FramedPosePtr