Hokuyo Laser Scan seq not continous

asked 2019-02-14 17:30:36 -0500

AutoCar gravatar image

updated 2019-02-14 19:43:20 -0500

jayess gravatar image

Hi, my robot car has a Jetson tx2 board and a Hokuyo lidar. My car subscribes to the lidar message with a queue size of 1:

_subScan = _nh.subscribe("/scan",     1, &scanCallback, this);

And in the laser scan callback, I just check the scan message seq id, I do not do anything else. However, I found the seq was not continuous, it was like 1084, 1096, 1099, 1100, 1101. Does this mean I was losing scan message? Why? Since I do not do anything else, there should be enough CPU to catch all messages.

edit retag flag offensive close merge delete

Comments

Yes you lose messages because the queue size is too low. I'm not sure why exactly though but I would guess it's because you have to empty the queue after every message received and that could induce the message loss.

You just have to increase the queue size to receive all the messages correctly.

Delb gravatar imageDelb ( 2019-02-15 02:39:13 -0500 )edit

I have increase the queue size to 4, but still missing scans

AutoCar gravatar imageAutoCar ( 2019-05-21 13:31:00 -0500 )edit