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 
26 #include <Eigen/Core>
27 #include <Eigen/Geometry>
28 
29 #include <VirtualRobot/LinkedCoordinate.h>
30 #include <VirtualRobot/Robot.h>
31 #include <VirtualRobot/RobotConfig.h>
32 #include <VirtualRobot/VirtualRobot.h>
33 
37 
40 
41 
42 using namespace Eigen;
43 
44 template class ::IceInternal::Handle<::armarx::FramedPose>;
45 template class ::IceInternal::Handle<::armarx::FramedPosition>;
46 template class ::IceInternal::Handle<::armarx::FramedDirection>;
47 template class ::IceInternal::Handle<::armarx::FramedOrientation>;
48 
49 namespace armarx
50 {
51 
52 
54 
56  IceUtil::Shared(source),
57  armarx::Serializable(source),
58  Vector3Base(source),
59  FramedDirectionBase(source),
61  {
62  }
63 
64  FramedDirection::FramedDirection(const Eigen::Vector3f& vec,
65  const std::string& frame,
66  const std::string& agent) :
67  Vector3(vec)
68  {
69  this->frame = frame;
70  this->agent = agent;
71  }
72 
74  ::Ice::Float y,
75  ::Ice::Float z,
76  const std::string& frame,
77  const std::string& agent) :
78  Vector3(x, y, z)
79  {
80  this->frame = frame;
81  this->agent = agent;
82  }
83 
84  std::string
86  {
87  return frame;
88  }
89 
92  const FramedDirection& framedVec,
93  const std::string& newFrame)
94  {
95  ARMARX_CHECK_NOT_NULL(robot);
96  return ChangeFrame(*robot, framedVec, newFrame);
97  }
98 
101  const FramedDirection& framedVec,
102  const std::string& newFrame)
103  {
104  if (framedVec.getFrame() == newFrame)
105  {
106  return FramedDirectionPtr::dynamicCast(framedVec.clone());
107  }
108 
109  if (!robot.hasRobotNode(newFrame))
110  {
111  throw LocalException() << "The requested frame '" << newFrame
112  << "' does not exists in the robot " << robot.getName();
113  }
114 
115  Eigen::Matrix4f rotToNewFrame =
116  __GetRotationBetweenFrames(framedVec.frame, newFrame, robot);
117 
118  Eigen::Vector3f vecOldFrame = framedVec.Vector3::toEigen();
119 
120  Eigen::Vector3f newVec = rotToNewFrame.block(0, 0, 3, 3).inverse() * vecOldFrame;
121 
122  FramedDirectionPtr result = new FramedDirection();
123  result->x = newVec(0);
124  result->y = newVec(1);
125  result->z = newVec(2);
126  result->frame = newFrame;
127  result->agent = robot.getName();
128  return result;
129  }
130 
131  void
132  FramedDirection::changeFrame(const VirtualRobot::RobotPtr& robot, const std::string& newFrame)
133  {
134  ARMARX_CHECK_NOT_NULL(robot);
135  changeFrame(*robot, newFrame);
136  }
137 
138  void
139  FramedDirection::changeFrame(const VirtualRobot::Robot& robot, const std::string& newFrame)
140  {
141  if (frame == "")
142  {
143  frame = GlobalFrame;
144  }
145 
146 
147  if (getFrame() == newFrame)
148  {
149  return;
150  }
151 
152  if (newFrame == GlobalFrame)
153  {
154  changeToGlobal(robot);
155  return;
156  }
157 
158  if (!robot.hasRobotNode(newFrame))
159  {
160  throw LocalException() << "The requested frame '" << newFrame
161  << "' does not exist in the robot " << robot.getName();
162  }
163 
164  if (frame != GlobalFrame && !robot.hasRobotNode(frame))
165  {
166  throw LocalException() << "The current frame '" << frame
167  << "' does not exist in the robot " << robot.getName();
168  }
169 
170 
171  Eigen::Matrix4f rotToNewFrame = __GetRotationBetweenFrames(frame, newFrame, robot);
172 
173  Eigen::Vector3f vecOldFrame = Vector3::toEigen();
174 
175  Eigen::Vector3f newVec = rotToNewFrame.block(0, 0, 3, 3).inverse() * vecOldFrame;
176 
177 
178  x = newVec(0);
179  y = newVec(1);
180  z = newVec(2);
181  frame = newFrame;
182  agent = robot.getName();
183  }
184 
185  void
187  {
188  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
189  changeToGlobal(sharedRobot);
190  }
191 
192  void
194  {
195  ARMARX_CHECK_NOT_NULL(referenceRobot);
196  changeToGlobal(*referenceRobot);
197  }
198 
199  void
201  {
202  if (frame == GlobalFrame)
203  {
204  return;
205  }
206 
207  changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
208  Eigen::Vector3f pos =
209  referenceRobot.getRootNode()->getGlobalPose().block<3, 3>(0, 0) * toEigen();
210  x = pos[0];
211  y = pos[1];
212  z = pos[2];
213  frame = GlobalFrame;
214  agent = "";
215  }
216 
219  {
220  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
221  return toGlobal(sharedRobot);
222  }
223 
226  {
227  ARMARX_CHECK_NOT_NULL(referenceRobot);
228  return toGlobal(*referenceRobot);
229  }
230 
232  FramedDirection::toGlobal(const VirtualRobot::Robot& referenceRobot) const
233  {
234  FramedDirectionPtr newDirection = FramedDirectionPtr::dynamicCast(this->clone());
235  newDirection->changeToGlobal(referenceRobot);
236  return newDirection;
237  }
238 
239  Eigen::Vector3f
241  {
242  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
243  return toGlobalEigen(sharedRobot);
244  }
245 
246  Eigen::Vector3f
248  {
249  ARMARX_CHECK_NOT_NULL(referenceRobot);
250  return toGlobalEigen(*referenceRobot);
251  }
252 
253  Eigen::Vector3f
255  {
256  FramedDirection newDirection(toEigen(), frame, agent);
257  newDirection.changeToGlobal(referenceRobot);
258  return newDirection.toEigen();
259  }
260 
263  {
264  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
265  return toRootFrame(sharedRobot);
266  }
267 
270  {
271  ARMARX_CHECK_NOT_NULL(referenceRobot);
272  return toRootFrame(*referenceRobot);
273  }
274 
277  {
278  FramedDirectionPtr newDirection = FramedDirectionPtr::dynamicCast(this->clone());
279  newDirection->changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
280  return newDirection;
281  }
282 
283  Eigen::Vector3f
285  {
286  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
287  return toRootEigen(sharedRobot);
288  }
289 
290  Eigen::Vector3f
292  {
293  ARMARX_CHECK_NOT_NULL(referenceRobot);
294  return toRootEigen(*referenceRobot);
295  }
296 
297  Eigen::Vector3f
299  {
300  FramedDirection newDirection(toEigen(), frame, agent);
301  newDirection.changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
302  return newDirection.toEigen();
303  }
304 
305  std::string
306  FramedDirection::output(const Ice::Current& c) const
307  {
308  std::stringstream s;
309  s << toEigen().format(ArmarXEigenFormat) << std::endl
310  << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent));
311  return s.str();
312  }
313 
315  FramedDirection::__GetRotationBetweenFrames(const std::string& oldFrame,
316  const std::string& newFrame,
317  const VirtualRobot::Robot& robotState)
318  {
319  Eigen::Matrix4f toNewFrame;
320 
321  if (oldFrame == GlobalFrame)
322  {
323  auto node = robotState.getRobotNode(newFrame);
324  ARMARX_CHECK_EXPRESSION(node) << newFrame;
325  toNewFrame = node->getGlobalPose();
326  }
327  else
328  {
329  auto node = robotState.getRobotNode(oldFrame);
331  << "old frame: " + oldFrame +
332  ValueToString(robotState.getConfig()->getRobotNodeJointValueMap());
333  auto newNode = robotState.getRobotNode(newFrame);
334  ARMARX_CHECK_EXPRESSION(newNode) << newFrame;
335  toNewFrame = node->getTransformationTo(newNode);
336  }
337 
338  toNewFrame(0, 3) = 0;
339  toNewFrame(1, 3) = 0;
340  toNewFrame(2, 3) = 0;
341 
342  return toNewFrame;
343  }
344 
345  void
346  FramedDirection::serialize(const ObjectSerializerBasePtr& serializer, const Ice::Current&) const
347  {
348  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
349  Vector3::serialize(serializer);
350  obj->setString("frame", frame);
351  obj->setString("agent", agent);
352  }
353 
354  void
355  FramedDirection::deserialize(const ObjectSerializerBasePtr& serializer, const Ice::Current&)
356  {
357  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
358  Vector3::deserialize(serializer);
359  frame = obj->getString("frame");
360 
361  if (obj->hasElement("agent"))
362  {
363  agent = obj->getString("agent");
364  }
365  }
366 
369  {
370  return this->clone();
371  }
372 
373  VariantDataClassPtr
374  FramedDirection::clone(const Ice::Current& c) const
375  {
376  return new FramedDirection(*this);
377  }
378 
380  FramedDirection::getType(const Ice::Current& c) const
381  {
383  }
384 
385  bool
386  FramedDirection::validate(const Ice::Current& c)
387  {
388  return true;
389  }
390 
391  std::ostream&
392  operator<<(std::ostream& stream, const FramedDirection& rhs)
393  {
394  stream << "FramedDirection: " << std::endl << rhs.output() << std::endl;
395  return stream;
396  }
397 
399  {
400  frame = "";
401  }
402 
404  IceUtil::Shared(pose),
405  armarx::Serializable(pose),
406  armarx::VariantDataClass(pose),
407  PoseBase(pose),
408  FramedPoseBase(pose),
409  Pose(pose)
410  {
411  }
412 
414  const Eigen::Vector3f& v,
415  const std::string& s,
416  const std::string& agent) :
417  Pose(m, v)
418  {
419  frame = s;
420  this->agent = agent;
421  }
422 
424  const std::string& s,
425  const std::string& agent) :
426  Pose(m)
427  {
428  frame = s;
429  this->agent = agent;
430  }
431 
432  FramedPose::FramedPose(const armarx::Vector3BasePtr pos,
433  const armarx::QuaternionBasePtr ori,
434  const std::string& frame,
435  const std::string& agent) :
436  Pose(pos, ori)
437  {
438  this->frame = frame;
439  this->agent = agent;
440  }
441 
442  FramedPose::FramedPose(const Eigen::Vector3f& pos,
443  const Eigen::Quaternionf& ori,
444  const std::string& frame,
445  const std::string& agent) :
446  Pose(pos, ori)
447  {
448  this->frame = frame;
449  this->agent = agent;
450  }
451 
452  std::string
454  {
455  return frame;
456  }
457 
458  std::string
459  FramedPose::output(const Ice::Current& c) const
460  {
461  std::stringstream s;
462  const Eigen::IOFormat ArmarXEigenFormat(Eigen::StreamPrecision, 4, " ", "\n", "", "");
463  s << toEigen().format(ArmarXEigenFormat) << std::endl
464  << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent));
465  return s.str();
466  }
467 
468  void
470  const std::string& newFrame)
471  {
472  if (newFrame == frame)
473  {
474  return;
475  }
476 
477  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
478  changeFrame(sharedRobot, newFrame);
479  }
480 
481  void
483  const std::string& newFrame)
484  {
485  ARMARX_CHECK_NOT_NULL(referenceRobot);
486  changeFrame(*referenceRobot, newFrame);
487  }
488 
489  void
490  FramedPose::changeFrame(const VirtualRobot::Robot& referenceRobot, const std::string& newFrame)
491  {
492  if (newFrame == frame)
493  {
494  return;
495  }
496 
497  if (newFrame == GlobalFrame)
498  {
499  changeToGlobal(referenceRobot);
500  return;
501  }
502 
503  Eigen::Matrix4f oldFrameTransformation = Eigen::Matrix4f::Identity();
504 
505  if (frame != GlobalFrame and !referenceRobot.hasRobotNode(frame))
506  {
507  throw LocalException() << "The current frame '" << frame
508  << "' does not exists in the robot " << referenceRobot.getName();
509  }
510  if (!referenceRobot.hasRobotNode(newFrame))
511  {
512  throw LocalException() << "The requested frame '" << newFrame
513  << "' does not exists in the robot " << referenceRobot.getName();
514  }
515 
516  if (frame != GlobalFrame)
517  {
518  oldFrameTransformation = referenceRobot.getRobotNode(frame)->getPoseInRootFrame();
519  }
520  else
521  {
522  oldFrameTransformation = referenceRobot.getRootNode()->getGlobalPose().inverse();
523  }
524 
525  Eigen::Matrix4f newPose =
526  (referenceRobot.getRobotNode(newFrame)->getPoseInRootFrame().inverse() *
527  oldFrameTransformation) *
528  toEigen();
529 
530  orientation = new Quaternion(newPose);
531  Eigen::Vector3f pos = newPose.block<3, 1>(0, 3);
532  position = new Vector3(pos);
533  frame = newFrame;
534  agent = referenceRobot.getName();
535  init();
536  }
537 
538  void
540  {
541  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
542  changeToGlobal(sharedRobot);
543  }
544 
545  void
547  {
548  ARMARX_CHECK_NOT_NULL(referenceRobot);
549  changeToGlobal(*referenceRobot);
550  }
551 
552  void
554  {
555  if (frame == GlobalFrame)
556  {
557  return;
558  }
559 
560  changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
561  Eigen::Matrix4f global = referenceRobot.getRootNode()->getGlobalPose();
562  const Eigen::Matrix4f pose = global * toEigen();
563  position->x = pose(0, 3);
564  position->y = pose(1, 3);
565  position->z = pose(2, 3);
566  Eigen::Quaternionf q(pose.block<3, 3>(0, 0));
567  orientation->qw = q.w();
568  orientation->qx = q.x();
569  orientation->qy = q.y();
570  orientation->qz = q.z();
571  frame = GlobalFrame;
572  agent = "";
573  }
574 
576  FramedPose::toGlobal(const SharedRobotInterfacePrx& referenceRobot) const
577  {
578  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
579  return toGlobal(sharedRobot);
580  }
581 
583  FramedPose::toGlobal(const VirtualRobot::RobotPtr& referenceRobot) const
584  {
585  ARMARX_CHECK_NOT_NULL(referenceRobot);
586  return toGlobal(*referenceRobot);
587  }
588 
590  FramedPose::toGlobal(const VirtualRobot::Robot& referenceRobot) const
591  {
592  FramedPosePtr newPose = FramedPosePtr::dynamicCast(this->clone());
593  newPose->changeToGlobal(referenceRobot);
594  return newPose;
595  }
596 
599  {
600  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
601  return toGlobalEigen(sharedRobot);
602  }
603 
606  {
607  ARMARX_CHECK_NOT_NULL(referenceRobot);
608  return toGlobalEigen(*referenceRobot);
609  }
610 
612  FramedPose::toGlobalEigen(const VirtualRobot::Robot& referenceRobot) const
613  {
614  FramedPose newPose(toEigen(), frame, agent);
615  newPose.changeToGlobal(referenceRobot);
616  return newPose.toEigen();
617  }
618 
621  {
622  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
623  return toRootFrame(sharedRobot);
624  }
625 
627  FramedPose::toRootFrame(const VirtualRobot::RobotPtr& referenceRobot) const
628  {
629  ARMARX_CHECK_NOT_NULL(referenceRobot);
630  return toRootFrame(*referenceRobot);
631  }
632 
634  FramedPose::toRootFrame(const VirtualRobot::Robot& referenceRobot) const
635  {
636  FramedPosePtr newPose = FramedPosePtr::dynamicCast(this->clone());
637  newPose->changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
638  return newPose;
639  }
640 
643  {
644  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
645  return toRootEigen(sharedRobot);
646  }
647 
649  FramedPose::toRootEigen(const VirtualRobot::RobotPtr& referenceRobot) const
650  {
651  ARMARX_CHECK_NOT_NULL(referenceRobot);
652  return toRootEigen(*referenceRobot);
653  }
654 
656  FramedPose::toRootEigen(const VirtualRobot::Robot& referenceRobot) const
657  {
658  FramedPose newPose(toEigen(), frame, agent);
659  newPose.changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
660  return newPose.toEigen();
661  }
662 
665  {
666  FramedPositionPtr result =
667  new FramedPosition(Vector3Ptr::dynamicCast(position)->toEigen(), frame, agent);
668  return result;
669  }
670 
673  {
675  QuaternionPtr::dynamicCast(this->orientation)->toEigen(), frame, agent);
676  return result;
677  }
678 
679  void
680  FramedPose::serialize(const ObjectSerializerBasePtr& serializer, const ::Ice::Current& c) const
681  {
682  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
683 
684  Pose::serialize(obj, c);
685  obj->setString("frame", frame);
686  obj->setString("agent", agent);
687  }
688 
689  void
690  FramedPose::deserialize(const ObjectSerializerBasePtr& serializer, const ::Ice::Current& c)
691  {
692  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
693 
694  Pose::deserialize(obj);
695  frame = obj->getString("frame");
696 
697  if (obj->hasElement("agent"))
698  {
699  agent = obj->getString("agent");
700  }
701  }
702 
704  {
705  frame = "";
706  }
707 
708  FramedPosition::FramedPosition(const Eigen::Vector3f& v,
709  const std::string& s,
710  const std::string& agent) :
711  Vector3(v)
712  {
713  frame = s;
714  this->agent = agent;
715  }
716 
718  const std::string& s,
719  const std::string& agent) :
720  Vector3(m)
721  {
722  frame = s;
723  this->agent = agent;
724  }
725 
726  // this doesnt work for unknown reasons
727  // FramedPosition::FramedPosition(const Vector3BasePtr pos, const std::string &frame )
728  // {
729  // this->x = pos->x;
730  // this->y = pos->y;
731  // this->z = pos->z;
732  // this->frame = frame;
733  // }
734 
735  std::string
737  {
738  return this->frame;
739  }
740 
741  void
743  const std::string& newFrame)
744  {
745  if (newFrame == frame)
746  {
747  return;
748  }
749 
750  if (!referenceRobot->hasRobotNode(newFrame))
751  {
752  throw LocalException()
753  << "The requested frame '" << newFrame << "' does not exists in the robot "
754  << referenceRobot->getName();
755  }
756 
757  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
758  changeFrame(sharedRobot, newFrame);
759  }
760 
761  void
763  const std::string& newFrame)
764  {
765  ARMARX_CHECK_NOT_NULL(referenceRobot);
766  changeFrame(*referenceRobot, newFrame);
767  }
768 
769  void
771  const std::string& newFrame)
772  {
773  if (newFrame == frame)
774  {
775  return;
776  }
777 
778  if (newFrame == GlobalFrame)
779  {
780  changeToGlobal(referenceRobot);
781  return;
782  }
783 
784  if (newFrame.empty())
785  {
786  ARMARX_WARNING_S << "Frame Conversion: Frame is empty, always set frame names! "
787  "...assuming GlobalFrame";
788  changeToGlobal(referenceRobot);
789  return;
790  }
791 
792  Eigen::Matrix4f oldFrameTransformation = Eigen::Matrix4f::Identity();
793 
794  if (!referenceRobot.hasRobotNode(newFrame))
795  {
796  throw LocalException() << "The requested frame '" << newFrame
797  << "' does not exists in the robot " << referenceRobot.getName();
798  }
799 
800  if (frame != GlobalFrame)
801  {
802  oldFrameTransformation = referenceRobot.getRobotNode(frame)->getPoseInRootFrame();
803  }
804  else
805  {
806  oldFrameTransformation = referenceRobot.getRootNode()->getGlobalPose().inverse();
807  }
808 
810  oldPose.block<3, 1>(0, 3) = toEigen();
811  Eigen::Matrix4f newPose =
812  (referenceRobot.getRobotNode(newFrame)->getPoseInRootFrame().inverse() *
813  oldFrameTransformation) *
814  oldPose;
815 
816  Eigen::Vector3f pos = newPose.block<3, 1>(0, 3);
817  x = pos[0];
818  y = pos[1];
819  z = pos[2];
820  agent = referenceRobot.getName();
821  frame = newFrame;
822  }
823 
824  void
826  {
827  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
828  changeToGlobal(sharedRobot);
829  }
830 
831  void
833  {
834  ARMARX_CHECK_NOT_NULL(referenceRobot);
835  changeToGlobal(*referenceRobot);
836  }
837 
838  void
840  {
841  if (frame == GlobalFrame)
842  {
843  return;
844  }
845 
846  changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
847  Eigen::Vector3f pos =
848  referenceRobot.getRootNode()->getGlobalPose().block<3, 3>(0, 0) * toEigen() +
849  referenceRobot.getRootNode()->getGlobalPose().block<3, 1>(0, 3);
850  x = pos[0];
851  y = pos[1];
852  z = pos[2];
853  frame = GlobalFrame;
854  agent = "";
855  }
856 
859  {
860  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
861  return toGlobal(sharedRobot);
862  }
863 
866  {
867  ARMARX_CHECK_NOT_NULL(referenceRobot);
868  return toGlobal(*referenceRobot);
869  }
870 
872  FramedPosition::toGlobal(const VirtualRobot::Robot& referenceRobot) const
873  {
874  FramedPositionPtr newPosition = FramedPositionPtr::dynamicCast(this->clone());
875  newPosition->changeToGlobal(referenceRobot);
876  return newPosition;
877  }
878 
879  Eigen::Vector3f
881  {
882  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
883  return toGlobalEigen(sharedRobot);
884  }
885 
886  Eigen::Vector3f
888  {
889  ARMARX_CHECK_NOT_NULL(referenceRobot);
890  return toGlobalEigen(*referenceRobot);
891  }
892 
893  Eigen::Vector3f
895  {
896  FramedPosition newPosition(toEigen(), frame, agent);
897  newPosition.changeToGlobal(referenceRobot);
898  return newPosition.toEigen();
899  }
900 
903  {
904  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
905  return toRootFrame(sharedRobot);
906  }
907 
910  {
911  ARMARX_CHECK_NOT_NULL(referenceRobot);
912  return toRootFrame(*referenceRobot);
913  }
914 
917  {
918  FramedPositionPtr newPosition = FramedPositionPtr::dynamicCast(this->clone());
919  newPosition->changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
920  return newPosition;
921  }
922 
923  Eigen::Vector3f
925  {
926  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
927  return toRootEigen(sharedRobot);
928  }
929 
930  Eigen::Vector3f
932  {
933  ARMARX_CHECK_NOT_NULL(referenceRobot);
934  return toRootEigen(*referenceRobot);
935  }
936 
937  Eigen::Vector3f
939  {
940  FramedPosition newPosition(toEigen(), frame, agent);
941  newPosition.changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
942  return newPosition.toEigen();
943  }
944 
945  std::string
946  FramedPosition::output(const Ice::Current& c) const
947  {
948  std::stringstream s;
949  s << toEigen().format(ArmarXEigenFormat) << std::endl
950  << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent));
951  return s.str();
952  }
953 
954  void
955  FramedPosition::serialize(const ObjectSerializerBasePtr& serializer,
956  const ::Ice::Current& c) const
957  {
958  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
959 
960  Vector3::serialize(obj, c);
961  obj->setString("frame", frame);
962  obj->setString("agent", agent);
963  }
964 
965  void
966  FramedPosition::deserialize(const ObjectSerializerBasePtr& serializer, const ::Ice::Current& c)
967  {
968  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
969 
971  frame = obj->getString("frame");
972 
973  if (obj->hasElement("agent"))
974  {
975  agent = obj->getString("agent");
976  }
977  }
978 
980  Shared(other),
981  armarx::Serializable(other),
982  Vector3Base(other.x, other.y, other.z),
983  FramedPositionBase(other.x, other.y, other.z, other.frame, other.agent),
984  Vector3(other.x, other.y, other.z)
985  {
986  }
987 
990  {
991  x = other.x;
992  y = other.y;
993  z = other.z;
994  frame = other.frame;
995  agent = other.agent;
996  return *this;
997  }
998 
1001  {
1002  return this->clone();
1003  }
1004 
1005  VariantDataClassPtr
1006  FramedPosition::clone(const Ice::Current& c) const
1007  {
1008  return new FramedPosition(*this);
1009  }
1010 
1012  FramedPosition::getType(const Ice::Current& c) const
1013  {
1015  }
1016 
1017  bool
1018  FramedPosition::validate(const Ice::Current& c)
1019  {
1020  return true;
1021  }
1022 
1023  std::ostream&
1024  operator<<(std::ostream& stream, const FramedPosition& rhs)
1025  {
1026  stream << "FramedPosition: " << std::endl << rhs.output() << std::endl;
1027  return stream;
1028  }
1029 
1031  {
1032  frame = "";
1033  }
1034 
1036  const std::string& s,
1037  const std::string& agent) :
1038  Quaternion(m)
1039  {
1040  frame = s;
1041  this->agent = agent;
1042  }
1043 
1045  const std::string& frame,
1046  const std::string& agent) :
1047  Quaternion(q)
1048  {
1049  this->frame = frame;
1050  this->agent = agent;
1051  }
1052 
1054  const std::string& s,
1055  const std::string& agent) :
1056  Quaternion(m)
1057  {
1058  frame = s;
1059  this->agent = agent;
1060  }
1061 
1062  // this doesnt work for an unknown reason
1063  // FramedOrientation::FramedOrientation(const QuaternionBasePtr ori, const std::string &frame )
1064  // {
1065  // Matrix3f rot;
1066  // rot = Quaternionf(ori->qw, ori->qx, ori->qy, ori->qz);
1067  // FramedOrientation(rot, frame);
1068  // }
1069 
1070  std::string
1072  {
1073  return this->frame;
1074  }
1075 
1076  std::string
1077  FramedOrientation::output(const Ice::Current& c) const
1078  {
1079  std::stringstream s;
1080  s << toEigen() /*.format(ArmarXEigenFormat)*/ << std::endl
1081  << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent));
1082  return s.str();
1083  }
1084 
1085  void
1087  const std::string& newFrame)
1088  {
1089  if (newFrame == frame)
1090  {
1091  return;
1092  }
1093 
1094  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1095 
1096  changeFrame(sharedRobot, newFrame);
1097  }
1098 
1099  void
1101  const std::string& newFrame)
1102  {
1103  ARMARX_CHECK_NOT_NULL(referenceRobot);
1104  changeFrame(*referenceRobot, newFrame);
1105  }
1106 
1107  void
1109  const std::string& newFrame)
1110  {
1111  if (newFrame == frame)
1112  {
1113  return;
1114  }
1115 
1116  if (newFrame == GlobalFrame)
1117  {
1118  changeToGlobal(referenceRobot);
1119  return;
1120  }
1121 
1122  Eigen::Matrix4f oldFrameTransformation = Eigen::Matrix4f::Identity();
1123 
1124  if (!referenceRobot.hasRobotNode(newFrame))
1125  {
1126  throw LocalException() << "The requested frame '" << newFrame
1127  << "' does not exists in the robot " << referenceRobot.getName();
1128  }
1129 
1130  if (frame != GlobalFrame)
1131  {
1132  oldFrameTransformation = referenceRobot.getRobotNode(frame)->getPoseInRootFrame();
1133  }
1134  else
1135  {
1136  oldFrameTransformation = referenceRobot.getRootNode()->getGlobalPose().inverse();
1137  }
1138 
1140  oldPose.block<3, 3>(0, 0) = toEigen();
1141 
1142  Eigen::Matrix4f newPose =
1143  (referenceRobot.getRobotNode(newFrame)->getPoseInRootFrame().inverse() *
1144  oldFrameTransformation) *
1145  oldPose;
1146 
1147  Eigen::Quaternionf quat(newPose.block<3, 3>(0, 0));
1148  qw = quat.w();
1149  qx = quat.x();
1150  qy = quat.y();
1151  qz = quat.z();
1152  agent = referenceRobot.getName();
1153  frame = newFrame;
1154  }
1155 
1156  void
1158  {
1159  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1160  changeToGlobal(sharedRobot);
1161  }
1162 
1163  void
1165  {
1166  ARMARX_CHECK_NOT_NULL(referenceRobot);
1167  changeToGlobal(*referenceRobot);
1168  }
1169 
1170  void
1172  {
1173  if (frame == GlobalFrame)
1174  {
1175  return;
1176  }
1177 
1178  changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
1179  Eigen::Matrix3f rot =
1180  referenceRobot.getRootNode()->getGlobalPose().block<3, 3>(0, 0) * toEigen();
1181  Eigen::Quaternionf quat(rot);
1182  qw = quat.w();
1183  qx = quat.x();
1184  qy = quat.y();
1185  qz = quat.z();
1186  frame = GlobalFrame;
1187  agent = "";
1188  }
1189 
1192  {
1193  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1194  return toGlobal(sharedRobot);
1195  }
1196 
1199  {
1200  ARMARX_CHECK_NOT_NULL(referenceRobot);
1201  return toGlobal(*referenceRobot);
1202  }
1203 
1206  {
1207  FramedOrientationPtr newOrientation = FramedOrientationPtr::dynamicCast(this->clone());
1208  newOrientation->changeToGlobal(referenceRobot);
1209  return newOrientation;
1210  }
1211 
1214  {
1215  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1216  return toGlobalEigen(sharedRobot);
1217  }
1218 
1221  {
1222  ARMARX_CHECK_NOT_NULL(referenceRobot);
1223  return toGlobalEigen(*referenceRobot);
1224  }
1225 
1228  {
1229  FramedOrientation newOrientation(toEigen(), frame, agent);
1230  newOrientation.changeToGlobal(referenceRobot);
1231  return newOrientation.toEigen();
1232  }
1233 
1236  {
1237  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1238  return toRootFrame(sharedRobot);
1239  }
1240 
1243  {
1244  ARMARX_CHECK_NOT_NULL(referenceRobot);
1245  return toRootFrame(*referenceRobot);
1246  }
1247 
1250  {
1251  FramedOrientationPtr newOrientation = FramedOrientationPtr::dynamicCast(this->clone());
1252  newOrientation->changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
1253  return newOrientation;
1254  }
1255 
1258  {
1259  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1260  return toRootEigen(sharedRobot);
1261  }
1262 
1265  {
1266  ARMARX_CHECK_NOT_NULL(referenceRobot);
1267  return toRootEigen(*referenceRobot);
1268  }
1269 
1272  {
1273  FramedOrientation newOrientation(toEigen(), frame, agent);
1274  newOrientation.changeFrame(referenceRobot, referenceRobot.getRootNode()->getName());
1275  return newOrientation.toEigen();
1276  }
1277 
1278  void
1279  FramedOrientation::serialize(const ObjectSerializerBasePtr& serializer,
1280  const ::Ice::Current& c) const
1281  {
1282  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
1283 
1284  Quaternion::serialize(obj, c);
1285  obj->setString("frame", frame);
1286  obj->setString("agent", agent);
1287  }
1288 
1289  void
1290  FramedOrientation::deserialize(const ObjectSerializerBasePtr& serializer,
1291  const ::Ice::Current& c)
1292  {
1293  AbstractObjectSerializerPtr obj = AbstractObjectSerializerPtr::dynamicCast(serializer);
1294 
1296  frame = obj->getString("frame");
1297 
1298  if (obj->hasElement("agent"))
1299  {
1300  agent = obj->getString("agent");
1301  }
1302  }
1303 
1306  {
1307  return this->clone();
1308  }
1309 
1310  VariantDataClassPtr
1311  FramedOrientation::clone(const Ice::Current& c) const
1312  {
1313  return new FramedOrientation(*this);
1314  }
1315 
1317  FramedOrientation::getType(const Ice::Current& c) const
1318  {
1320  }
1321 
1322  bool
1323  FramedOrientation::validate(const Ice::Current& c)
1324  {
1325  return true;
1326  }
1327 
1328  std::ostream&
1329  operator<<(std::ostream& stream, const FramedOrientation& rhs)
1330  {
1331  stream << "FramedOrientation: " << std::endl << rhs.output() << std::endl;
1332  return stream;
1333  }
1334 
1335  VirtualRobot::LinkedCoordinate
1337  const FramedPositionPtr& position,
1338  const FramedOrientationPtr& orientation)
1339  {
1340  VirtualRobot::LinkedCoordinate c(virtualRobot);
1341  std::string frame;
1342 
1343  if (position)
1344  {
1345  frame = position->getFrame();
1346 
1347  if (orientation)
1348  {
1349  if (!frame.empty() && frame != orientation->getFrame())
1350  {
1351  throw armarx::UserException("Error: frames mismatch");
1352  }
1353  }
1354  }
1355  else
1356  {
1357  if (!orientation)
1358  {
1359  armarx::UserException(
1360  "createLinkedCoordinate: orientation and position are both NULL");
1361  }
1362  else
1363  {
1364  frame = orientation->getFrame();
1365  }
1366  }
1367 
1369 
1370  if (orientation)
1371  {
1372  pose.block<3, 3>(0, 0) = orientation->toEigen();
1373  }
1374 
1375  if (position)
1376  {
1377  pose.block<3, 1>(0, 3) = position->toEigen();
1378  }
1379 
1380  c.set(frame, pose);
1381 
1382  return c;
1383  }
1384 
1387  const std::string& newFrame) const
1388  {
1389  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1390  return toFrame(sharedRobot, newFrame);
1391  }
1392 
1395  const std::string& newFrame) const
1396  {
1397  FramedPosePtr newPose = FramedPosePtr::dynamicCast(this->clone());
1398  newPose->changeFrame(referenceRobot, newFrame);
1399  return newPose;
1400  }
1401 
1404  const std::string& newFrame) const
1405  {
1406  VirtualRobot::RobotPtr sharedRobot(new RemoteRobot(referenceRobot));
1407  return toFrameEigen(sharedRobot, newFrame);
1408  }
1409 
1412  const std::string& newFrame) const
1413  {
1414  return toFrame(referenceRobot, newFrame)->toEigen();
1415  }
1416 
1419  {
1420  return this->clone();
1421  }
1422 
1423  VariantDataClassPtr
1424  FramedPose::clone(const Ice::Current& c) const
1425  {
1426  return new FramedPose(*this);
1427  }
1428 
1430  FramedPose::getType(const Ice::Current& c) const
1431  {
1432  return VariantType::FramedPose;
1433  }
1434 
1435  bool
1436  FramedPose::validate(const Ice::Current& c)
1437  {
1438  return true;
1439  }
1440 
1441  std::ostream&
1442  operator<<(std::ostream& stream, const FramedPose& rhs)
1443  {
1444  stream << "FramedPose: " << std::endl << rhs.output() << std::endl;
1445  return stream;
1446  }
1447 
1448  bool
1449  operator==(const FramedPose& pose1, const FramedPose& pose2)
1450  {
1451  if (pose1.frame != pose2.frame || pose1.agent != pose2.agent)
1452  return false;
1453  return (pose1.toEigen().isApprox(pose2.toEigen()));
1454  }
1455 
1456  bool
1457  operator!=(const FramedPose& pose1, const FramedPose& pose2)
1458  {
1459  return !(pose1 == pose2);
1460  }
1461 
1462 
1463 } // namespace armarx
armarx::FramedDirection::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:306
RemoteRobot.h
armarx::FramedPose::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:680
Eigen
Definition: Elements.h:32
armarx::VariantType::Float
const VariantTypeId Float
Definition: Variant.h:919
armarx::FramedPosition::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:955
armarx::operator!=
bool operator!=(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
Definition: RemoteHandle.h:288
armarx::FramedOrientation::getFrame
std::string getFrame() const
Definition: FramedPose.cpp:1071
armarx::FramedPosition::operator=
FramedPosition & operator=(const armarx::FramedPosition &other)
Definition: FramedPose.cpp:989
armarx::FramedPose
The FramedPose class.
Definition: FramedPose.h:280
armarx::VariantType::FramedPose
const VariantTypeId FramedPose
Definition: FramedPose.h:36
armarx::FramedPose::getType
VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1430
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:650
armarx::FramedPosition::getFrame
std::string getFrame() const
Definition: FramedPose.cpp:736
armarx::FramedPose::createLinkedCoordinate
static VirtualRobot::LinkedCoordinate createLinkedCoordinate(const VirtualRobot::RobotPtr &virtualRobot, const FramedPositionPtr &position, const FramedOrientationPtr &orientation)
Definition: FramedPose.cpp:1336
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:1386
armarx::FramedPose::clone
VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1424
armarx::FramedPose::toFrameEigen
Eigen::Matrix4f toFrameEigen(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame) const
Definition: FramedPose.cpp:1403
armarx::GlobalFrame
const std::string GlobalFrame
Definition: FramedPose.h:65
AbstractObjectSerializer.h
armarx::FramedDirection::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: FramedPose.cpp:368
armarx::FramedDirection::toRootEigen
Eigen::Vector3f toRootEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:284
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:46
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:380
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:703
armarx::FramedPosition::toRootEigen
Eigen::Vector3f toRootEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:924
IceUtil
Definition: Instance.h:21
armarx::FramedOrientation::toRootFrame
FramedOrientationPtr toRootFrame(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:1235
armarx::FramedPose::toGlobal
FramedPosePtr toGlobal(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:576
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:1317
armarx::FramedPosition::toGlobalEigen
Eigen::Vector3f toGlobalEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:880
armarx::FramedPosition::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: FramedPose.cpp:1000
armarx::FramedPosition::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:946
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:966
armarx::FramedDirection::toRootFrame
FramedDirectionPtr toRootFrame(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:262
armarx::FramedOrientation::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1077
IceInternal::Handle< FramedDirection >
armarx::FramedOrientation::toGlobal
FramedOrientationPtr toGlobal(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:1191
armarx::FramedPosition::clone
VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1006
armarx::FramedPose::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: FramedPose.cpp:1436
armarx::ArmarXEigenFormat
const Eigen::IOFormat ArmarXEigenFormat(Eigen::StreamPrecision, Eigen::DontAlignCols, " ", "\n", "", "")
armarx::FramedDirection::toGlobalEigen
Eigen::Vector3f toGlobalEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:240
armarx::FramedDirection::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:346
armarx::FramedDirection::ChangeFrame
static FramedDirectionPtr ChangeFrame(const VirtualRobot::RobotPtr &robot, const FramedDirection &framedVec, const std::string &newFrame)
Definition: FramedPose.cpp:91
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:570
armarx::FramedOrientation::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: FramedPose.cpp:1305
armarx::FramedOrientation::toGlobalEigen
Eigen::Matrix3f toGlobalEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:1213
armarx::FramedPose::output
std::string output(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:459
armarx::FramedDirection::toGlobal
FramedDirectionPtr toGlobal(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:218
armarx::FramedPose::getPosition
FramedPositionPtr getPosition() const
Definition: FramedPose.cpp:664
armarx::FramedPose::toGlobalEigen
Eigen::Matrix4f toGlobalEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:598
armarx::FramedOrientation::changeToGlobal
void changeToGlobal(const SharedRobotInterfacePrx &referenceRobot)
Definition: FramedPose.cpp:1157
armarx::FramedDirection::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: FramedPose.cpp:386
FramedPose.h
armarx::ValueToString
std::string ValueToString(const T &value)
Definition: StringHelpers.h:61
armarx::armem::human::Robot
@ Robot
Definition: util.h:17
armarx::FramedPosition
The FramedPosition class.
Definition: FramedPose.h:157
armarx::FramedOrientation::serialize
void serialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1279
armarx::FramedPosition::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: FramedPose.cpp:1018
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:398
armarx::FramedOrientation::validate
bool validate(const Ice::Current &c=Ice::emptyCurrent) override
Definition: FramedPose.cpp:1323
armarx::FramedDirection::getFrame
std::string getFrame() const
Definition: FramedPose.cpp:85
armarx::operator==
bool operator==(const RemoteHandle< PrxTA > &fst, const RemoteHandle< PrxTB > &snd)
Definition: RemoteHandle.h:280
armarx::FramedPosition::changeToGlobal
void changeToGlobal(const SharedRobotInterfacePrx &referenceRobot)
Definition: FramedPose.cpp:825
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:215
armarx::VariantTypeId
Ice::Int VariantTypeId
Definition: Variant.h:43
armarx::FramedPosition::changeFrame
void changeFrame(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame)
Definition: FramedPose.cpp:742
boost::source
Vertex source(const detail::edge_base< Directed, Vertex > &e, const PCG &)
Definition: point_cloud_graph.h:661
armarx::Quaternion::toEigen
Eigen::Matrix3f toEigen() const
Definition: Pose.cpp:204
q
#define q
ARMARX_WARNING_S
#define ARMARX_WARNING_S
Definition: Logging.h:213
armarx::FramedPosition::getType
VariantTypeId getType(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1012
armarx::FramedDirection::clone
VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:374
armarx::FramedPose::toRootEigen
Eigen::Matrix4f toRootEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:642
ExpressionException.h
armarx::FramedPosition::toRootFrame
FramedPositionPtr toRootFrame(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:902
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:144
armarx::ctrlutil::v
double v(double t, double v0, double a0, double j)
Definition: CtrlUtil.h:39
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:186
armarx::VariantType::FramedOrientation
const VariantTypeId FramedOrientation
Definition: FramedPose.h:39
armarx::FramedDirection
FramedDirection is a 3 dimensional direction vector with a reference frame. The reference frame can b...
Definition: FramedPose.h:86
armarx::VariantType::FramedDirection
const VariantTypeId FramedDirection
Definition: FramedPose.h:37
armarx::FramedPose::getOrientation
FramedOrientationPtr getOrientation() const
Definition: FramedPose.cpp:672
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:43
IceInternal::ProxyHandle<::IceProxy::armarx::SharedRobotInterface >
armarx::operator<<
std::ostream & operator<<(std::ostream &os, const PythonApplicationManager::Paths &paths)
Definition: PythonApplicationManager.cpp:285
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:620
armarx::FramedOrientation::FramedOrientation
FramedOrientation()
Definition: FramedPose.cpp:1030
armarx::aron::type::ObjectPtr
std::shared_ptr< Object > ObjectPtr
Definition: Object.h:36
armarx::FramedPose::getFrame
std::string getFrame() const
Definition: FramedPose.cpp:453
Logging.h
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:649
armarx::FramedDirection::changeFrame
void changeFrame(const VirtualRobot::RobotPtr &robot, const std::string &newFrame)
Definition: FramedPose.cpp:132
armarx::VariantType::FramedPosition
const VariantTypeId FramedPosition
Definition: FramedPose.h:38
armarx::FramedPose::changeToGlobal
void changeToGlobal(const SharedRobotInterfacePrx &referenceRobot)
Definition: FramedPose.cpp:539
armarx::FramedPose::ice_clone
Ice::ObjectPtr ice_clone() const override
Definition: FramedPose.cpp:1418
armarx::FramedOrientation::clone
VariantDataClassPtr clone(const Ice::Current &c=Ice::emptyCurrent) const override
Definition: FramedPose.cpp:1311
armarx::FramedPosition::toGlobal
FramedPositionPtr toGlobal(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:858
armarx::FramedPose::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: FramedPose.cpp:690
armarx::FramedOrientation::toRootEigen
Eigen::Matrix3f toRootEigen(const SharedRobotInterfacePrx &referenceRobot) const
Definition: FramedPose.cpp:1257
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:1290
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::FramedOrientation::changeFrame
void changeFrame(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame)
Definition: FramedPose.cpp:1086
armarx::FramedPose::changeFrame
void changeFrame(const SharedRobotInterfacePrx &referenceRobot, const std::string &newFrame)
Definition: FramedPose.cpp:469
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:19
armarx::FramedDirection::deserialize
void deserialize(const armarx::ObjectSerializerBasePtr &serializer, const ::Ice::Current &=Ice::emptyCurrent) override
Definition: FramedPose.cpp:355