Robotics StackExchange | Archived questions

Hokuyo Laser Scan seq not continous

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.

Asked by AutoCar on 2019-02-14 18:30:36 UTC

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.

Asked by Delb on 2019-02-15 03:39:13 UTC

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

Asked by AutoCar on 2019-05-21 13:31:00 UTC

Answers