amcl localisation on custom made bot
Hi! This is part of my final year project work. I am facing multiple problems and i need help. I am aiming to build a robot that can localize itself on a known map and navigate to certain given points on the map. The robot has the basic structure as mentioned in navigation stack tutorial. Here for publishing the odometry, I have used wheel encoders and receiving them from an arduino board via serial.
I am publishing a already generated map using map_server
. In order to localize the robot on this map i am planning to use amcl
. On rviz, when i set the fixed frame as /map
it displays the correct map but shows an error that fixed frame doesnot exist. For publishing the transform i have used exactly the same code as mentioned on tf_broadcaster tutorial. How to get amcl working so that i can localise my robot?? I am getting laser scans on topic /scan
.
- Is it necessary to have a urdf model of robot before i can do localisation?
- How can i transform data from this /scan topic to base_link as mentioned in tutorial?
the fixed frame
\map
does only exist if amcl is working correctly (amcl calculates the transformations\map
->odom
).rosrun tf view_frames
and post the result tf-treeAre you broadcasting a transform between /world and /map? If not, try again with a static transform between world and map.
Thank you for your help. Here i am posting the tf view_frame file. https://drive.google.com/file/d/0B5QB...
Please elaborate about the transforms needed.
@bahrgav: although you dont have a transformation between /scan and /base_link you should be able to see the scan-frame in your frames.pdf (even it is not connected to the tf-tree). are you publishing laserscandata by yourself or using an existing node?
are you sure you dont mix the meaning of topics and frames?
The view_frame file looks fine. You have got all the transforms needed. However, the amcl needs a transform between world coordinates and map coordinates as \map represents a fixed frame in the world. Add the following node in the launch file.
<node pkg="tf" type="static_transform_publisher" name="map_broadcaster" args="0 0 0 0 0 0 1 world map 100"/> Let me know if this solves your problem of "fixed frame does not exist". Similarly,I published a static transform between base_link(parent) and base_link_laser to avoid using camera frame.
@Hemu: not true! amcl is for localization on a map. that means it calculates the transformation between map and odom. in this case, odom has to be avaiable and map is going to be, as you call it, the world frame
@lebowski I am using a node called depthimage_to_laserscan to publish the laserscan.
@lebowski about your second ques "are you sure you dont mix the meaning of topics and frames?" probably yes! I am not able to get data from /scan topic and transform it to /base_link. I have a node identical to tf_listener as mentioned here
But i don't know how to get data from /scan topic and feed it to this node.
@Bhargav Can you tell me if the "fixed frame" problem was solved or not?
@Hemu i am trying it now. By the way can you explain the argument used in static transform?