Go to the documentation of this file.00001 #include <ros/ros.h>
00002 #include <tf/transform_broadcaster.h>
00003 #include <std_msgs/Float64.h>
00004 #include <math.h>
00005 tf::TransformBroadcaster* p_broadcaster;
00006
00013 int main(int argc, char** argv)
00014 {
00015 ros::init(argc, argv, "tf_generator_node");
00016 ros::NodeHandle n;
00017 tf::TransformBroadcaster broadcaster;
00018 p_broadcaster=& broadcaster;
00019 ros::Rate r(10);
00020
00021 double theta=0;
00022 int inc=0;
00023 while(n.ok())
00024 {
00025 theta=inc*(2*M_PI)/1000;
00026
00027 tf::Transform transform(btMatrix3x3(cos(theta),-sin(theta),0, sin(theta),cos(theta),0, 0,0,1),
00028 btVector3(2.5*cos(theta), 2.5*sin(theta), 0.0));
00029
00030 p_broadcaster->sendTransform(tf::StampedTransform(transform, ros::Time::now(), "/world", "/vehicle_odometry"));
00031 r.sleep();
00032 ros::spinOnce();
00033
00034 }
00035 }