FramedPose.cpp
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 
28 
32 
33 #include <VirtualRobot/Robot.h>
34 #include <VirtualRobot/LinkedCoordinate.h>
35 #include <VirtualRobot/VirtualRobot.h>
36 #include <VirtualRobot/RobotConfig.h>
37 
38 #include <Eigen/Core>
39 #include <Eigen/Geometry>
40 
41 
42 
43 using namespace Eigen;
44 
45 template class ::IceInternal::Handle<::armarx::FramedPose>;
46 template class ::IceInternal::Handle<::armarx::FramedPosition>;
47 template class ::IceInternal::Handle<::armarx::FramedDirection>;
48 template class ::IceInternal::Handle<::armarx::FramedOrientation>;
49 
50 namespace armarx
51 {
52 
53 
55  = default;
56 
58  IceUtil::Shared(source),
59  armarx::Serializable(source),
60  Vector3Base(source),
61  FramedDirectionBase(source),
63  {
64  }
65 
66  FramedDirection::FramedDirection(const Eigen::Vector3f& vec, const std::string& frame, const std::string& agent) :
67  Vector3(vec)
68  {
69  this->frame = frame;
70  this->agent = agent;
71 
72  }
73 
74  FramedDirection::FramedDirection(Ice::Float x, ::Ice::Float y, ::Ice::Float z, const std::string& frame, const std::string& agent) :
75  Vector3(x, y, z)
76  {
77  this->frame = frame;
78  this->agent = agent;
79  }
80 
81  std::string FramedDirection::getFrame() const
82  {
83  return frame;
84  }
85 
86  FramedDirectionPtr FramedDirection::ChangeFrame(const VirtualRobot::RobotPtr& robot, const FramedDirection& framedVec, const std::string& newFrame)
87  {
88  ARMARX_CHECK_NOT_NULL(robot);
89  return ChangeFrame(*robot, framedVec, newFrame);
90  }
91 
92  FramedDirectionPtr FramedDirection::ChangeFrame(const VirtualRobot::Robot& robot, const FramedDirection& framedVec, const std::string& newFrame)
93  {
94  if (framedVec.getFrame() == newFrame)
95  {
96  return FramedDirectionPtr::dynamicCast(framedVec.clone());
97  }
98 
99  if (!robot.hasRobotNode(newFrame))
100  {
101  throw LocalException() << "The requested frame '" << newFrame << "' does not exists in the robot " << robot.getName();
102  }
103 
104  Eigen::Matrix4f rotToNewFrame = __GetRotationBetweenFrames(framedVec.frame, newFrame, robot);
105 
106  Eigen::Vector3f vecOldFrame = framedVec.Vector3::toEigen();
107 
108  Eigen::Vector3f newVec = rotToNewFrame.block(0, 0, 3, 3).inverse() * vecOldFrame;
109 
110  FramedDirectionPtr result = new FramedDirection();
111  result->x = newVec(0);
112  result->y = newVec(1);
113  result->z = newVec(2);
114  result->frame = newFrame;
115  result->agent = robot.getName();
116  return result;
117  }
118 
119  void FramedDirection::changeFrame(const VirtualRobot::RobotPtr& robot, const std::string& newFrame)
120  {
121  ARMARX_CHECK_NOT_NULL(robot);
122  changeFrame(*robot, newFrame);
123  }
124 
125  void FramedDirection::changeFrame(const VirtualRobot::Robot& robot, const std::string& newFrame)
126  {
127  if (frame == "")
128  {
129  frame = GlobalFrame;
130  }
131 
132 
133  if (getFrame() == newFrame)
134  {
135  return;
136  }
137 
138  if (newFrame == GlobalFrame)
139  {
140  changeToGlobal(robot);
141  return;
142  }
143 
144  if (!robot.hasRobotNode(newFrame))
145  {
146  throw LocalException() << "The requested frame '" << newFrame << "' does not exist in the robot " << robot.getName();
147  }
148 
149  if (frame != GlobalFrame && !robot.hasRobotNode(frame))
150  {
151  throw LocalException() << "The current frame '" << frame << "' does not exist in the robot " << robot.getName();
152  }
153 
154 
155  Eigen::Matrix4f rotToNewFrame = __GetRotationBetweenFrames(frame, newFrame, robot);
156 
157  Eigen::Vector3f vecOldFrame = Vector3::toEigen();
158 
159  Eigen::Vector3f newVec = rotToNewFrame.block(0, 0, 3, 3).inverse() * vecOldFrame;
160 
161 
162  x = newVec(0);
163  y = newVec(1);
164  z = newVec(2);
165  frame = newFrame;
166  agent = robot.getName();
167  }
168 
170  {
171  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
172  changeToGlobal(sharedRobot);
173  }
174 
176  {
177  ARMARX_CHECK_NOT_NULL(referenceRobot);
178  changeToGlobal(*referenceRobot);
179  }
180 
182  {
183  if (frame == GlobalFrame)
184  {
185  return;
186  }
187 
188  changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
189  Eigen::Vector3f pos = referenceRobot.getRootNode()->getGlobalPose().block<3, 3>(0, 0) * toEigen();
190  x = pos[0];
191  y = pos[1];
192  z = pos[2];
193  frame = GlobalFrame;
194  agent = "";
195  }
196 
198  {
199  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
200  return toGlobal(sharedRobot);
201  }
203  {
204  ARMARX_CHECK_NOT_NULL(referenceRobot);
205  return toGlobal(*referenceRobot);
206  }
208  {
209  FramedDirectionPtr newDirection = FramedDirectionPtr::dynamicCast(this->clone());
210  newDirection->changeToGlobal(referenceRobot);
211  return newDirection;
212  }
213 
214  Eigen::Vector3f FramedDirection::toGlobalEigen(const SharedRobotInterfacePrx& referenceRobot) const
215  {
216  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
217  return toGlobalEigen(sharedRobot);
218  }
219  Eigen::Vector3f FramedDirection::toGlobalEigen(const VirtualRobot::RobotPtr& referenceRobot) const
220  {
221  ARMARX_CHECK_NOT_NULL(referenceRobot);
222  return toGlobalEigen(*referenceRobot);
223  }
224  Eigen::Vector3f FramedDirection::toGlobalEigen(const VirtualRobot::Robot& referenceRobot) const
225  {
226  FramedDirection newDirection(toEigen(), frame, agent);
227  newDirection.changeToGlobal(referenceRobot);
228  return newDirection.toEigen();
229  }
230 
232  {
233  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
234  return toRootFrame(sharedRobot);
235  }
237  {
238  ARMARX_CHECK_NOT_NULL(referenceRobot);
239  return toRootFrame(*referenceRobot);
240  }
242  {
243  FramedDirectionPtr newDirection = FramedDirectionPtr::dynamicCast(this->clone());
244  newDirection->changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
245  return newDirection;
246  }
247 
248  Eigen::Vector3f FramedDirection::toRootEigen(const SharedRobotInterfacePrx& referenceRobot) const
249  {
250  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
251  return toRootEigen(sharedRobot);
252  }
253  Eigen::Vector3f FramedDirection::toRootEigen(const VirtualRobot::RobotPtr& referenceRobot) const
254  {
255  ARMARX_CHECK_NOT_NULL(referenceRobot);
256  return toRootEigen(*referenceRobot);
257  }
258  Eigen::Vector3f FramedDirection::toRootEigen(const VirtualRobot::Robot& referenceRobot) const
259  {
260  FramedDirection newDirection(toEigen(), frame, agent);
261  newDirection.changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
262  return newDirection.toEigen();
263  }
264 
265  std::string FramedDirection::output(const Ice::Current& c) const
266  {
267  std::stringstream s;
268  s << toEigen().format(ArmarXEigenFormat) << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent));
269  return s.str();
270  }
271 
272  Eigen::Matrix4f FramedDirection::__GetRotationBetweenFrames(const std::string& oldFrame, const std::string& newFrame, const VirtualRobot::Robot& robotState)
273  {
274  Eigen::Matrix4f toNewFrame;
275 
276  if (oldFrame == GlobalFrame)
277  {
278  auto node = robotState.getRobotNode(newFrame);
279  ARMARX_CHECK_EXPRESSION(node) << newFrame;
280  toNewFrame = node->getGlobalPose();
281  }
282  else
283  {
284  auto node = robotState.getRobotNode(oldFrame);
285  ARMARX_CHECK_EXPRESSION(node) << "old frame: " + oldFrame + ValueToString(robotState.getConfig()->getRobotNodeJointValueMap());
286  auto newNode = robotState.getRobotNode(newFrame);
287  ARMARX_CHECK_EXPRESSION(newNode) << newFrame;
288  toNewFrame = node->getTransformationTo(newNode);
289  }
290 
291  toNewFrame(0, 3) = 0;
292  toNewFrame(1, 3) = 0;
293  toNewFrame(2, 3) = 0;
294 
295  return toNewFrame;
296  }
297 
298 
299  void FramedDirection::serialize(const ObjectSerializerBasePtr& serializer, const Ice::Current&) const
300  {
301  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
302  Vector3::serialize(serializer);
303  obj->setString("frame", frame);
304  obj->setString("agent", agent);
305 
306  }
307 
308  void FramedDirection::deserialize(const ObjectSerializerBasePtr& serializer, const Ice::Current&)
309  {
310  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
311  Vector3::deserialize(serializer);
312  frame = obj->getString("frame");
313 
314  if (obj->hasElement("agent"))
315  {
316  agent = obj->getString("agent");
317  }
318  }
319 
321  {
322  return this->clone();
323  }
324 
325  VariantDataClassPtr FramedDirection::clone(const Ice::Current& c) const
326  {
327  return new FramedDirection(*this);
328  }
329 
330  VariantTypeId FramedDirection::getType(const Ice::Current& c) const
331  {
333  }
334 
335  bool FramedDirection::validate(const Ice::Current& c)
336  {
337  return true;
338  }
339 
340  std::ostream& operator<<(std::ostream& stream, const FramedDirection& rhs)
341  {
342  stream << "FramedDirection: " << std::endl << rhs.output() << std::endl;
343  return stream;
344  }
345 
346 
348  Pose()
349  {
350  frame = "";
351  }
352 
354  IceUtil::Shared(pose),
355  armarx::Serializable(pose),
356  armarx::VariantDataClass(pose),
357  PoseBase(pose),
358  FramedPoseBase(pose),
359  Pose(pose)
360  {
361 
362  }
363 
364  FramedPose::FramedPose(const Eigen::Matrix3f& m, const Eigen::Vector3f& v, const std::string& s, const std::string& agent) :
365  Pose(m, v)
366  {
367  frame = s;
368  this->agent = agent;
369  }
370 
371  FramedPose::FramedPose(const Eigen::Matrix4f& m, const std::string& s, const std::string& agent) :
372  Pose(m)
373  {
374  frame = s;
375  this->agent = agent;
376  }
377 
378  FramedPose::FramedPose(const armarx::Vector3BasePtr pos, const armarx::QuaternionBasePtr ori, const std::string& frame, const std::string& agent) :
379  Pose(pos, ori)
380  {
381  this->frame = frame;
382  this->agent = agent;
383  }
384 
385  FramedPose::FramedPose(const Eigen::Vector3f& pos, const Eigen::Quaternionf& ori, const std::string& frame, const std::string& agent) :
386  Pose(pos, ori)
387  {
388  this->frame = frame;
389  this->agent = agent;
390  }
391 
392 
393  std::string FramedPose::getFrame() const
394  {
395  return frame;
396  }
397 
398  std::string FramedPose::output(const Ice::Current& c) const
399  {
400  std::stringstream s;
401  const Eigen::IOFormat ArmarXEigenFormat(Eigen::StreamPrecision, 4, " ", "\n", "", "");
402  s << toEigen().format(ArmarXEigenFormat) << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent));
403  return s.str();
404  }
405 
406  void FramedPose::changeFrame(const SharedRobotInterfacePrx& referenceRobot, const std::string& newFrame)
407  {
408  if (newFrame == frame)
409  {
410  return;
411  }
412 
413  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
414  changeFrame(sharedRobot, newFrame);
415  }
416 
417  void FramedPose::changeFrame(const VirtualRobot::RobotPtr& referenceRobot, const std::string& newFrame)
418  {
419  ARMARX_CHECK_NOT_NULL(referenceRobot);
420  changeFrame(*referenceRobot, newFrame);
421  }
422 
423  void FramedPose::changeFrame(const VirtualRobot::Robot& referenceRobot, const std::string& newFrame)
424  {
425  if (newFrame == frame)
426  {
427  return;
428  }
429 
430  if (newFrame == GlobalFrame)
431  {
432  changeToGlobal(referenceRobot);
433  return;
434  }
435 
436  Eigen::Matrix4f oldFrameTransformation = Eigen::Matrix4f::Identity();
437 
438  if (frame != GlobalFrame and !referenceRobot.hasRobotNode(frame))
439  {
440  throw LocalException() << "The current frame '" << frame << "' does not exists in the robot " << referenceRobot.getName();
441  }
442  if (!referenceRobot.hasRobotNode(newFrame))
443  {
444  throw LocalException() << "The requested frame '" << newFrame << "' does not exists in the robot " << referenceRobot.getName();
445  }
446 
447  if (frame != GlobalFrame)
448  {
449  oldFrameTransformation = referenceRobot.getRobotNode(frame)->getPoseInRootFrame();
450  }
451  else
452  {
453  oldFrameTransformation = referenceRobot.getRootNode()->getGlobalPose().inverse();
454  }
455 
456  Eigen::Matrix4f newPose =
457  (referenceRobot.getRobotNode(newFrame)->getPoseInRootFrame().inverse() * oldFrameTransformation) * toEigen();
458 
459  orientation = new Quaternion(newPose);
460  Eigen::Vector3f pos = newPose.block<3, 1>(0, 3);
461  position = new Vector3(pos);
462  frame = newFrame;
463  agent = referenceRobot.getName();
464  init();
465  }
466 
468  {
469  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
470  changeToGlobal(sharedRobot);
471 
472  }
474  {
475  ARMARX_CHECK_NOT_NULL(referenceRobot);
476  changeToGlobal(*referenceRobot);
477  }
479  {
480  if (frame == GlobalFrame)
481  {
482  return;
483  }
484 
485  changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
486  Eigen::Matrix4f global = referenceRobot.getRootNode()->getGlobalPose();
487  const Eigen::Matrix4f pose = global * toEigen();
488  position->x = pose(0, 3);
489  position->y = pose(1, 3);
490  position->z = pose(2, 3);
491  Eigen::Quaternionf q(pose.block<3, 3>(0, 0));
492  orientation->qw = q.w();
493  orientation->qx = q.x();
494  orientation->qy = q.y();
495  orientation->qz = q.z();
496  frame = GlobalFrame;
497  agent = "";
498  }
499 
501  {
502  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
503  return toGlobal(sharedRobot);
504  }
506  {
507  ARMARX_CHECK_NOT_NULL(referenceRobot);
508  return toGlobal(*referenceRobot);
509  }
511  {
512  FramedPosePtr newPose = FramedPosePtr::dynamicCast(this->clone());
513  newPose->changeToGlobal(referenceRobot);
514  return newPose;
515  }
516 
518  {
519  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
520  return toGlobalEigen(sharedRobot);
521  }
523  {
524  ARMARX_CHECK_NOT_NULL(referenceRobot);
525  return toGlobalEigen(*referenceRobot);
526  }
528  {
529  FramedPose newPose(toEigen(), frame, agent);
530  newPose.changeToGlobal(referenceRobot);
531  return newPose.toEigen();
532  }
533 
535  {
536  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
537  return toRootFrame(sharedRobot);
538  }
540  {
541  ARMARX_CHECK_NOT_NULL(referenceRobot);
542  return toRootFrame(*referenceRobot);
543  }
545  {
546  FramedPosePtr newPose = FramedPosePtr::dynamicCast(this->clone());
547  newPose->changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
548  return newPose;
549  }
550 
552  {
553  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
554  return toRootEigen(sharedRobot);
555  }
557  {
558  ARMARX_CHECK_NOT_NULL(referenceRobot);
559  return toRootEigen(*referenceRobot);
560  }
562  {
563  FramedPose newPose(toEigen(), frame, agent);
564  newPose.changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
565  return newPose.toEigen();
566  }
567 
568 
570  {
571  FramedPositionPtr result = new FramedPosition(Vector3Ptr::dynamicCast(position)->toEigen(), frame, agent);
572  return result;
573  }
574 
576  {
577  FramedOrientationPtr result = new FramedOrientation(QuaternionPtr::dynamicCast(this->orientation)->toEigen(), frame, agent);
578  return result;
579  }
580 
581  void FramedPose::serialize(const ObjectSerializerBasePtr& serializer, const ::Ice::Current& c) const
582  {
583  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
584 
585  Pose::serialize(obj, c);
586  obj->setString("frame", frame);
587  obj->setString("agent", agent);
588  }
589 
590  void FramedPose::deserialize(const ObjectSerializerBasePtr& serializer, const ::Ice::Current& c)
591  {
592  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
593 
594  Pose::deserialize(obj);
595  frame = obj->getString("frame");
596 
597  if (obj->hasElement("agent"))
598  {
599  agent = obj->getString("agent");
600  }
601  }
602 
604  Vector3()
605  {
606  frame = "";
607  }
608 
609  FramedPosition::FramedPosition(const Eigen::Vector3f& v, const std::string& s, const std::string& agent) :
610  Vector3(v)
611  {
612  frame = s;
613  this->agent = agent;
614  }
615 
616  FramedPosition::FramedPosition(const Eigen::Matrix4f& m, const std::string& s, const std::string& agent) :
617  Vector3(m)
618  {
619  frame = s;
620  this->agent = agent;
621  }
622 
623  // this doesnt work for unknown reasons
624  // FramedPosition::FramedPosition(const Vector3BasePtr pos, const std::string &frame )
625  // {
626  // this->x = pos->x;
627  // this->y = pos->y;
628  // this->z = pos->z;
629  // this->frame = frame;
630  // }
631 
632  std::string FramedPosition::getFrame() const
633  {
634  return this->frame;
635  }
636 
637  void FramedPosition::changeFrame(const SharedRobotInterfacePrx& referenceRobot, const std::string& newFrame)
638  {
639  if (newFrame == frame)
640  {
641  return;
642  }
643 
644  if (!referenceRobot->hasRobotNode(newFrame))
645  {
646  throw LocalException() << "The requested frame '" << newFrame << "' does not exists in the robot " << referenceRobot->getName();
647  }
648 
649  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
650  changeFrame(sharedRobot, newFrame);
651  }
652 
653  void FramedPosition::changeFrame(const VirtualRobot::RobotPtr& referenceRobot, const std::string& newFrame)
654  {
655  ARMARX_CHECK_NOT_NULL(referenceRobot);
656  changeFrame(*referenceRobot, newFrame);
657  }
658 
659  void FramedPosition::changeFrame(const VirtualRobot::Robot& referenceRobot, const std::string& newFrame)
660  {
661  if (newFrame == frame)
662  {
663  return;
664  }
665 
666  if (newFrame == GlobalFrame)
667  {
668  changeToGlobal(referenceRobot);
669  return;
670  }
671 
672  if (newFrame.empty())
673  {
674  ARMARX_WARNING_S << "Frame Conversion: Frame is empty, always set frame names! ...assuming GlobalFrame";
675  changeToGlobal(referenceRobot);
676  return;
677  }
678 
679  Eigen::Matrix4f oldFrameTransformation = Eigen::Matrix4f::Identity();
680 
681  if (!referenceRobot.hasRobotNode(newFrame))
682  {
683  throw LocalException() << "The requested frame '" << newFrame << "' does not exists in the robot " << referenceRobot.getName();
684  }
685 
686  if (frame != GlobalFrame)
687  {
688  oldFrameTransformation = referenceRobot.getRobotNode(frame)->getPoseInRootFrame();
689  }
690  else
691  {
692  oldFrameTransformation = referenceRobot.getRootNode()->getGlobalPose().inverse();
693  }
694 
696  oldPose.block<3, 1>(0, 3) = toEigen();
697  Eigen::Matrix4f newPose =
698  (referenceRobot.getRobotNode(newFrame)->getPoseInRootFrame().inverse() * oldFrameTransformation) * oldPose;
699 
700  Eigen::Vector3f pos = newPose.block<3, 1>(0, 3);
701  x = pos[0];
702  y = pos[1];
703  z = pos[2];
704  agent = referenceRobot.getName();
705  frame = newFrame;
706  }
707 
709  {
710  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
711  changeToGlobal(sharedRobot);
712  }
714  {
715  ARMARX_CHECK_NOT_NULL(referenceRobot);
716  changeToGlobal(*referenceRobot);
717  }
719  {
720  if (frame == GlobalFrame)
721  {
722  return;
723  }
724 
725  changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
726  Eigen::Vector3f pos = referenceRobot.getRootNode()->getGlobalPose().block<3, 3>(0, 0) * toEigen()
727  + referenceRobot.getRootNode()->getGlobalPose().block<3, 1>(0, 3);
728  x = pos[0];
729  y = pos[1];
730  z = pos[2];
731  frame = GlobalFrame;
732  agent = "";
733  }
734 
736  {
737  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
738  return toGlobal(sharedRobot);
739  }
741  {
742  ARMARX_CHECK_NOT_NULL(referenceRobot);
743  return toGlobal(*referenceRobot);
744  }
746  {
747  FramedPositionPtr newPosition = FramedPositionPtr::dynamicCast(this->clone());
748  newPosition->changeToGlobal(referenceRobot);
749  return newPosition;
750  }
751 
752  Eigen::Vector3f FramedPosition::toGlobalEigen(const SharedRobotInterfacePrx& referenceRobot) const
753  {
754  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
755  return toGlobalEigen(sharedRobot);
756  }
757  Eigen::Vector3f FramedPosition::toGlobalEigen(const VirtualRobot::RobotPtr& referenceRobot) const
758  {
759  ARMARX_CHECK_NOT_NULL(referenceRobot);
760  return toGlobalEigen(*referenceRobot);
761  }
762  Eigen::Vector3f FramedPosition::toGlobalEigen(const VirtualRobot::Robot& referenceRobot) const
763  {
764  FramedPosition newPosition(toEigen(), frame, agent);
765  newPosition.changeToGlobal(referenceRobot);
766  return newPosition.toEigen();
767  }
768 
770  {
771  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
772  return toRootFrame(sharedRobot);
773  }
775  {
776  ARMARX_CHECK_NOT_NULL(referenceRobot);
777  return toRootFrame(*referenceRobot);
778  }
780  {
781  FramedPositionPtr newPosition = FramedPositionPtr::dynamicCast(this->clone());
782  newPosition->changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
783  return newPosition;
784  }
785 
786  Eigen::Vector3f FramedPosition::toRootEigen(const SharedRobotInterfacePrx& referenceRobot) const
787  {
788  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
789  return toRootEigen(sharedRobot);
790  }
791  Eigen::Vector3f FramedPosition::toRootEigen(const VirtualRobot::RobotPtr& referenceRobot) const
792  {
793  ARMARX_CHECK_NOT_NULL(referenceRobot);
794  return toRootEigen(*referenceRobot);
795  }
796  Eigen::Vector3f FramedPosition::toRootEigen(const VirtualRobot::Robot& referenceRobot) const
797  {
798  FramedPosition newPosition(toEigen(), frame, agent);
799  newPosition.changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
800  return newPosition.toEigen();
801  }
802 
803  std::string FramedPosition::output(const Ice::Current& c) const
804  {
805  std::stringstream s;
806  s << toEigen().format(ArmarXEigenFormat) << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent));
807  return s.str();
808  }
809 
810  void FramedPosition::serialize(const ObjectSerializerBasePtr& serializer, const ::Ice::Current& c) const
811  {
812  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
813 
814  Vector3::serialize(obj, c);
815  obj->setString("frame", frame);
816  obj->setString("agent", agent);
817  }
818 
819  void FramedPosition::deserialize(const ObjectSerializerBasePtr& serializer, const ::Ice::Current& c)
820  {
821  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
822 
824  frame = obj->getString("frame");
825 
826  if (obj->hasElement("agent"))
827  {
828  agent = obj->getString("agent");
829  }
830  }
831 
833  Shared(other),
834  armarx::Serializable(other),
835  Vector3Base(other.x, other.y, other.z),
836  FramedPositionBase(other.x, other.y, other.z, other.frame, other.agent),
837  Vector3(other.x, other.y, other.z)
838  {
839  }
840 
842  {
843  x = other.x;
844  y = other.y;
845  z = other.z;
846  frame = other.frame;
847  agent = other.agent;
848  return *this;
849  }
850 
852  {
853  return this->clone();
854  }
855 
856  VariantDataClassPtr FramedPosition::clone(const Ice::Current& c) const
857  {
858  return new FramedPosition(*this);
859  }
860 
861  VariantTypeId FramedPosition::getType(const Ice::Current& c) const
862  {
864  }
865 
866  bool FramedPosition::validate(const Ice::Current& c)
867  {
868  return true;
869  }
870 
871  std::ostream& operator<<(std::ostream& stream, const FramedPosition& rhs)
872  {
873  stream << "FramedPosition: " << std::endl << rhs.output() << std::endl;
874  return stream;
875  }
876 
877 
879  Quaternion()
880  {
881  frame = "";
882  }
883 
884  FramedOrientation::FramedOrientation(const Eigen::Matrix3f& m, const std::string& s, const std::string& agent) :
885  Quaternion(m)
886  {
887  frame = s;
888  this->agent = agent;
889  }
890 
891  FramedOrientation::FramedOrientation(const Quaternionf& q, const std::string& frame, const std::string& agent):
892  Quaternion(q)
893  {
894  this->frame = frame;
895  this->agent = agent;
896  }
897 
898  FramedOrientation::FramedOrientation(const Eigen::Matrix4f& m, const std::string& s, const std::string& agent) :
899  Quaternion(m)
900  {
901  frame = s;
902  this->agent = agent;
903  }
904 
905  // this doesnt work for an unknown reason
906  // FramedOrientation::FramedOrientation(const QuaternionBasePtr ori, const std::string &frame )
907  // {
908  // Matrix3f rot;
909  // rot = Quaternionf(ori->qw, ori->qx, ori->qy, ori->qz);
910  // FramedOrientation(rot, frame);
911  // }
912 
913  std::string FramedOrientation::getFrame() const
914  {
915  return this->frame;
916  }
917 
918  std::string FramedOrientation::output(const Ice::Current& c) const
919  {
920  std::stringstream s;
921  s << toEigen()/*.format(ArmarXEigenFormat)*/ << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent));
922  return s.str();
923  }
924 
925  void FramedOrientation::changeFrame(const SharedRobotInterfacePrx& referenceRobot, const std::string& newFrame)
926  {
927  if (newFrame == frame)
928  {
929  return;
930  }
931 
932  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
933 
934  changeFrame(sharedRobot, newFrame);
935  }
936 
937  void FramedOrientation::changeFrame(const VirtualRobot::RobotPtr& referenceRobot, const std::string& newFrame)
938  {
939  ARMARX_CHECK_NOT_NULL(referenceRobot);
940  changeFrame(*referenceRobot, newFrame);
941  }
942 
943  void FramedOrientation::changeFrame(const VirtualRobot::Robot& referenceRobot, const std::string& newFrame)
944  {
945  if (newFrame == frame)
946  {
947  return;
948  }
949 
950  if (newFrame == GlobalFrame)
951  {
952  changeToGlobal(referenceRobot);
953  return;
954  }
955 
956  Eigen::Matrix4f oldFrameTransformation = Eigen::Matrix4f::Identity();
957 
958  if (!referenceRobot.hasRobotNode(newFrame))
959  {
960  throw LocalException() << "The requested frame '" << newFrame << "' does not exists in the robot " << referenceRobot.getName();
961  }
962 
963  if (frame != GlobalFrame)
964  {
965  oldFrameTransformation = referenceRobot.getRobotNode(frame)->getPoseInRootFrame();
966  }
967  else
968  {
969  oldFrameTransformation = referenceRobot.getRootNode()->getGlobalPose().inverse();
970  }
971 
973  oldPose.block<3, 3>(0, 0) = toEigen();
974 
975  Eigen::Matrix4f newPose =
976  (referenceRobot.getRobotNode(newFrame)->getPoseInRootFrame().inverse() * oldFrameTransformation) * oldPose;
977 
978  Eigen::Quaternionf quat(newPose.block<3, 3>(0, 0));
979  qw = quat.w();
980  qx = quat.x();
981  qy = quat.y();
982  qz = quat.z();
983  agent = referenceRobot.getName();
984  frame = newFrame;
985  }
986 
988  {
989  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
990  changeToGlobal(sharedRobot);
991  }
992 
994  {
995  ARMARX_CHECK_NOT_NULL(referenceRobot);
996  changeToGlobal(*referenceRobot);
997  }
999  {
1000  if (frame == GlobalFrame)
1001  {
1002  return;
1003  }
1004 
1005  changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
1006  Eigen::Matrix3f rot = referenceRobot.getRootNode()->getGlobalPose().block<3, 3>(0, 0) * toEigen();
1007  Eigen::Quaternionf quat(rot);
1008  qw = quat.w();
1009  qx = quat.x();
1010  qy = quat.y();
1011  qz = quat.z();
1012  frame = GlobalFrame;
1013  agent = "";
1014  }
1015 
1017  {
1018  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1019  return toGlobal(sharedRobot);
1020  }
1022  {
1023  ARMARX_CHECK_NOT_NULL(referenceRobot);
1024  return toGlobal(*referenceRobot);
1025  }
1027  {
1028  FramedOrientationPtr newOrientation = FramedOrientationPtr::dynamicCast(this->clone());
1029  newOrientation->changeToGlobal(referenceRobot);
1030  return newOrientation;
1031  }
1032 
1034  {
1035  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1036  return toGlobalEigen(sharedRobot);
1037  }
1039  {
1040  ARMARX_CHECK_NOT_NULL(referenceRobot);
1041  return toGlobalEigen(*referenceRobot);
1042  }
1044  {
1045  FramedOrientation newOrientation(toEigen(), frame, agent);
1046  newOrientation.changeToGlobal(referenceRobot);
1047  return newOrientation.toEigen();
1048  }
1049 
1051  {
1052  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1053  return toRootFrame(sharedRobot);
1054  }
1056  {
1057  ARMARX_CHECK_NOT_NULL(referenceRobot);
1058  return toRootFrame(*referenceRobot);
1059  }
1061  {
1062  FramedOrientationPtr newOrientation = FramedOrientationPtr::dynamicCast(this->clone());
1063  newOrientation->changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
1064  return newOrientation;
1065  }
1066 
1068  {
1069  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1070  return toRootEigen(sharedRobot);
1071  }
1073  {
1074  ARMARX_CHECK_NOT_NULL(referenceRobot);
1075  return toRootEigen(*referenceRobot);
1076  }
1078  {
1079  FramedOrientation newOrientation(toEigen(), frame, agent);
1080  newOrientation.changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
1081  return newOrientation.toEigen();
1082  }
1083 
1084  void FramedOrientation::serialize(const ObjectSerializerBasePtr& serializer, const ::Ice::Current& c) const
1085  {
1086  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
1087 
1088  Quaternion::serialize(obj, c);
1089  obj->setString("frame", frame);
1090  obj->setString("agent", agent);
1091  }
1092 
1093  void FramedOrientation::deserialize(const ObjectSerializerBasePtr& serializer, const ::Ice::Current& c)
1094  {
1095  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
1096 
1098  frame = obj->getString("frame");
1099 
1100  if (obj->hasElement("agent"))
1101  {
1102  agent = obj->getString("agent");
1103  }
1104  }
1105 
1107  {
1108  return this->clone();
1109  }
1110 
1111  VariantDataClassPtr FramedOrientation::clone(const Ice::Current& c) const
1112  {
1113  return new FramedOrientation(*this);
1114  }
1115 
1116  VariantTypeId FramedOrientation::getType(const Ice::Current& c) const
1117  {
1119  }
1120 
1121  bool FramedOrientation::validate(const Ice::Current& c)
1122  {
1123  return true;
1124  }
1125 
1126  std::ostream& operator<<(std::ostream& stream, const FramedOrientation& rhs)
1127  {
1128  stream << "FramedOrientation: " << std::endl << rhs.output() << std::endl;
1129  return stream;
1130  }
1131 
1132 
1133  VirtualRobot::LinkedCoordinate FramedPose::createLinkedCoordinate(const VirtualRobot::RobotPtr& virtualRobot, const FramedPositionPtr& position, const FramedOrientationPtr& orientation)
1134  {
1135  VirtualRobot::LinkedCoordinate c(virtualRobot);
1136  std::string frame;
1137 
1138  if (position)
1139  {
1140  frame = position->getFrame();
1141 
1142  if (orientation)
1143  {
1144  if (!frame.empty() && frame != orientation->getFrame())
1145  {
1146  throw armarx::UserException("Error: frames mismatch");
1147  }
1148  }
1149  }
1150  else
1151  {
1152  if (!orientation)
1153  {
1154  armarx::UserException("createLinkedCoordinate: orientation and position are both NULL");
1155  }
1156  else
1157  {
1158  frame = orientation->getFrame();
1159  }
1160  }
1161 
1163 
1164  if (orientation)
1165  {
1166  pose.block<3, 3>(0, 0) = orientation->toEigen();
1167  }
1168 
1169  if (position)
1170  {
1171  pose.block<3, 1>(0, 3) = position->toEigen();
1172  }
1173 
1174  c.set(frame, pose);
1175 
1176  return c;
1177  }
1178 
1179  FramedPosePtr FramedPose::toFrame(const SharedRobotInterfacePrx& referenceRobot, const std::string& newFrame) const
1180  {
1181  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1182  return toFrame(sharedRobot, newFrame);
1183  }
1184 
1185  FramedPosePtr FramedPose::toFrame(const VirtualRobot::RobotPtr& referenceRobot, const std::string& newFrame) const
1186  {
1187  FramedPosePtr newPose = FramedPosePtr::dynamicCast(this->clone());
1188  newPose->changeFrame(referenceRobot, newFrame);
1189  return newPose;
1190  }
1191 
1193  FramedPose::toFrameEigen(const SharedRobotInterfacePrx& referenceRobot, const std::string& newFrame) const
1194  {
1195  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1196  return toFrameEigen(sharedRobot, newFrame);
1197  }
1198 
1200  FramedPose::toFrameEigen(const VirtualRobot::RobotPtr& referenceRobot, const std::string& newFrame) const
1201  {
1202  return toFrame(referenceRobot, newFrame)->toEigen();
1203  }
1204 
1206  {
1207  return this->clone();
1208  }
1209 
1210  VariantDataClassPtr FramedPose::clone(const Ice::Current& c) const
1211  {
1212  return new FramedPose(*this);
1213  }
1214 
1215  VariantTypeId FramedPose::getType(const Ice::Current& c) const
1216  {
1217  return VariantType::FramedPose;
1218  }
1219 
1220  bool FramedPose::validate(const Ice::Current& c)
1221  {
1222  return true;
1223  }
1224 
1225  std::ostream& operator<<(std::ostream& stream, const FramedPose& rhs)
1226  {
1227  stream << "FramedPose: " << std::endl << rhs.output() << std::endl;
1228  return stream;
1229  }
1230 
1231  bool operator==(const FramedPose& pose1, const FramedPose& pose2)
1232  {
1233  if (pose1.frame != pose2.frame || pose1.agent != pose2.agent) return false;
1234  return (pose1.toEigen().isApprox(pose2.toEigen()));
1235  }
1236 
1237  bool operator!=(const FramedPose& pose1, const FramedPose& pose2)
1238  {
1239  return !(pose1 == pose2);
1240  }
1241 
1242 
1243 }
armarx::FramedDirection::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:265
RemoteRobot.h
armarx::FramedPose::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:581
Eigen
Definition: Elements.h:36
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:918
armarx::FramedPosition::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:810
armarx::operator!=
bool operator!=(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
Definition: RemoteHandle.h:220
armarx::FramedOrientation::getFrame
std::string getFrame() const
Definition: FramedPose.cpp:913
armarx::FramedPosition::operator=
FramedPosition & operator=(const armarx::FramedPosition &other)
Definition: FramedPose.cpp:841
armarx::FramedPose
The FramedPose class.
Definition: FramedPose.h:258
armarx::VariantType::FramedPose
const VariantTypeId FramedPose
Definition: FramedPose.h:37
armarx::FramedPose::getType
VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1215
armarx::FramedPosition::getFrame
std::string getFrame() const
Definition: FramedPose.cpp:632
armarx::FramedPose::createLinkedCoordinate
static VirtualRobot::LinkedCoordinate createLinkedCoordinate(const VirtualRobot::RobotPtr &virtualRobot, const FramedPositionPtr &position, const FramedOrientationPtr &orientation)
Definition: FramedPose.cpp:1133
ARMARX_CHECK_NOT_NULL
#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...
Definition: ExpressionException.h:206
armarx::FramedPose::toFrame
FramedPosePtr toFrame(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame) const
Definition: FramedPose.cpp:1179
armarx::FramedPose::clone
VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1210
armarx::FramedPose::toFrameEigen
Eigen::Matrix4f toFrameEigen(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame) const
Definition: FramedPose.cpp:1193
armarx::GlobalFrame
const std::string GlobalFrame
Definition: FramedPose.h:62
AbstractObjectSerializer.h
armarx::FramedDirection::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: FramedPose.cpp:320
armarx::FramedDirection::toRootEigen
Eigen::Vector3f toRootEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:248
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::Pose::init
void init()
Definition: Pose.cpp:369
armarx::FramedDirection::getType
VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:330
armarx::Quaternion::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: Pose.cpp:269
armarx::FramedPosition::FramedPosition
FramedPosition()
Definition: FramedPose.cpp:603
armarx::FramedPosition::toRootEigen
Eigen::Vector3f toRootEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:786
IceUtil
Definition: Instance.h:21
armarx::FramedOrientation::toRootFrame
FramedOrientationPtr toRootFrame(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:1050
armarx::FramedPose::toGlobal
FramedPosePtr toGlobal(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:500
armarx::Vector3::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: Pose.cpp:168
armarx::FramedOrientation::getType
VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1116
armarx::FramedPosition::toGlobalEigen
Eigen::Vector3f toGlobalEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:752
armarx::FramedPosition::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: FramedPose.cpp:851
armarx::FramedPosition::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:803
armarx::VariantType::Quaternion
const VariantTypeId Quaternion
Definition: Pose.h:39
armarx::FramedDirection::FramedDirection
FramedDirection()
armarx::FramedPosition::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: FramedPose.cpp:819
armarx::FramedDirection::toRootFrame
FramedDirectionPtr toRootFrame(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:231
armarx::FramedOrientation::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:918
IceInternal::Handle< FramedDirection >
armarx::FramedOrientation::toGlobal
FramedOrientationPtr toGlobal(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:1016
armarx::FramedPosition::clone
VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:856
armarx::FramedPose::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: FramedPose.cpp:1220
armarx::ArmarXEigenFormat
const Eigen::IOFormat ArmarXEigenFormat(Eigen::StreamPrecision, Eigen::DontAlignCols, " ", "\n", "", "")
armarx::FramedDirection::toGlobalEigen
Eigen::Vector3f toGlobalEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:214
armarx::FramedDirection::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:299
armarx::FramedDirection::ChangeFrame
static FramedDirectionPtr ChangeFrame(const VirtualRobot::RobotPtr &robot, const FramedDirection &framedVec, const std::string &newFrame)
Definition: FramedPose.cpp:86
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
armarx::FramedOrientation::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: FramedPose.cpp:1106
armarx::FramedOrientation::toGlobalEigen
Eigen::Matrix3f toGlobalEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:1033
armarx::FramedPose::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:398
armarx::FramedDirection::toGlobal
FramedDirectionPtr toGlobal(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:197
armarx::FramedPose::getPosition
FramedPositionPtr getPosition() const
Definition: FramedPose.cpp:569
armarx::FramedPose::toGlobalEigen
Eigen::Matrix4f toGlobalEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:517
armarx::FramedOrientation::changeToGlobal
void changeToGlobal(const SharedRobotInterfacePrx &referenceRobot)
Definition: FramedPose.cpp:987
armarx::FramedDirection::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: FramedPose.cpp:335
FramedPose.h
armarx::ValueToString
std::string ValueToString(const T &value)
Definition: StringHelpers.h:58
armarx::armem::human::Robot
@ Robot
Definition: util.h:14
armarx::FramedPosition
The FramedPosition class.
Definition: FramedPose.h:142
armarx::FramedOrientation::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1084
armarx::FramedPosition::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: FramedPose.cpp:866
armarx::Vector3
The Vector3 class.
Definition: Pose.h:112
armarx::Pose::toEigen
virtual Eigen::Matrix4f toEigen() const
Definition: Pose.cpp:334
armarx::Pose::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: Pose.cpp:353
armarx::FramedPose::FramedPose
FramedPose()
Definition: FramedPose.cpp:347
armarx::FramedOrientation::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: FramedPose.cpp:1121
armarx::FramedDirection::getFrame
std::string getFrame() const
Definition: FramedPose.cpp:81
armarx::operator==
bool operator==(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
Definition: RemoteHandle.h:216
armarx::FramedPosition::changeToGlobal
void changeToGlobal(const SharedRobotInterfacePrx &referenceRobot)
Definition: FramedPose.cpp:708
armarx::Pose::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: Pose.cpp:360
armarx::FramedOrientation
The FramedOrientation class.
Definition: FramedPose.h:199
armarx::VariantTypeId
Ice::Int VariantTypeId
Definition: Variant.h:44
armarx::FramedPosition::changeFrame
void changeFrame(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame)
Definition: FramedPose.cpp:637
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:681
armarx::Quaternion::toEigen
Eigen::Matrix3f toEigen() const
Definition: Pose.cpp:204
q
#define q
ARMARX_WARNING_S
#define ARMARX_WARNING_S
Definition: Logging.h:206
armarx::FramedPosition::getType
VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:861
armarx::FramedDirection::clone
VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:325
armarx::FramedPose::toRootEigen
Eigen::Matrix4f toRootEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:551
ExpressionException.h
armarx::FramedPosition::toRootFrame
FramedPositionPtr toRootFrame(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:769
armarx::Pose
The Pose class.
Definition: Pose.h:242
armarx::RemoteRobot
Mimics the behaviour of the VirtualRobot::Robot class while redirecting everything to an Ice proxy.
Definition: RemoteRobot.h:139
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:600
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
ARMARX_CHECK_EXPRESSION
#define ARMARX_CHECK_EXPRESSION(expression)
This macro evaluates the expression and if it turns out to be false it will throw an ExpressionExcept...
Definition: ExpressionException.h:73
armarx::FramedDirection::changeToGlobal
void changeToGlobal(const SharedRobotInterfacePrx &referenceRobot)
Definition: FramedPose.cpp:169
armarx::VariantType::FramedOrientation
const VariantTypeId FramedOrientation
Definition: FramedPose.h:40
armarx::FramedDirection
FramedDirection is a 3 dimensional direction vector with a reference frame. The reference frame can b...
Definition: FramedPose.h:83
armarx::VariantType::FramedDirection
const VariantTypeId FramedDirection
Definition: FramedPose.h:38
armarx::FramedPose::getOrientation
FramedOrientationPtr getOrientation() const
Definition: FramedPose.cpp:575
armarx::Vector3::toEigen
virtual Eigen::Vector3f toEigen() const
Definition: Pose.cpp:134
armarx::Quaternion< float, 0 >
memoryx::KBM::Vector3
Eigen::Vector3d Vector3
Definition: kbm.h:41
IceInternal::ProxyHandle< ::IceProxy::armarx::SharedRobotInterface >
armarx::operator<<
std::ostream & operator<<(std::ostream &os, const PythonApplicationManager::Paths &paths)
Definition: PythonApplicationManager.cpp:221
armarx::Vector3::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: Pose.cpp:158
armarx::FramedPose::toRootFrame
FramedPosePtr toRootFrame(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:534
armarx::FramedOrientation::FramedOrientation
FramedOrientation()
Definition: FramedPose.cpp:878
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
armarx::FramedPose::getFrame
std::string getFrame() const
Definition: FramedPose.cpp:393
Logging.h
armarx::FramedDirection::changeFrame
void changeFrame(const VirtualRobot::RobotPtr &robot, const std::string &newFrame)
Definition: FramedPose.cpp:119
armarx::VariantType::FramedPosition
const VariantTypeId FramedPosition
Definition: FramedPose.h:39
armarx::FramedPose::changeToGlobal
void changeToGlobal(const SharedRobotInterfacePrx &referenceRobot)
Definition: FramedPose.cpp:467
armarx::FramedPose::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: FramedPose.cpp:1205
armarx::FramedOrientation::clone
VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1111
armarx::FramedPosition::toGlobal
FramedPositionPtr toGlobal(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:735
armarx::FramedPose::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: FramedPose.cpp:590
armarx::FramedOrientation::toRootEigen
Eigen::Matrix3f toRootEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:1067
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
armarx::FramedOrientation::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: FramedPose.cpp:1093
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::FramedOrientation::changeFrame
void changeFrame(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame)
Definition: FramedPose.cpp:925
armarx::FramedPose::changeFrame
void changeFrame(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame)
Definition: FramedPose.cpp:406
armarx::Quaternion::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: Pose.cpp:258
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
armarx::FramedDirection::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: FramedPose.cpp:308