Skip to content

PointCloud Display keeps more than just the latest message when decay time is 0 #1399

@StefanFabian

Description

@StefanFabian

A decay time of 0 should only keep the latest points.
However, as it is currently implemented, if multiple messages are queued at the same time (I am not sure why that happens; my point clouds only come with 10Hz, but I'm still experiencing it), the display will show more than just the last message.

This is caused by the following lines:

bool PointCloudCommon::cloudInfoIsDecayed(
CloudInfoPtr cloud_info, float point_decay_time, const rclcpp::Time & now)
{
return (now.nanoseconds() - cloud_info->receive_time_.nanoseconds()) / 1000000000.0 >
point_decay_time;
}

Changing this to >= fixes the issue and should not make a difference for non-zero decay times in real-world usage since it's a floating point number and the likelihood of them being equal for a non-zero value is close to zero.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions