I want to make a turtle pursue other turtle. And I also want to use geometry message twist. I dont know what is the problem of my code!!
these are my functions that print the position of my turtles but there is a problem! when i run it the printed positions are same but in fact they are not!
void chatterCallback(const turtlesim::Pose::ConstPtr& msg)
{
m=x;
n=y;
x=msg->x;
y=msg->y;
ROS_INFO("I heard: [%f],[%f]", x,y);
}
void chatterCallback1(const turtlesim::Pose::ConstPtr& msg)
{
a=msg->x;
b=msg->y;
ROS_INFO("ey baba: [%f],[%f]",a,b);
}
You may want to take a look at this tutorial: http://wiki.ros.org/tf/Tutorials/Writ...
I think that what you posted is not enough to answer your question, please update your question with minimal working example to allow other reproduce your problem.