rosrun tf tf_echo /map /base_link VS. Coding implementation. [closed]
Hi,
I want to calculate robot's current position with respect to the map. Following is my "rosrun tf view_frames"
I have tried following commands which gives robot position with respect to /map frame.
rosrun tf tf_echo /map /base_link
Output is here:map to base_link.jpg
Now same thing, I tried to perform using the code here
But the output of rxconsole is shown below:: transform.jpg.
I am just wondering why the results of the code and that of "rosrun tf tf_echo /map /base_link" is not matching?
I am getting "Got a transform! x = 0.000000, y =0.000000", even after 1sec when I use the code. But "rosrun tf tf_echo /map /base_link", gives actual robot position with respect to the map as you can see the screen shot.
Question1: Is there any way to get the exact position of the robot while moving in the environment?
Question 2: I don’t know how the above command gives position of the robot with respect to the map, but the implementation of the SAME COMMAND gives some INVALID result?
Question 3: Is there any way to emulate the command "rosrun tf tf_echo /map /base_link" in coding?
Please help..........
Many Thanks.
Hi, is it possible that you share the code via another method? I have no access to pastebin.com and I didn't manage to overcome it. Thanks in advance!