amcl: No laser scan received (and thus no pose updates have been published) for xxxx seconds ?
Hello,
I'm using ROS kinectic on ubuntu 16.04 on an HP laptop. I made my own "real/physical" 2WD robot, and now I want to use ROS navigation stack to get it to move around autonomously. I'm currently struggling with the real robot. Typical behavior is that after the robot accepts a 2DNav goal, it starts navigating to the goal, then hesidates, rotates on himself, then continues rotating forever. A friend of mine suggested to model my physical environment in gazebo, then use the ROS navigation stack in gazebo, tune the navigation parameters until it works decently in gazebo, then reuse those navigation parameters for the real robot.
So here I am, struggling to get the simulated robot to navigate.
Firing gazebo works. the world I created is ok. 2WD plugin of gazebo feels fine when i teleop it with a keyboard. The mapping process worked just fine. I publish the previously recorded map, it works. The published /odom and /scan values seems correct too. I can see them in rviz as expected. rostopic echo /scan and rostopic echo /odom feels fine as well.
The problem is that when I launch amcl, I keep getting the following warning:
[ WARN] [1537204065.051924673, 3433.606000000]: No laser scan received (and thus no pose updates have been published) for 34139472.000000 seconds. Verify that data is being published on the /scan topic. [ WARN] [1537204080.975562709, 3448.606000000]: No laser scan received (and thus no pose updates have been published) for 34139472.000000 seconds. Verify that data is being published on the /scan topic. [ WARN] [1537204096.883037473, 3463.606000000]: No laser scan received (and thus no pose updates have been published) for 34139472.000000 seconds. Verify that data is being published on the /scan topic. [...]
Here is a typical /scan message (taken somehow later)
user@ubuntu:~$ rostopic info /scan Type: sensor_msgs/LaserScanPublishers: * /gazebo (http://ubuntu:40085/)
Subscribers: * /amcl (http://ubuntu:38221/)
user@ubuntu:~$ rostopic echo -n 1 /scan header: seq: 42106 stamp: secs: 4001 nsecs: 770000000 frameid: "sensorlaser" anglemin: 0.0 anglemax: 6.27319002151 angleincrement: 0.0174740664661 timeincrement: 0.0 scantime: 0.0 rangemin: 0.10000000149 range_max: 18.0 ranges: [0.14208605885505676, 0.11974052339792252, ..., 1.9066493511199951, 1.8749361038208008]
intensities: [-3.16707076146899e+24, ... , 0.0]
user@ubuntu:~$
When i look into the node, it seems amcl is indeed connected to /scan.
user@ubuntu:~$ rosnode info amcl
Node [/amcl] Publications: * /amcl/parameterdescriptions [dynamicreconfigure/ConfigDescription] * /amcl/parameterupdates [dynamicreconfigure/Config] * /amclpose [geometrymsgs/PoseWithCovarianceStamped] * /particlecloud [geometrymsgs/PoseArray] * /rosout [rosgraphmsgs/Log] * /tf [tf2_msgs/TFMessage]
Subscriptions: * /clock [rosgraphmsgs/Clock] * /initialpose [unknown type] * /map [navmsgs/OccupancyGrid] * /scan [sensormsgs/LaserScan] * /tf [tf2msgs/TFMessage] * /tfstatic [tf2msgs/TFMessage]
Services: * /amcl/getloggers * /amcl/setloggerlevel * /amcl/setparameters * /globallocalization * /requestnomotionupdate * /setmap
contacting node http://ubuntu:38221/ ... Pid: 20339 Connections: * topic: /rosout * to: /rosout * direction: outbound * transport: TCPROS * topic: /tf * to: /amcl * direction: outbound * transport: INTRAPROCESS * topic: /clock * to: /gazebo (http://ubuntu:40085/) * direction: inbound * transport: TCPROS * topic: /tf * to: /amcl (http://ubuntu:38221/) * direction: inbound * transport: INTRAPROCESS * topic: /tf * to: /robotstatepublisher (http://ubuntu:33029/) * direction: inbound * transport: TCPROS * topic: /tf * to: /gazebo (http://ubuntu:40085/) * direction: inbound * transport: TCPROS * topic: /tfstatic * to: /robotstatepublisher (http://ubuntu:33029/) * direction: inbound * transport: TCPROS * topic: /scan * to: /gazebo (http://ubuntu:40085/) * direction: inbound * transport: TCPROS * topic: /map * to: /mapserver_1537203380314611704 (http://ubuntu:33768/) * direction: inbound * transport: TCPROS
user@ubuntu:~$
I tried outputting the /clock values as well, and I see nothing partiulcarly wrong there (except maybe that time seems to start at 1000seconds... go figure)
And indeed, when i try to view the tf tree with rosrun tf view_frames => the link between map and odom is missing, whereas i expect amcl to publish it.
I'm guessing that amcl is either not receiving /scan events and filtering them all (no laser scan received for 34139472 seconds feels a lot like none were ever received)=> therefore published no map->odom tf.
while increasing the verbosity of amcl from default info to debug (*), i see those debug messages, but i have no clue what they mean
[DEBUG] [1537204573.964568814, 3913.317000000]: MessageFilter [target=odom ]: Removed oldest message because buffer is full, count now 100 (frame_id=sensor_laser, stamp=3908.290000) [DEBUG] [1537204573.964899783, 3913.317000000]: MessageFilter [target=odom ]: Added message in frame sensor_laser at time 3913.294, count now 100 [DEBUG] [1537204574.025497198, 3913.368000000]: MessageFilter [target=odom ]: Removed oldest message because buffer is full, count now 100 (frame_id=sensor_laser, stamp=3908.340000) [DEBUG] [1537204574.025600379, 3913.368000000]: MessageFilter [target=odom ]: Added message in frame sensor_laser at time 3913.344, count now 100 [DEBUG] [1537204574.049464305, 3913.388000000]: Incoming queue was full for topic "/clock". Discarded oldest message (current queue size [0]) [DEBUG] [1537204574.054565708, 3913.392000000]: Incoming queue was full for topic "/clock". Discarded oldest message (current queue size [0]) [DEBUG] [1537204574.066972159, 3913.403000000]: Incoming queue was full for topic "/clock". Discarded oldest message (current queue size [0]) [DEBUG] [1537204574.086864841, 3913.420000000]: MessageFilter [target=odom ]: Removed oldest message because buffer is full, count now 100 (frame_id=sensor_laser, stamp=3908.390000) [DEBUG] [1537204574.086959735, 3913.420000000]: MessageFilter [target=odom ]: Added message in frame sensor_laser at time 3913.393, count now 100 [DEBUG] [1537204574.133658368, 3913.453000000]: MessageFilter [target=odom ]: Removed oldest message because buffer is full, count now 100 (frame_id=sensor_laser, stamp=3908.440000) [DEBUG] [1537204574.133732163, 3913.453000000]: MessageFilter [target=odom ]: Added message in frame sensor_laser at time 3913.442, count now 100 [DEBUG] [1537204574.182417016, 3913.491000000]: Incoming queue was full for topic "/clock". Discarded oldest message (current queue size [0])
(*) if someone knows how to default to debug so that i can see what's going on as the amcl node starts => plz let me know)
some environment parameters that may apply
user@ubuntu:~$ printenv | grep -i ros ROSROOT=/opt/ros/kinetic/share/ros ROSPACKAGEPATH=/home/user/catkinws/src:/opt/ros/kinetic/share ROSMASTERURI=http://localhost:11311 ROSVERSION=1 LDLIBRARYPATH=/home/user/catkinws/devel/lib:/opt/ros/kinetic/lib:/opt/ros/kinetic/lib/x8664-linux-gnu PATH=/home/user/bin:/home/user/.local/bin:/opt/ros/kinetic/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games:/snap/bin ROSLISPPACKAGEDIRECTORIES=/home/user/catkinws/devel/share/common-lisp ROSDISTRO=kinetic PYTHONPATH=/home/user/catkinws/devel/lib/python2.7/dist-packages:/opt/ros/kinetic/lib/python2.7/dist-packages PKGCONFIGPATH=/home/user/catkinws/devel/lib/pkgconfig:/opt/ros/kinetic/lib/pkgconfig:/opt/ros/kinetic/lib/x8664-linux-gnu/pkgconfig CMAKEPREFIXPATH=/home/user/catkinws/devel:/opt/ros/kinetic ROSETC_DIR=/opt/ros/kinetic/etc/ros user@ubuntu:~$
How can I get rid of the No laser scan received (and thus no pose updates have been published) for xxxx seconds ?
Asked by fourchette on 2018-09-17 12:36:12 UTC
Answers
I am using ROS Melodic, Ubuntu 18.04. I am getting the same warning. However, the warning shows up just in the beginning. After that, everything seems to work as expected - I am able to move the robot around and I see that the robot is trying to localize in Rviz.
Asked by PKGosal on 2020-07-24 22:50:56 UTC
Comments
This is maybe a bit late but I had the same issue. The issue for me was the parameter "odom_frame_id" in the amcl node. Initially it's being set to "odom" by default, but mine was "nav" because of a tutorial I followed to set up hector SLAM. After changing that I didn't hit this error (which is quite misleading because clearly nothing was wrong with the scans) and got the red little arrows showing up in my rviz.
Asked by Patricia2602 on 2020-10-27 12:39:54 UTC
Comments
Can you provide your launch files or the different
rosrun
you use ? Are you launching themap_server
node ?Also AMCL needs odometry information but you don't seem to get them. #q229978 might help you.
Asked by Delb on 2018-09-18 04:39:43 UTC
all my code for this project is on github. the launch file is https://github.com/alexisdal/mnwlk3r/blob/master/mnwlk3r_ros/mnwlk3r_simulation/launch/navigation.launch however, I also tried to launch each node from command line to simplify at least. to no avail. i feel lost. gazebo does publish odom
Asked by fourchette on 2018-09-18 07:31:02 UTC
I would change two things :
<arg name="z" default="0.5"/>
to 0 instead (because you didn't set AMCL to the same initial pose<arg name="map_file" value="$(find mnwlk3r_simulation)/maps/fablab_sim.yaml"/>
inside the includeAsked by Delb on 2018-09-18 07:42:53 UTC
Try also adding this to amcl.launch (with the correct map arg):
Asked by Delb on 2018-09-18 07:53:21 UTC
Sorry I made a mistake don't add anything in
gazebo.launch
.Asked by Delb on 2018-09-18 08:19:19 UTC
I tried running your project with
roslaunch mnwlk3r_simulation navigation.launch
(after i added themap_server
node inamcl.launch
) and I got the same warning one time but after that the robot was in gazebo and i could visualize the scan with rvizAsked by Delb on 2018-09-18 10:04:24 UTC
indeed i agree the map server wasn't included in the launch file because i was starting it with a seperate one liner i did not mention. however, i tried what you suggest: to no avail. i continue to have this stupid "No laser scan received" message and map->odom does not appear in my tf tree.
Asked by fourchette on 2018-09-19 03:38:31 UTC
i feel desperate. i'm sure it's something stupid. can you please kindly offer a push request on github?
Asked by fourchette on 2018-09-19 03:39:25 UTC
Even when adding this in amcl.launch you still have no connection map->odom ?
Asked by Delb on 2018-09-19 04:19:06 UTC
Try also adding
<param name="global_frame_id" value="map"/>
inside node amcl tagAsked by Delb on 2018-09-19 04:20:28 UTC
Did you solve this? I currently have the same problem.
Asked by Julian98 on 2020-07-25 11:08:14 UTC
I currently have the same problem.
Asked by Kash on 2020-07-25 12:59:11 UTC
@fourchette were you able to solve the problem?? I am currently facing the very same problem.
Asked by Raza Jafri on 2020-08-23 11:36:22 UTC