amcl localisation on custom made bot

asked 2014-11-04 15:56:02 -0500

Bhargav gravatar image

updated 2014-11-05 11:32:47 -0500

ahendrix gravatar image

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?
edit retag flag offensive close merge delete

Comments

the fixed frame \map does only exist if amcl is working correctly (amcl calculates the transformations \map -> odom).

  • urdf model is not necessary
  • did u manage the transformation or not? please run rosrun tf view_frames and post the result tf-tree
lebowski gravatar image lebowski  ( 2014-11-04 16:48:46 -0500 )edit

Are you broadcasting a transform between /world and /map? If not, try again with a static transform between world and map.

Hemu gravatar image Hemu  ( 2014-11-05 06:18:33 -0500 )edit

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.

Bhargav gravatar image Bhargav  ( 2014-11-05 06:57:29 -0500 )edit

@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?

lebowski gravatar image lebowski  ( 2014-11-05 07:49:41 -0500 )edit

are you sure you dont mix the meaning of topics and frames?

lebowski gravatar image lebowski  ( 2014-11-05 07:49:58 -0500 )edit

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.

Hemu gravatar image Hemu  ( 2014-11-05 09:29:26 -0500 )edit

<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 gravatar image Hemu  ( 2014-11-05 09:37:40 -0500 )edit

@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 gravatar image lebowski  ( 2014-11-05 10:32:24 -0500 )edit

@lebowski I am using a node called depthimage_to_laserscan to publish the laserscan.

Bhargav gravatar image Bhargav  ( 2014-11-05 10:51:45 -0500 )edit

@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

Bhargav gravatar image Bhargav  ( 2014-11-05 11:04:28 -0500 )edit

But i don't know how to get data from /scan topic and feed it to this node.

Bhargav gravatar image Bhargav  ( 2014-11-05 11:05:13 -0500 )edit

@Bhargav Can you tell me if the "fixed frame" problem was solved or not?

Hemu gravatar image Hemu  ( 2014-11-05 11:08:05 -0500 )edit

@Hemu i am trying it now. By the way can you explain the argument used in static transform?

Bhargav gravatar image Bhargav  ( 2014-11-05 11:17:35 -0500 )edit