Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/hydra4/decoders/pandar_xt32.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ def __call__(self, packet: pandar_msgs__msg__PandarPacket) -> Generator[Block, N
intensity,
ring,
azimuth,
timestamp.timestamp() + block_offset[block_id] + self.firing_offset[ring],
timestamp.timestamp()
+ block_offset[block_id] * 1e-6
+ self.firing_offset[ring],
)
)

Expand Down
9 changes: 9 additions & 0 deletions tests/integration/test_xt32_decoder.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,15 @@ def test_point_azimuth_matches_block_azimuth(
for _, _, _, _, _, pt_az, _ in block.points:
assert pt_az == block.azimuth

def test_point_timestamps_within_packet_are_microseconds_apart(
self, decoder: PandarXT32, sample_packets: list
) -> None:
"""Block and channel firing offsets are measured in microseconds."""
points = [point for block in decoder(sample_packets[0]) for point in block.points]
stamps = [point[-1] for point in points]

assert max(stamps) - min(stamps) < 0.001


class TestXT32DistanceFilter:
def test_tighter_min_distance_filters_more(self, pandar_packets_xt32: list) -> None:
Expand Down