30 #include <gtest/gtest.h> 35 #include "LinearMath/btVector3.h" 36 #include "LinearMath/btTransform.h" 37 #include "rostest/permuter.h" 41 trans.translation.x = 0;
42 trans.translation.y = 0;
43 trans.translation.z = 0;
51 void push_back_i(std::vector<std::string>& children, std::vector<std::string>& parents,
52 std::vector<double>& dx, std::vector<double>& dy)
62 children.push_back(
"b");
63 parents.push_back(
"a");
66 children.push_back(
"c");
67 parents.push_back(
"b");
73 void push_back_y(std::vector<std::string>& children, std::vector<std::string>& parents,
74 std::vector<double>& dx, std::vector<double>& dy)
84 children.push_back(
"b");
85 parents.push_back(
"a");
89 children.push_back(
"c");
90 parents.push_back(
"b");
94 children.push_back(
"d");
95 parents.push_back(
"b");
99 children.push_back(
"e");
100 parents.push_back(
"d");
105 void push_back_v(std::vector<std::string>& children, std::vector<std::string>& parents,
106 std::vector<double>& dx, std::vector<double>& dy)
116 children.push_back(
"b");
117 parents.push_back(
"a");
121 children.push_back(
"c");
122 parents.push_back(
"b");
126 children.push_back(
"f");
127 parents.push_back(
"a");
131 children.push_back(
"g");
132 parents.push_back(
"f");
138 void push_back_1(std::vector<std::string>& children, std::vector<std::string>& parents,
139 std::vector<double>& dx, std::vector<double>& dy)
141 children.push_back(
"2");
142 parents.push_back(
"1");
149 ROS_DEBUG(
"Clearing Buffer Core for new test setup");
152 ROS_DEBUG(
"Setting up test tree for formation %s", mode.c_str());
154 std::vector<std::string> children;
155 std::vector<std::string> parents;
156 std::vector<double> dx, dy;
162 else if (mode ==
"y")
167 else if (mode ==
"v")
172 else if (mode ==
"ring_45")
176 std::vector<std::string> frames;
180 frames.push_back(
"a");
181 frames.push_back(
"b");
182 frames.push_back(
"c");
183 frames.push_back(
"d");
184 frames.push_back(
"e");
185 frames.push_back(
"f");
186 frames.push_back(
"g");
187 frames.push_back(
"h");
188 frames.push_back(
"i");
190 for (uint8_t iteration = 0; iteration < 2; ++iteration)
192 double direction = 1;
193 std::string frame_prefix;
196 frame_prefix =
"inverse_";
201 for (uint64_t i = 1; i < frames.size(); i++)
203 geometry_msgs::TransformStamped ts;
205 ts.transform.translation.x = direction * (
sqrt(2)/2 - 1);
206 ts.transform.translation.y = direction *
sqrt(2)/2;
207 ts.transform.rotation.x = 0;
208 ts.transform.rotation.y = 0;
209 ts.transform.rotation.z =
sin(direction * M_PI/8);
210 ts.transform.rotation.w =
cos(direction * M_PI/8);
211 if (time >
ros::Time() + (interpolation_space * .5))
212 ts.header.stamp = time - (interpolation_space * .5);
216 ts.header.frame_id = frame_prefix + frames[i-1];
218 ts.child_frame_id = frame_prefix + frames[i];
220 ts.child_frame_id = frames[i];
224 ts.header.stamp = time + interpolation_space * .5;
232 else if (mode ==
"1")
237 else if (mode ==
"1_v")
243 EXPECT_FALSE(
"Undefined mode for tree setup. Test harness improperly setup.");
247 for (uint64_t i = 0; i < children.size(); i++)
249 geometry_msgs::TransformStamped ts;
251 ts.transform.translation.x = dx[i];
252 ts.transform.translation.y = dy[i];
253 if (time >
ros::Time() + (interpolation_space * .5))
254 ts.header.stamp = time - (interpolation_space * .5);
258 ts.header.frame_id = parents[i];
259 ts.child_frame_id = children[i];
263 ts.header.stamp = time + interpolation_space * .5;
271 TEST(BufferCore_setTransform, NoInsertOnSelfTransform)
274 geometry_msgs::TransformStamped tranStamped;
277 tranStamped.header.frame_id =
"same_frame";
278 tranStamped.child_frame_id =
"same_frame";
279 EXPECT_FALSE(mBC.
setTransform(tranStamped,
"authority"));
282 TEST(BufferCore_setTransform, NoInsertWithNan)
285 geometry_msgs::TransformStamped tranStamped;
288 tranStamped.header.frame_id =
"same_frame";
289 tranStamped.child_frame_id =
"other_frame";
290 EXPECT_TRUE(mBC.
setTransform(tranStamped,
"authority"));
291 tranStamped.transform.translation.x = 0.0/0.0;
292 EXPECT_TRUE(std::isnan(tranStamped.transform.translation.x));
293 EXPECT_FALSE(mBC.
setTransform(tranStamped,
"authority"));
297 TEST(BufferCore_setTransform, NoInsertWithNoFrameID)
300 geometry_msgs::TransformStamped tranStamped;
303 tranStamped.header.frame_id =
"same_frame";
304 tranStamped.child_frame_id =
"";
305 EXPECT_FALSE(mBC.
setTransform(tranStamped,
"authority"));
306 tranStamped.child_frame_id =
"/";
307 EXPECT_FALSE(mBC.
setTransform(tranStamped,
"authority"));
311 TEST(BufferCore_setTransform, NoInsertWithNoParentID)
314 geometry_msgs::TransformStamped tranStamped;
317 tranStamped.header.frame_id =
"";
318 tranStamped.child_frame_id =
"some_frame";
319 EXPECT_FALSE(mBC.
setTransform(tranStamped,
"authority"));
321 tranStamped.header.frame_id =
"/";
322 EXPECT_FALSE(mBC.
setTransform(tranStamped,
"authority"));
602 TEST(BufferCore_lookupTransform, i_configuration)
608 rostest::Permuter permuter;
610 std::vector<ros::Time> times;
615 permuter.addOptionSet(times, &eval_time);
617 std::vector<ros::Duration> durations;
624 std::vector<std::string> frames;
625 frames.push_back(
"a");
626 frames.push_back(
"b");
627 frames.push_back(
"c");
628 std::string source_frame;
629 permuter.addOptionSet(frames, &source_frame);
631 std::string target_frame;
632 permuter.addOptionSet(frames, &target_frame);
634 while (permuter.step())
638 setupTree(mBC,
"i", eval_time, interpolation_space);
640 geometry_msgs::TransformStamped outpose = mBC.
lookupTransform(source_frame, target_frame, eval_time);
642 EXPECT_EQ(outpose.header.stamp, eval_time);
643 EXPECT_EQ(outpose.header.frame_id, source_frame);
644 EXPECT_EQ(outpose.child_frame_id, target_frame);
645 EXPECT_NEAR(outpose.transform.translation.y, 0, epsilon);
646 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
647 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
648 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
649 EXPECT_NEAR(outpose.transform.rotation.z, 0, epsilon);
650 EXPECT_NEAR(outpose.transform.rotation.w, 1, epsilon);
653 if (source_frame == target_frame)
655 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
657 else if ((source_frame ==
"a" && target_frame ==
"b") ||
658 (source_frame ==
"b" && target_frame ==
"c"))
660 EXPECT_NEAR(outpose.transform.translation.x, 1, epsilon);
662 else if ((source_frame ==
"b" && target_frame ==
"a") ||
663 (source_frame ==
"c" && target_frame ==
"b"))
665 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
667 else if (source_frame ==
"a" && target_frame ==
"c")
669 EXPECT_NEAR(outpose.transform.translation.x, 2, epsilon);
671 else if (source_frame ==
"c" && target_frame ==
"a")
673 EXPECT_NEAR(outpose.transform.translation.x, -2, epsilon);
677 EXPECT_FALSE(
"i configuration: Shouldn't get here");
678 printf(
"source_frame %s target_frame %s time %f\n", source_frame.c_str(), target_frame.c_str(), eval_time.
toSec());
685 bool check_1_result(
const geometry_msgs::TransformStamped& outpose,
const std::string& source_frame,
const std::string& target_frame,
const ros::Time& eval_time,
double epsilon)
688 EXPECT_EQ(outpose.header.stamp, eval_time);
689 EXPECT_EQ(outpose.header.frame_id, source_frame);
690 EXPECT_EQ(outpose.child_frame_id, target_frame);
691 EXPECT_NEAR(outpose.transform.translation.y, 0, epsilon);
692 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
693 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
694 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
695 EXPECT_NEAR(outpose.transform.rotation.z, 0, epsilon);
696 EXPECT_NEAR(outpose.transform.rotation.w, 1, epsilon);
699 if (source_frame == target_frame)
701 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
703 else if (source_frame ==
"1" && target_frame ==
"2")
705 EXPECT_NEAR(outpose.transform.translation.x, 1, epsilon);
707 else if (source_frame ==
"2" && target_frame ==
"1")
709 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
720 bool check_v_result(
const geometry_msgs::TransformStamped& outpose,
const std::string& source_frame,
const std::string& target_frame,
const ros::Time& eval_time,
double epsilon)
723 EXPECT_EQ(outpose.header.stamp, eval_time);
724 EXPECT_EQ(outpose.header.frame_id, source_frame);
725 EXPECT_EQ(outpose.child_frame_id, target_frame);
726 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
727 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
728 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
729 EXPECT_NEAR(outpose.transform.rotation.z, 0, epsilon);
730 EXPECT_NEAR(outpose.transform.rotation.w, 1, epsilon);
733 if (source_frame == target_frame)
735 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
737 else if ((source_frame ==
"a" && target_frame ==
"b") ||
738 (source_frame ==
"b" && target_frame ==
"c"))
740 EXPECT_NEAR(outpose.transform.translation.x, 1, epsilon);
741 EXPECT_NEAR(outpose.transform.translation.y, 0, epsilon);
743 else if ((source_frame ==
"b" && target_frame ==
"a") ||
744 (source_frame ==
"c" && target_frame ==
"b"))
746 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
747 EXPECT_NEAR(outpose.transform.translation.y, 0, epsilon);
749 else if ((source_frame ==
"a" && target_frame ==
"f") ||
750 (source_frame ==
"f" && target_frame ==
"g"))
752 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
753 EXPECT_NEAR(outpose.transform.translation.y, 1, epsilon);
755 else if ((source_frame ==
"f" && target_frame ==
"a") ||
756 (source_frame ==
"g" && target_frame ==
"f"))
758 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
759 EXPECT_NEAR(outpose.transform.translation.y, -1, epsilon);
761 else if (source_frame ==
"a" && target_frame ==
"g")
763 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
764 EXPECT_NEAR(outpose.transform.translation.y, 2, epsilon);
766 else if (source_frame ==
"g" && target_frame ==
"a")
768 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
769 EXPECT_NEAR(outpose.transform.translation.y, -2, epsilon);
771 else if (source_frame ==
"a" && target_frame ==
"c")
773 EXPECT_NEAR(outpose.transform.translation.x, 2, epsilon);
774 EXPECT_NEAR(outpose.transform.translation.y, 0, epsilon);
776 else if (source_frame ==
"c" && target_frame ==
"a")
778 EXPECT_NEAR(outpose.transform.translation.x, -2, epsilon);
779 EXPECT_NEAR(outpose.transform.translation.y, 0, epsilon);
781 else if (source_frame ==
"b" && target_frame ==
"f")
783 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
784 EXPECT_NEAR(outpose.transform.translation.y, 1, epsilon);
786 else if (source_frame ==
"f" && target_frame ==
"b")
788 EXPECT_NEAR(outpose.transform.translation.x, 1, epsilon);
789 EXPECT_NEAR(outpose.transform.translation.y, -1, epsilon);
791 else if (source_frame ==
"c" && target_frame ==
"f")
793 EXPECT_NEAR(outpose.transform.translation.x, -2, epsilon);
794 EXPECT_NEAR(outpose.transform.translation.y, 1, epsilon);
796 else if (source_frame ==
"f" && target_frame ==
"c")
798 EXPECT_NEAR(outpose.transform.translation.x, 2, epsilon);
799 EXPECT_NEAR(outpose.transform.translation.y, -1, epsilon);
801 else if (source_frame ==
"b" && target_frame ==
"g")
803 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
804 EXPECT_NEAR(outpose.transform.translation.y, 2, epsilon);
806 else if (source_frame ==
"g" && target_frame ==
"b")
808 EXPECT_NEAR(outpose.transform.translation.x, 1, epsilon);
809 EXPECT_NEAR(outpose.transform.translation.y, -2, epsilon);
811 else if (source_frame ==
"c" && target_frame ==
"g")
813 EXPECT_NEAR(outpose.transform.translation.x, -2, epsilon);
814 EXPECT_NEAR(outpose.transform.translation.y, 2, epsilon);
816 else if (source_frame ==
"g" && target_frame ==
"c")
818 EXPECT_NEAR(outpose.transform.translation.x, 2, epsilon);
819 EXPECT_NEAR(outpose.transform.translation.y, -2, epsilon);
830 bool check_y_result(
const geometry_msgs::TransformStamped& outpose,
const std::string& source_frame,
const std::string& target_frame,
const ros::Time& eval_time,
double epsilon)
833 EXPECT_EQ(outpose.header.stamp, eval_time);
834 EXPECT_EQ(outpose.header.frame_id, source_frame);
835 EXPECT_EQ(outpose.child_frame_id, target_frame);
836 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
837 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
838 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
839 EXPECT_NEAR(outpose.transform.rotation.z, 0, epsilon);
840 EXPECT_NEAR(outpose.transform.rotation.w, 1, epsilon);
843 if (source_frame == target_frame)
845 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
847 else if ((source_frame ==
"a" && target_frame ==
"b") ||
848 (source_frame ==
"b" && target_frame ==
"c"))
850 EXPECT_NEAR(outpose.transform.translation.x, 1, epsilon);
851 EXPECT_NEAR(outpose.transform.translation.y, 0, epsilon);
853 else if ((source_frame ==
"b" && target_frame ==
"a") ||
854 (source_frame ==
"c" && target_frame ==
"b"))
856 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
857 EXPECT_NEAR(outpose.transform.translation.y, 0, epsilon);
859 else if ((source_frame ==
"b" && target_frame ==
"d") ||
860 (source_frame ==
"d" && target_frame ==
"e"))
862 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
863 EXPECT_NEAR(outpose.transform.translation.y, 1, epsilon);
865 else if ((source_frame ==
"d" && target_frame ==
"b") ||
866 (source_frame ==
"e" && target_frame ==
"d"))
868 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
869 EXPECT_NEAR(outpose.transform.translation.y, -1, epsilon);
871 else if (source_frame ==
"b" && target_frame ==
"e")
873 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
874 EXPECT_NEAR(outpose.transform.translation.y, 2, epsilon);
876 else if (source_frame ==
"e" && target_frame ==
"b")
878 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
879 EXPECT_NEAR(outpose.transform.translation.y, -2, epsilon);
881 else if (source_frame ==
"a" && target_frame ==
"c")
883 EXPECT_NEAR(outpose.transform.translation.x, 2, epsilon);
884 EXPECT_NEAR(outpose.transform.translation.y, 0, epsilon);
886 else if (source_frame ==
"c" && target_frame ==
"a")
888 EXPECT_NEAR(outpose.transform.translation.x, -2, epsilon);
889 EXPECT_NEAR(outpose.transform.translation.y, 0, epsilon);
891 else if (source_frame ==
"a" && target_frame ==
"d")
893 EXPECT_NEAR(outpose.transform.translation.x, 1, epsilon);
894 EXPECT_NEAR(outpose.transform.translation.y, 1, epsilon);
896 else if (source_frame ==
"d" && target_frame ==
"a")
898 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
899 EXPECT_NEAR(outpose.transform.translation.y, -1, epsilon);
901 else if (source_frame ==
"c" && target_frame ==
"d")
903 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
904 EXPECT_NEAR(outpose.transform.translation.y, 1, epsilon);
906 else if (source_frame ==
"d" && target_frame ==
"c")
908 EXPECT_NEAR(outpose.transform.translation.x, 1, epsilon);
909 EXPECT_NEAR(outpose.transform.translation.y, -1, epsilon);
911 else if (source_frame ==
"a" && target_frame ==
"e")
913 EXPECT_NEAR(outpose.transform.translation.x, 1, epsilon);
914 EXPECT_NEAR(outpose.transform.translation.y, 2, epsilon);
916 else if (source_frame ==
"e" && target_frame ==
"a")
918 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
919 EXPECT_NEAR(outpose.transform.translation.y, -2, epsilon);
921 else if (source_frame ==
"c" && target_frame ==
"e")
923 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
924 EXPECT_NEAR(outpose.transform.translation.y, 2, epsilon);
926 else if (source_frame ==
"e" && target_frame ==
"c")
928 EXPECT_NEAR(outpose.transform.translation.x, 1, epsilon);
929 EXPECT_NEAR(outpose.transform.translation.y, -2, epsilon);
940 TEST(BufferCore_lookupTransform, one_link_configuration)
946 rostest::Permuter permuter;
948 std::vector<ros::Time> times;
953 permuter.addOptionSet(times, &eval_time);
955 std::vector<ros::Duration> durations;
962 std::vector<std::string> frames;
963 frames.push_back(
"1");
964 frames.push_back(
"2");
965 std::string source_frame;
966 permuter.addOptionSet(frames, &source_frame);
968 std::string target_frame;
969 permuter.addOptionSet(frames, &target_frame);
971 while (permuter.step())
975 setupTree(mBC,
"1", eval_time, interpolation_space);
977 geometry_msgs::TransformStamped outpose = mBC.
lookupTransform(source_frame, target_frame, eval_time);
979 EXPECT_TRUE(
check_1_result(outpose, source_frame, target_frame, eval_time, epsilon));
984 TEST(BufferCore_lookupTransform, v_configuration)
990 rostest::Permuter permuter;
992 std::vector<ros::Time> times;
997 permuter.addOptionSet(times, &eval_time);
999 std::vector<ros::Duration> durations;
1006 std::vector<std::string> frames;
1007 frames.push_back(
"a");
1008 frames.push_back(
"b");
1009 frames.push_back(
"c");
1010 frames.push_back(
"f");
1011 frames.push_back(
"g");
1012 std::string source_frame;
1013 permuter.addOptionSet(frames, &source_frame);
1015 std::string target_frame;
1016 permuter.addOptionSet(frames, &target_frame);
1018 while (permuter.step())
1022 setupTree(mBC,
"v", eval_time, interpolation_space);
1024 geometry_msgs::TransformStamped outpose = mBC.
lookupTransform(source_frame, target_frame, eval_time);
1026 EXPECT_TRUE(
check_v_result(outpose, source_frame, target_frame, eval_time, epsilon));
1031 TEST(BufferCore_lookupTransform, y_configuration)
1037 rostest::Permuter permuter;
1039 std::vector<ros::Time> times;
1044 permuter.addOptionSet(times, &eval_time);
1046 std::vector<ros::Duration> durations;
1053 std::vector<std::string> frames;
1054 frames.push_back(
"a");
1055 frames.push_back(
"b");
1056 frames.push_back(
"c");
1057 frames.push_back(
"d");
1058 frames.push_back(
"e");
1059 std::string source_frame;
1060 permuter.addOptionSet(frames, &source_frame);
1062 std::string target_frame;
1063 permuter.addOptionSet(frames, &target_frame);
1065 while (permuter.step())
1069 setupTree(mBC,
"y", eval_time, interpolation_space);
1071 geometry_msgs::TransformStamped outpose = mBC.
lookupTransform(source_frame, target_frame, eval_time);
1073 EXPECT_TRUE(
check_y_result(outpose, source_frame, target_frame, eval_time, epsilon));
1077 TEST(BufferCore_lookupTransform, multi_configuration)
1083 rostest::Permuter permuter;
1085 std::vector<ros::Time> times;
1090 permuter.addOptionSet(times, &eval_time);
1092 std::vector<ros::Duration> durations;
1099 std::vector<std::string> frames;
1100 frames.push_back(
"1");
1101 frames.push_back(
"2");
1102 frames.push_back(
"a");
1103 frames.push_back(
"b");
1104 frames.push_back(
"c");
1105 frames.push_back(
"f");
1106 frames.push_back(
"g");
1107 std::string source_frame;
1108 permuter.addOptionSet(frames, &source_frame);
1110 std::string target_frame;
1111 permuter.addOptionSet(frames, &target_frame);
1113 while (permuter.step())
1117 setupTree(mBC,
"1_v", eval_time, interpolation_space);
1119 if (mBC.
canTransform(source_frame, target_frame, eval_time))
1121 geometry_msgs::TransformStamped outpose = mBC.
lookupTransform(source_frame, target_frame, eval_time);
1123 if ((source_frame ==
"1" || source_frame ==
"2") && (target_frame ==
"1" || target_frame ==
"2"))
1124 EXPECT_TRUE(
check_1_result(outpose, source_frame, target_frame, eval_time, epsilon));
1125 else if ((source_frame ==
"a" || source_frame ==
"b" || source_frame ==
"c" || source_frame ==
"f" || source_frame ==
"g") &&
1126 (target_frame ==
"a" || target_frame ==
"b" || target_frame ==
"c" || target_frame ==
"f" || target_frame ==
"g"))
1127 EXPECT_TRUE(
check_v_result(outpose, source_frame, target_frame, eval_time, epsilon));
1129 EXPECT_FALSE(
"Frames unhandled");
1132 EXPECT_TRUE(((source_frame ==
"a" || source_frame ==
"b" || source_frame ==
"c" || source_frame ==
"f" || source_frame ==
"g") &&
1133 (target_frame ==
"1" || target_frame ==
"2") )
1135 ((target_frame ==
"a" || target_frame ==
"b" || target_frame ==
"c" || target_frame ==
"f" || target_frame ==
"g") &&
1136 (source_frame ==
"1" || source_frame ==
"2"))
1142 #define CHECK_QUATERNION_NEAR(_q1, _x, _y, _z, _w, _epsilon) \ 1144 btQuaternion q1(_q1.x, _q1.y, _q1.z, _q1.w); \ 1145 btQuaternion q2(_x, _y, _z, _w); \ 1146 double angle = q1.angle(q2); \ 1147 EXPECT_TRUE(fabs(angle) < _epsilon || fabs(angle - M_PI) < _epsilon); \ 1150 #define CHECK_TRANSFORMS_NEAR(_out, _expected, _eps) \ 1151 EXPECT_NEAR(_out.transform.translation.x, _expected.getOrigin().x(), epsilon); \ 1152 EXPECT_NEAR(_out.transform.translation.y, _expected.getOrigin().y(), epsilon); \ 1153 EXPECT_NEAR(_out.transform.translation.z, _expected.getOrigin().z(), epsilon); \ 1154 CHECK_QUATERNION_NEAR(_out.transform.rotation, _expected.getRotation().x(), _expected.getRotation().y(), _expected.getRotation().z(), _expected.getRotation().w(), _eps); 1158 TEST(BufferCore_lookupTransform, compound_xfm_configuration)
1173 geometry_msgs::TransformStamped tsa;
1174 tsa.header.frame_id =
"root";
1175 tsa.child_frame_id =
"a";
1176 tsa.transform.translation.x = 1.0;
1177 tsa.transform.translation.y = 1.0;
1178 tsa.transform.translation.z = 1.0;
1180 q1.setEuler(0.25, .5, .75);
1181 tsa.transform.rotation.x = q1.x();
1182 tsa.transform.rotation.y = q1.y();
1183 tsa.transform.rotation.z = q1.z();
1184 tsa.transform.rotation.w = q1.w();
1187 geometry_msgs::TransformStamped tsb;
1188 tsb.header.frame_id =
"root";
1189 tsb.child_frame_id =
"b";
1190 tsb.transform.translation.x = -1.0;
1191 tsb.transform.translation.y = 0.0;
1192 tsb.transform.translation.z = -1.0;
1194 q2.setEuler(1.0, 0.25, 0.5);
1195 tsb.transform.rotation.x = q2.x();
1196 tsb.transform.rotation.y = q2.y();
1197 tsb.transform.rotation.z = q2.z();
1198 tsb.transform.rotation.w = q2.w();
1201 geometry_msgs::TransformStamped tsc;
1202 tsc.header.frame_id =
"b";
1203 tsc.child_frame_id =
"c";
1204 tsc.transform.translation.x = 0.0;
1205 tsc.transform.translation.y = 2.0;
1206 tsc.transform.translation.z = 0.5;
1208 q3.setEuler(0.25, .75, 1.25);
1209 tsc.transform.rotation.x = q3.x();
1210 tsc.transform.rotation.y = q3.y();
1211 tsc.transform.rotation.z = q3.z();
1212 tsc.transform.rotation.w = q3.w();
1215 geometry_msgs::TransformStamped tsd;
1216 tsd.header.frame_id =
"c";
1217 tsd.child_frame_id =
"d";
1218 tsd.transform.translation.x = 0.5;
1219 tsd.transform.translation.y = -1;
1220 tsd.transform.translation.z = 1.5;
1222 q4.setEuler(-0.5, 1.0, -.75);
1223 tsd.transform.rotation.x = q4.x();
1224 tsd.transform.rotation.y = q4.y();
1225 tsd.transform.rotation.z = q4.z();
1226 tsd.transform.rotation.w = q4.w();
1229 btTransform ta, tb, tc, td, expected_ab, expected_bc, expected_cb, expected_ac, expected_ba, expected_ca, expected_ad, expected_da, expected_bd, expected_db, expected_rootd, expected_rootc;
1230 ta.setOrigin(btVector3(1.0, 1.0, 1.0));
1232 tb.setOrigin(btVector3(-1.0, 0.0, -1.0));
1234 tc.setOrigin(btVector3(0.0, 2.0, 0.5));
1236 td.setOrigin(btVector3(0.5, -1, 1.5));
1240 expected_ab = ta.inverse() * tb;
1241 expected_ac = ta.inverse() * tb * tc;
1242 expected_ad = ta.inverse() * tb * tc * td;
1243 expected_cb = tc.inverse();
1245 expected_bd = tc * td;
1246 expected_db = expected_bd.inverse();
1247 expected_ba = tb.inverse() * ta;
1248 expected_ca = tc.inverse() * tb.inverse() * ta;
1249 expected_da = td.inverse() * tc.inverse() * tb.inverse() * ta;
1250 expected_rootd = tb * tc * td;
1251 expected_rootc = tb * tc;
1298 TEST(BufferCore_lookupTransform, helix_configuration)
1322 double theta = 0.25;
1328 double dt = (
t - t0).toSec();
1329 double dt2 = (t2 - t0).toSec();
1331 geometry_msgs::TransformStamped ts;
1332 ts.header.frame_id =
"a";
1333 ts.header.stamp =
t;
1334 ts.child_frame_id =
"b";
1335 ts.transform.translation.z = vel * dt;
1336 ts.transform.rotation.w = 1.0;
1339 geometry_msgs::TransformStamped ts2;
1340 ts2.header.frame_id =
"b";
1341 ts2.header.stamp =
t;
1342 ts2.child_frame_id =
"c";
1343 ts2.transform.translation.x =
cos(theta * dt);
1344 ts2.transform.translation.y =
sin(theta * dt);
1346 q.setEuler(0,0,theta*dt);
1347 ts2.transform.rotation.z = q.z();
1348 ts2.transform.rotation.w = q.w();
1351 geometry_msgs::TransformStamped ts3;
1352 ts3.header.frame_id =
"a";
1353 ts3.header.stamp = t2;
1354 ts3.child_frame_id =
"d";
1355 ts3.transform.translation.z =
cos(theta * dt2);
1356 ts3.transform.rotation.w = 1.0;
1364 double dt = (
t - t0).toSec();
1365 double dt2 = (t2 - t0).toSec();
1368 EXPECT_NEAR(out_ab.transform.translation.z, vel * dt, epsilon);
1371 EXPECT_NEAR(out_ac.transform.translation.x,
cos(theta * dt), epsilon);
1372 EXPECT_NEAR(out_ac.transform.translation.y,
sin(theta * dt), epsilon);
1373 EXPECT_NEAR(out_ac.transform.translation.z, vel * dt, epsilon);
1375 q.setEuler(0,0,theta*dt);
1379 EXPECT_NEAR(out_ad.transform.translation.z,
cos(theta * dt), epsilon);
1381 geometry_msgs::TransformStamped out_cd = mBC.
lookupTransform(
"c",
"d", t2);
1382 EXPECT_NEAR(out_cd.transform.translation.x, -1, epsilon);
1383 EXPECT_NEAR(out_cd.transform.translation.y, 0, epsilon);
1384 EXPECT_NEAR(out_cd.transform.translation.z,
cos(theta * dt2) - vel * dt2, epsilon);
1386 mq.setEuler(0,0,-theta*dt2);
1391 for (
ros::Time t = t0 + half_step;
t < t1;
t += (step + step))
1394 double dt = (
t - t0).toSec();
1395 double dt2 = (t2 - t0).toSec();
1397 geometry_msgs::TransformStamped out_cd2 = mBC.
lookupTransform(
"c",
t,
"d", t2,
"a");
1398 EXPECT_NEAR(out_cd2.transform.translation.x, -1, epsilon);
1399 EXPECT_NEAR(out_cd2.transform.translation.y, 0, epsilon);
1400 EXPECT_NEAR(out_cd2.transform.translation.z,
cos(theta * dt2) - vel * dt, epsilon);
1402 mq2.setEuler(0,0,-theta*dt);
1408 TEST(BufferCore_lookupTransform, ring_45_configuration)
1411 rostest::Permuter permuter;
1413 std::vector<ros::Time> times;
1418 permuter.addOptionSet(times, &eval_time);
1420 std::vector<ros::Duration> durations;
1427 std::vector<std::string> frames;
1428 frames.push_back(
"a");
1429 frames.push_back(
"b");
1430 frames.push_back(
"c");
1431 frames.push_back(
"d");
1432 frames.push_back(
"e");
1433 frames.push_back(
"f");
1434 frames.push_back(
"g");
1435 frames.push_back(
"h");
1436 frames.push_back(
"i");
1445 std::string source_frame;
1446 permuter.addOptionSet(frames, &source_frame);
1448 std::string target_frame;
1449 permuter.addOptionSet(frames, &target_frame);
1451 while (permuter.step())
1455 setupTree(mBC,
"ring_45", eval_time, interpolation_space);
1457 geometry_msgs::TransformStamped outpose = mBC.
lookupTransform(source_frame, target_frame, eval_time);
1461 EXPECT_EQ(outpose.header.stamp, eval_time);
1462 EXPECT_EQ(outpose.header.frame_id, source_frame);
1463 EXPECT_EQ(outpose.child_frame_id, target_frame);
1468 if (source_frame == target_frame ||
1469 (source_frame ==
"a" && target_frame ==
"i") ||
1470 (source_frame ==
"i" && target_frame ==
"a") ||
1471 (source_frame ==
"a" && target_frame ==
"inverse_i") ||
1472 (source_frame ==
"inverse_i" && target_frame ==
"a") )
1475 EXPECT_NEAR(outpose.transform.translation.x, 0, epsilon);
1476 EXPECT_NEAR(outpose.transform.translation.y, 0, epsilon);
1477 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1478 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1479 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1480 EXPECT_NEAR(outpose.transform.rotation.z, 0, epsilon);
1481 EXPECT_NEAR(fabs(outpose.transform.rotation.w), 1, epsilon);
1484 else if ((source_frame ==
"a" && target_frame ==
"b") ||
1485 (source_frame ==
"b" && target_frame ==
"c") ||
1486 (source_frame ==
"c" && target_frame ==
"d") ||
1487 (source_frame ==
"d" && target_frame ==
"e") ||
1488 (source_frame ==
"e" && target_frame ==
"f") ||
1489 (source_frame ==
"f" && target_frame ==
"g") ||
1490 (source_frame ==
"g" && target_frame ==
"h") ||
1491 (source_frame ==
"h" && target_frame ==
"i")
1494 EXPECT_NEAR(outpose.transform.translation.x,
sqrt(2)/2 - 1, epsilon);
1495 EXPECT_NEAR(outpose.transform.translation.y,
sqrt(2)/2 , epsilon);
1496 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1497 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1498 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1499 EXPECT_NEAR(outpose.transform.rotation.z,
sin(M_PI/8), epsilon);
1500 EXPECT_NEAR(outpose.transform.rotation.w,
cos(M_PI/8), epsilon);
1503 else if ((source_frame ==
"b" && target_frame ==
"a") ||
1504 (source_frame ==
"c" && target_frame ==
"b") ||
1505 (source_frame ==
"d" && target_frame ==
"c") ||
1506 (source_frame ==
"e" && target_frame ==
"d") ||
1507 (source_frame ==
"f" && target_frame ==
"e") ||
1508 (source_frame ==
"g" && target_frame ==
"f") ||
1509 (source_frame ==
"h" && target_frame ==
"g") ||
1510 (source_frame ==
"i" && target_frame ==
"h")
1513 EXPECT_NEAR(outpose.transform.translation.x,
sqrt(2)/2 - 1, epsilon);
1514 EXPECT_NEAR(outpose.transform.translation.y, -
sqrt(2)/2 , epsilon);
1515 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1516 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1517 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1518 EXPECT_NEAR(outpose.transform.rotation.z,
sin(-M_PI/8), epsilon);
1519 EXPECT_NEAR(outpose.transform.rotation.w,
cos(-M_PI/8), epsilon);
1522 else if ((source_frame ==
"a" && target_frame ==
"c") ||
1523 (source_frame ==
"b" && target_frame ==
"d") ||
1524 (source_frame ==
"c" && target_frame ==
"e") ||
1525 (source_frame ==
"d" && target_frame ==
"f") ||
1526 (source_frame ==
"e" && target_frame ==
"g") ||
1527 (source_frame ==
"f" && target_frame ==
"h") ||
1528 (source_frame ==
"g" && target_frame ==
"i")
1531 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
1532 EXPECT_NEAR(outpose.transform.translation.y, 1 , epsilon);
1533 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1534 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1535 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1536 EXPECT_NEAR(outpose.transform.rotation.z,
sin(M_PI/4), epsilon);
1537 EXPECT_NEAR(outpose.transform.rotation.w,
cos(M_PI/4), epsilon);
1540 else if ((source_frame ==
"c" && target_frame ==
"a") ||
1541 (source_frame ==
"d" && target_frame ==
"b") ||
1542 (source_frame ==
"e" && target_frame ==
"c") ||
1543 (source_frame ==
"f" && target_frame ==
"d") ||
1544 (source_frame ==
"g" && target_frame ==
"e") ||
1545 (source_frame ==
"h" && target_frame ==
"f") ||
1546 (source_frame ==
"i" && target_frame ==
"g")
1549 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
1550 EXPECT_NEAR(outpose.transform.translation.y, -1 , epsilon);
1551 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1552 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1553 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1554 EXPECT_NEAR(outpose.transform.rotation.z,
sin(-M_PI/4), epsilon);
1555 EXPECT_NEAR(outpose.transform.rotation.w,
cos(-M_PI/4), epsilon);
1558 else if ((source_frame ==
"a" && target_frame ==
"d") ||
1559 (source_frame ==
"b" && target_frame ==
"e") ||
1560 (source_frame ==
"c" && target_frame ==
"f") ||
1561 (source_frame ==
"d" && target_frame ==
"g") ||
1562 (source_frame ==
"e" && target_frame ==
"h") ||
1563 (source_frame ==
"f" && target_frame ==
"i")
1566 EXPECT_NEAR(outpose.transform.translation.x, -1 -
sqrt(2)/2, epsilon);
1567 EXPECT_NEAR(outpose.transform.translation.y,
sqrt(2)/2 , epsilon);
1568 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1569 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1570 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1571 EXPECT_NEAR(outpose.transform.rotation.z,
sin(M_PI*3/8), epsilon);
1572 EXPECT_NEAR(outpose.transform.rotation.w,
cos(M_PI*3/8), epsilon);
1575 else if ((target_frame ==
"a" && source_frame ==
"d") ||
1576 (target_frame ==
"b" && source_frame ==
"e") ||
1577 (target_frame ==
"c" && source_frame ==
"f") ||
1578 (target_frame ==
"d" && source_frame ==
"g") ||
1579 (target_frame ==
"e" && source_frame ==
"h") ||
1580 (target_frame ==
"f" && source_frame ==
"i")
1583 EXPECT_NEAR(outpose.transform.translation.x, -1 -
sqrt(2)/2, epsilon);
1584 EXPECT_NEAR(outpose.transform.translation.y, -
sqrt(2)/2 , epsilon);
1585 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1586 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1587 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1588 EXPECT_NEAR(outpose.transform.rotation.z,
sin(-M_PI*3/8), epsilon);
1589 EXPECT_NEAR(outpose.transform.rotation.w,
cos(-M_PI*3/8), epsilon);
1592 else if ((source_frame ==
"a" && target_frame ==
"e") ||
1593 (source_frame ==
"b" && target_frame ==
"f") ||
1594 (source_frame ==
"c" && target_frame ==
"g") ||
1595 (source_frame ==
"d" && target_frame ==
"h") ||
1596 (source_frame ==
"e" && target_frame ==
"i")
1599 EXPECT_NEAR(outpose.transform.translation.x, -2, epsilon);
1600 EXPECT_NEAR(outpose.transform.translation.y, 0 , epsilon);
1601 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1602 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1603 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1604 EXPECT_NEAR(outpose.transform.rotation.z,
sin(M_PI/2), epsilon);
1605 EXPECT_NEAR(outpose.transform.rotation.w,
cos(M_PI/2), epsilon);
1608 else if ((target_frame ==
"a" && source_frame ==
"e") ||
1609 (target_frame ==
"b" && source_frame ==
"f") ||
1610 (target_frame ==
"c" && source_frame ==
"g") ||
1611 (target_frame ==
"d" && source_frame ==
"h") ||
1612 (target_frame ==
"e" && source_frame ==
"i")
1615 EXPECT_NEAR(outpose.transform.translation.x, -2, epsilon);
1616 EXPECT_NEAR(outpose.transform.translation.y, 0 , epsilon);
1617 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1618 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1619 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1620 EXPECT_NEAR(outpose.transform.rotation.z,
sin(-M_PI/2), epsilon);
1621 EXPECT_NEAR(outpose.transform.rotation.w,
cos(-M_PI/2), epsilon);
1624 else if ((source_frame ==
"a" && target_frame ==
"f") ||
1625 (source_frame ==
"b" && target_frame ==
"g") ||
1626 (source_frame ==
"c" && target_frame ==
"h") ||
1627 (source_frame ==
"d" && target_frame ==
"i")
1630 EXPECT_NEAR(outpose.transform.translation.x, -1 -
sqrt(2) /2, epsilon);
1631 EXPECT_NEAR(outpose.transform.translation.y, -
sqrt(2) /2 , epsilon);
1632 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1633 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1634 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1635 EXPECT_NEAR(outpose.transform.rotation.z,
sin(M_PI*5/8), epsilon);
1636 EXPECT_NEAR(outpose.transform.rotation.w,
cos(M_PI*5/8), epsilon);
1639 else if ((target_frame ==
"a" && source_frame ==
"f") ||
1640 (target_frame ==
"b" && source_frame ==
"g") ||
1641 (target_frame ==
"c" && source_frame ==
"h") ||
1642 (target_frame ==
"d" && source_frame ==
"i")
1645 EXPECT_NEAR(outpose.transform.translation.x, -1 -
sqrt(2)/2, epsilon);
1646 EXPECT_NEAR(outpose.transform.translation.y,
sqrt(2)/2 , epsilon);
1647 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1648 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1649 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1650 EXPECT_NEAR(outpose.transform.rotation.z,
sin(-M_PI*5/8), epsilon);
1651 EXPECT_NEAR(outpose.transform.rotation.w,
cos(-M_PI*5/8), epsilon);
1654 else if ((source_frame ==
"a" && target_frame ==
"g") ||
1655 (source_frame ==
"b" && target_frame ==
"h") ||
1656 (source_frame ==
"c" && target_frame ==
"i")
1659 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
1660 EXPECT_NEAR(outpose.transform.translation.y, -1 , epsilon);
1661 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1662 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1663 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1664 EXPECT_NEAR(outpose.transform.rotation.z,
sin(M_PI*6/8), epsilon);
1665 EXPECT_NEAR(outpose.transform.rotation.w,
cos(M_PI*6/8), epsilon);
1668 else if ((target_frame ==
"a" && source_frame ==
"g") ||
1669 (target_frame ==
"b" && source_frame ==
"h") ||
1670 (target_frame ==
"c" && source_frame ==
"i")
1673 EXPECT_NEAR(outpose.transform.translation.x, -1, epsilon);
1674 EXPECT_NEAR(outpose.transform.translation.y, 1 , epsilon);
1675 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1676 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1677 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1678 EXPECT_NEAR(outpose.transform.rotation.z,
sin(-M_PI*6/8), epsilon);
1679 EXPECT_NEAR(outpose.transform.rotation.w,
cos(-M_PI*6/8), epsilon);
1682 else if ((source_frame ==
"a" && target_frame ==
"h") ||
1683 (source_frame ==
"b" && target_frame ==
"i")
1686 EXPECT_NEAR(outpose.transform.translation.x,
sqrt(2)/2 - 1, epsilon);
1687 EXPECT_NEAR(outpose.transform.translation.y, -
sqrt(2)/2 , epsilon);
1688 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1689 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1690 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1691 EXPECT_NEAR(outpose.transform.rotation.z,
sin(M_PI*7/8), epsilon);
1692 EXPECT_NEAR(outpose.transform.rotation.w,
cos(M_PI*7/8), epsilon);
1695 else if ((target_frame ==
"a" && source_frame ==
"h") ||
1696 (target_frame ==
"b" && source_frame ==
"i")
1699 EXPECT_NEAR(outpose.transform.translation.x,
sqrt(2)/2 - 1, epsilon);
1700 EXPECT_NEAR(outpose.transform.translation.y,
sqrt(2)/2 , epsilon);
1701 EXPECT_NEAR(outpose.transform.translation.z, 0, epsilon);
1702 EXPECT_NEAR(outpose.transform.rotation.x, 0, epsilon);
1703 EXPECT_NEAR(outpose.transform.rotation.y, 0, epsilon);
1704 EXPECT_NEAR(outpose.transform.rotation.z,
sin(-M_PI*7/8), epsilon);
1705 EXPECT_NEAR(outpose.transform.rotation.w,
cos(-M_PI*7/8), epsilon);
1709 EXPECT_FALSE(
"Ring_45 testing Shouldn't get here");
1710 printf(
"source_frame %s target_frame %s time %f\n", source_frame.c_str(), target_frame.c_str(), eval_time.
toSec());
1716 TEST(BufferCore_lookupTransform, invalid_arguments)
1734 TEST(BufferCore_canTransform, invalid_arguments)
1768 TEST(BufferCore_transformableCallbacks, alreadyTransformable)
1773 geometry_msgs::TransformStamped
t;
1775 t.header.frame_id =
"a";
1776 t.child_frame_id =
"b";
1777 t.transform.rotation.w = 1.0;
1784 TEST(BufferCore_transformableCallbacks, waitForNewTransform)
1791 geometry_msgs::TransformStamped
t;
1792 for (uint32_t i = 1; i <= 10; ++i)
1795 t.header.frame_id =
"a";
1796 t.child_frame_id =
"b";
1797 t.transform.rotation.w = 1.0;
1811 TEST(BufferCore_transformableCallbacks, waitForOldTransform)
1818 geometry_msgs::TransformStamped
t;
1819 for (uint32_t i = 10; i > 0; --i)
1822 t.header.frame_id =
"a";
1823 t.child_frame_id =
"b";
1824 t.transform.rotation.w = 1.0;
2793 testing::InitGoogleTest(&argc, argv);
2796 return RUN_ALL_TESTS();
TransformableCallbackHandle addTransformableCallback(const TransformableCallback &cb)
void push_back_v(std::vector< std::string > &children, std::vector< std::string > &parents, std::vector< double > &dx, std::vector< double > &dy)
Time & fromNSec(uint64_t t)
bool setTransform(const geometry_msgs::TransformStamped &transform, const std::string &authority, bool is_static=false)
int main(int argc, char **argv)
uint32_t TransformableCallbackHandle
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
void push_back_1(std::vector< std::string > &children, std::vector< std::string > &parents, std::vector< double > &dx, std::vector< double > &dy)
bool check_y_result(const geometry_msgs::TransformStamped &outpose, const std::string &source_frame, const std::string &target_frame, const ros::Time &eval_time, double epsilon)
geometry_msgs::TransformStamped t
#define CHECK_TRANSFORMS_NEAR(_out, _expected, _eps)
bool canTransform(const std::string &target_frame, const std::string &source_frame, const ros::Time &time, std::string *error_msg=NULL) const
TransformableRequestHandle addTransformableRequest(TransformableCallbackHandle handle, const std::string &target_frame, const std::string &source_frame, ros::Time time)
INLINE Rall1d< T, V, S > sqrt(const Rall1d< T, V, S > &arg)
void setupTree(tf2::BufferCore &mBC, const std::string &mode, const ros::Time &time, const ros::Duration &interpolation_space=ros::Duration())
bool check_1_result(const geometry_msgs::TransformStamped &outpose, const std::string &source_frame, const std::string &target_frame, const ros::Time &eval_time, double epsilon)
TEST(BufferCore_setTransform, NoInsertOnSelfTransform)
void push_back_i(std::vector< std::string > &children, std::vector< std::string > &parents, std::vector< double > &dx, std::vector< double > &dy)
#define CHECK_QUATERNION_NEAR(_q1, _x, _y, _z, _w, _epsilon)
void setIdentity(geometry_msgs::Transform &trans)
void push_back_y(std::vector< std::string > &children, std::vector< std::string > &parents, std::vector< double > &dx, std::vector< double > &dy)
INLINE Rall1d< T, V, S > cos(const Rall1d< T, V, S > &arg)
bool check_v_result(const geometry_msgs::TransformStamped &outpose, const std::string &source_frame, const std::string &target_frame, const ros::Time &eval_time, double epsilon)
geometry_msgs::TransformStamped lookupTransform(const std::string &target_frame, const std::string &source_frame, const ros::Time &time) const
INLINE Rall1d< T, V, S > sin(const Rall1d< T, V, S > &arg)
uint64_t TransformableRequestHandle