Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move stamping closer to data reading. #104

Merged
merged 2 commits into from
Feb 23, 2023
Merged

Conversation

ValerioMagnago
Copy link
Contributor

@ValerioMagnago ValerioMagnago commented Feb 20, 2023

At the moment the timestamp is added just before the data is published ( https://github.com/PepperlFuchs/pf_lidar_ros_driver/pull/104/files#diff-db3fd72df08186f3c4adfeb4c26aa1eb5526a4781c16d0603ff879d0fd2f2b86L81 ).

Synchronisation of the ROS system with the scanner, as requested in #23, is beyond the scope of this PR.
But the attempt here is to reduce the number of approximations by stamping the data when it is parsed. This time is closer to the ideal time at which the last scan point was sampled than the publication time. Also, since the stamp of the LaserScan message (http://docs.ros.org/en/api/sensor_msgs/html/msg/LaserScan.html) is the time of the first beam captured, it makes sense to remove the scan_time from the timestamp. If we do not do this, we will have more and more delays the longer the scan time is.

@ValerioMagnago ValerioMagnago changed the title Move stamping close to data reading. Move stamping closer to data reading. Feb 20, 2023
@hsd-dev
Copy link
Contributor

hsd-dev commented Feb 20, 2023

@ValerioMa thanks for the PR, makes sense. LGTM 👍

@ptruka FYI

hsd-dev and others added 2 commits February 22, 2023 14:20

Verified

This commit was created on github.com and signed with GitHub’s verified signature. The key has expired.
Before this commit the scan message was stamped just before publishing the
data. In the LaserScan message of ros the timestamp in the header is
the acquisition time of the first ray in the scan.
@hsd-dev
Copy link
Contributor

hsd-dev commented Feb 23, 2023

behind #109

@ptruka ptruka merged commit ffbc656 into PepperlFuchs:main Feb 23, 2023
MichaelGrupp added a commit to MichaelGrupp/pf_lidar_ros_driver that referenced this pull request May 10, 2024
The previous timestamp patch in PR PepperlFuchs#104 subtracted the full scan time
from the last point time of the _first_ packet to determine the scan
timestamp.

It has to be the time for a single packet instead. Otherwise, the
timestamp is too far in the past.

This is especially noticeable when the scan frequency is in a lower
range like 10Hz, i.e. the scan timestamp would be 100ms off compared to
other sensor modalities.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants