39 #include <gtest/gtest.h> 42 #include <geometry_msgs/TransformStamped.h> 43 #include <boost/thread/thread.hpp> 81 ROS_INFO(
"Waiting for bag to complete");
85 ASSERT_TRUE(buffer.
canTransform(
"base_link",
"r_gripper_palm_link",
Time()));
86 ASSERT_TRUE(buffer.
canTransform(
"base_link",
"r_gripper_palm_link",
Time()));
87 ASSERT_TRUE(buffer.
canTransform(
"l_gripper_palm_link",
"r_gripper_palm_link",
Time()));
88 ASSERT_TRUE(buffer.
canTransform(
"l_gripper_palm_link",
"fl_caster_r_wheel_link",
Time()));
91 geometry_msgs::TransformStamped t = buffer.
lookupTransform(
"base_link",
"r_gripper_palm_link",
Time());
92 EXPECT_NEAR(t.transform.translation.x, 0.769198,
EPS);
93 EXPECT_NEAR(t.transform.translation.y, -0.188800,
EPS);
94 EXPECT_NEAR(t.transform.translation.z, 0.764914,
EPS);
97 EXPECT_NEAR(t.transform.translation.x, 0.000384222,
EPS);
98 EXPECT_NEAR(t.transform.translation.y, -0.376021,
EPS);
99 EXPECT_NEAR(t.transform.translation.z, -1.0858e-05,
EPS);
SUCCEED();
103 int main(
int argc,
char** argv)
105 testing::InitGoogleTest(&argc, argv);
106 ros::init(argc, argv,
"test_robot_state_publisher");
110 int res = RUN_ALL_TESTS();
TEST_F(TestPublisher, test)
virtual geometry_msgs::TransformStamped lookupTransform(const std::string &target_frame, const std::string &source_frame, const ros::Time &time, const ros::Duration timeout) const
int main(int argc, char **argv)
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
~TestPublisher()
Destructor.
JointStateListener * publisher
TestPublisher()
constructor
virtual bool canTransform(const std::string &target_frame, const std::string &source_frame, const ros::Time &target_time, const ros::Duration timeout, std::string *errstr=NULL) const