amcl does not subscribe to /base_scan and no map frame in tf tree.

asked 2019-07-11 05:51:37 -0500

aayushi gravatar image

updated 2019-07-11 05:58:30 -0500

Hello, I am trying to implementing a navigation stack for localization on the hardware of P3dx robot using ros kinetic and Kinect sensor getting the laser data. I am running the following commands

$ roslaunch freenect_launch freenect.launch depth_registration:=true
$ rosrun depthimage_to_laserscan depthimage_to_laserscan image:=/camera/depth_registered/image_raw
$ rosrun tf static_transform_publisher 0 0 0 0 0 0 base_link camera_link 100
$ roslaunch p3dx_navigation pioneer.launch
$ roslaunch p3dx_navigation rviz_p3dx.launch
$ roslaunch p3dx_navigation move_base_rosaria.launch
$ roswtf

I am using https://github.com/RiddhimanRaut/Pion... for navigation stack files

It gives the following errors shown in this picture https://drive.google.com/file/d/1-Ubj... and tf tree is like https://drive.google.com/file/d/12n9J...

please tell me the solution.

edit retag flag offensive close merge delete

Comments

amclby default subscribes to the topic /scan, not /base_scan.

The repo you link does not change that. So, if the topic of your laserscan message is /base_scan, you should remap that.

mgruhler gravatar image mgruhler  ( 2019-07-12 01:21:58 -0500 )edit

you mean that I have to add <remap from="/scan" to="base_scan"/> in move_base.launch file because when I am executing <rostopic echo="" scan=""> it is showing the data but in base_scan there is no data.

aayushi gravatar image aayushi  ( 2019-07-12 01:40:20 -0500 )edit

you need to make sure that your nodes subscribe to the correct topics. So far you have been talking about amcl and base_scan which is not the default. Did you change any of the files in the repo you link?

Check the outputs of rosnode info for amcl and rostopic info for /scan and /base_scan to check which node is publishing/subscribing to which of the topics. From the error you post (please don't use screenshots, just c'n'p the output of the terminal...) it is looking for base_scan, depthimage_to_laserscan by default publishes to the scan topic.

So it could be an issue that can be resolved by a remap.

mgruhler gravatar image mgruhler  ( 2019-07-12 07:05:49 -0500 )edit

I have not made any changes to the repo file.

$ rostopic info /scan Type: sensor_msgs/LaserScan

Publishers: * /depthimage_to_laserscan (http://192.168.1.3:36297/)

Subscribers: * /rviz (http://192.168.1.3:44171/)

$ rostopic info /base_scan Type: sensor_msgs/LaserScan

Publishers: None

Subscribers: * /amcl (http://192.168.1.3:42557/)

aayushi gravatar image aayushi  ( 2019-07-14 23:19:50 -0500 )edit

Alright, so you do need to check that the launch file that launches amcl does not add any remapping, or if it does not, you might have to add a remapping from base_scan to scan.

That being said: move_base_roasaria.launch from the link above includes this amcl launch file which does not have a remap, falling back to amcl default, which is scan for kinetic. Or are you using another distro?

mgruhler gravatar image mgruhler  ( 2019-07-15 06:57:31 -0500 )edit