pf_lidar_ros_driver icon indicating copy to clipboard operation
pf_lidar_ros_driver copied to clipboard

feat: add time_offset parameter

Open jadhm opened this issue 4 years ago • 10 comments

Hi,

I sent a pull request #36 to add a new parameter time_offset in case there is latency.

Regards, Jad

jadhm avatar Nov 30 '20 15:11 jadhm

https://github.com/PepperlFuchs/ROS_driver/pull/36#issuecomment-736545604

hsd-dev avatar Dec 01 '20 13:12 hsd-dev

@ipa-hsd could you please take a look at the pull request ?

jadhm avatar Mar 18 '21 10:03 jadhm

ping @ipa-hsd

jadhm avatar Mar 22 '21 10:03 jadhm

Though time offset is an issue, but the solution is not acceptable. It does not make sense to add a user-defined time offset.

hsd-dev avatar Mar 22 '21 12:03 hsd-dev

@ipa-hsd I see your point but if you looked at other drivers of other sensors you would see that they also have this parameter for solving latency. This is an example of the sick driver https://github.com/SICKAG/sick_safetyscanners/blob/cfa456e78af42b82c1031354864837a798add4a7/config/SickSafetyscannersConfiguration.cfg#L20

jadhm avatar Mar 25 '21 07:03 jadhm

Yes I have seen that and realized that was the basis of this PR. But does not necessarily mean it is a good solution.

Also ROS time is completely different from the device time. A ROS system is made up not just of laser scanner, but might involve many hardware and software components. Imagine if every hardware and software component modifies ROS time as per it's own clock.

The packet header is being published on /r2x00_header topic which has the same sequence number as in the PointCloud2 message. Probably you can use message_filters to filter messages from both topics as per the sequence number.

hsd-dev avatar Mar 25 '21 07:03 hsd-dev

I might be wrong. The REP does mention calibrate_time and time_offset.

hsd-dev avatar Mar 25 '21 16:03 hsd-dev

@ipa-hsd dealing with latency is a bit tricky but a parameter for fine tuning should be possible. Would you be open for re opening my PR ?

jadhm avatar Mar 26 '21 07:03 jadhm

@ipa-hsd , just to clarify: Nobody is altering the ros::Time. The ros::Time is determined by the system clock if /use_sim_time parameter in the global namespace is false. If true, the ros::Time is determined by a ClockPublisher that publishes on the /clock topic. This additional time_offset parameter is only required for manually adjusting the timestamps of the incoming sensor readings. If ros::Time::now() is used, it means that the sensor reading was created at the current time. However, this is ofcourse not the case since the message was created x seconds ago due to a acquisition and communication delay. The time_offset in sensor drivers is often introduces to cope for these "unmeasurable" delays. Hope this clears things up.

reinzor avatar Mar 26 '21 12:03 reinzor

@ipa-hsd any updates on this?

reinzor avatar Apr 12 '21 06:04 reinzor