30 #include <gtest/gtest.h> 38 timeval temp_time_struct;
39 gettimeofday(&temp_time_struct,NULL);
40 srand(temp_time_struct.tv_usec);
43 void generate_rand_vectors(
double scale, uint64_t runs, std::vector<double>& xvalues, std::vector<double>& yvalues, std::vector<double>&zvalues)
46 for ( uint64_t i = 0; i < runs ; i++ )
48 xvalues[i] = 1.0 * ((double) rand() - (double)RAND_MAX /2.0) /(double)RAND_MAX;
49 yvalues[i] = 1.0 * ((double) rand() - (double)RAND_MAX /2.0) /(double)RAND_MAX;
50 zvalues[i] = 1.0 * ((double) rand() - (double)RAND_MAX /2.0) /(double)RAND_MAX;
64 EXPECT_STREQ(
"id", tl.
resolve(
"id").c_str());
66 n.
setParam(
"tf_prefix",
"a_tf_prefix");
71 EXPECT_STREQ(
"a_tf_prefix", prefix_str.c_str());
73 EXPECT_STREQ(
"a_tf_prefix/id",
tf::resolve(prefix_str,
"id").c_str());
75 EXPECT_STREQ(
"a_tf_prefix/id", tp.
resolve(
"id").c_str());
81 int main(
int argc,
char **argv){
82 testing::InitGoogleTest(&argc, argv);
83 ros::init(argc, argv,
"transform_listener_unittest");
84 return RUN_ALL_TESTS();
std::string getPrefixParam(ros::NodeHandle &nh)
Get the tf_prefix from the parameter server.
ROSCPP_DECL void init(int &argc, char **argv, const std::string &name, uint32_t options=0)
std::string resolve(const std::string &prefix, const std::string &frame_name)
resolve tf names
void setParam(const std::string &key, const XmlRpc::XmlRpcValue &v) const