amcl does not subscribe to /base_scan and no map frame in tf tree.
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.
amcl
by 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.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.
you need to make sure that your nodes subscribe to the correct topics. So far you have been talking about
amcl
andbase_scan
which is not the default. Did you change any of the files in the repo you link?Check the outputs of
rosnode info
foramcl
androstopic 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 forbase_scan
,depthimage_to_laserscan
by default publishes to thescan
topic.So it could be an issue that can be resolved by a remap.
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/)
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 frombase_scan
toscan
.That being said:
move_base_roasaria.launch
from the link above includes thisamcl
launch file which does not have a remap, falling back toamcl
default, which isscan
for kinetic. Or are you using another distro?