Hello,
I have a tf frame named /base_link which is part of the turtlebot 2. I am trying to take the information that the /base_link frame contains such as its position(xyz) and its orientation(rpy) and broadcast this info to a new tf frame. The reason why I am doing this is because I could not tf_remap to work. So I am thinking that the next step is to create a broadcaster that sends out this info as a new name. I am highly confused of what info goes where. Below is the code that I have so far. I grabbed this info from the tf tutorials available on the wiki page.
#include
#include
void poseCallback( ){ //don't know what to pass through
static tf::TransformBroadcaster br;
tf::Transform transform;
transform.setOrigin( tf::Vector3(msg->x, msg->y, 0.0) );
transform.setRotation( tf::Quaternion(msg->theta, 0, 0) );
br.sendTransform(tf::StampedTransform(transform, ros::Time::now(), "base_footprint", "base_link")); //don't know what to pass through
}
int main(int argc, char** argv){
ros::init(argc, argv, "my_tf_broadcaster");
ros::NodeHandle node;
ros::Subscriber sub = node.subscribe("move_base/pose", 10, &poseCallback);
ros::spin();
return 0;
};
↧