1 #define BOOST_TEST_MODULE ArmarX::RobotTrajectoryDesigner::Transition
2 #define ARMARX_BOOST_TEST
5 #include <RobotComponents/Test.h>
7 #include "../Transition.h"
8 #include "../Util/OrientationConversion.h"
14 Vector3BasePtr pos1 = Vector3BasePtr(
new Vector3(1, 2, 3));
16 PoseBasePtr pose1 = PoseBasePtr(
new Pose(pos1, ori1));
18 Vector3BasePtr pos2 = Vector3BasePtr(
new Vector3(4, 5, 6));
20 PoseBasePtr pose2 = PoseBasePtr(
new Pose(pos2, ori2));
28 BOOST_CHECK_EQUAL(t1.
getStart(), w1);
29 BOOST_CHECK_EQUAL(t1.
getEnd(), w2);
52 Vector3BasePtr pos1 = Vector3BasePtr(
new Vector3(1, 2, 3));
54 PoseBasePtr pose1 = PoseBasePtr(
new Pose(pos1, ori1));
56 Vector3BasePtr pos2 = Vector3BasePtr(
new Vector3(4, 5, 6));
58 PoseBasePtr pose2 = PoseBasePtr(
new Pose(pos2, ori2));
63 Vector3BasePtr pos3 = Vector3BasePtr(
new Vector3(7, 8, 9));
65 PoseBasePtr pose3 = PoseBasePtr(
new Pose(pos3, ori3));
67 Vector3BasePtr pos4 = Vector3BasePtr(
new Vector3(10, 11, 12));
69 PoseBasePtr pose4 = PoseBasePtr(
new Pose(pos4, ori4));
79 t1.
getStart()->setTimeOptimalTimestamp(1);
81 t1.
getEnd()->setTimeOptimalTimestamp(10);
82 t1.
getEnd()->setUserTimestamp(20);
89 BOOST_CHECK_EQUAL(t2.
getStart()->getUserTimestamp(), 2);
90 BOOST_CHECK_EQUAL(t2.
getStart()->getTimeOptimalTimestamp(), 1);
91 BOOST_CHECK_EQUAL(t2.
getEnd()->getUserTimestamp(), 20);
92 BOOST_CHECK_EQUAL(t2.
getEnd()->getTimeOptimalTimestamp(), 10);
97 t1.
getStart()->setTimeOptimalTimestamp(3);
99 t1.
getEnd()->setTimeOptimalTimestamp(30);
100 t1.
getEnd()->setUserTimestamp(40);
104 BOOST_CHECK_EQUAL(t2.
getStart()->getUserTimestamp(), 2);
105 BOOST_CHECK_EQUAL(t2.
getStart()->getTimeOptimalTimestamp(), 1);
106 BOOST_CHECK_EQUAL(t2.
getEnd()->getUserTimestamp(), 20);
107 BOOST_CHECK_EQUAL(t2.
getEnd()->getTimeOptimalTimestamp(), 10);
112 BOOST_CHECK_EQUAL(t1.
getStart()->getUserTimestamp(), 4);
113 BOOST_CHECK_EQUAL(t1.
getStart()->getTimeOptimalTimestamp(), 3);
114 BOOST_CHECK_EQUAL(t1.
getEnd()->getUserTimestamp(), 40);
115 BOOST_CHECK_EQUAL(t1.
getEnd()->getTimeOptimalTimestamp(), 30);