Skip to content

Commit

Permalink
CDAR-756: Carla Ambassador correct detection timestamp
Browse files Browse the repository at this point in the history
  • Loading branch information
paulbourelly999 committed Feb 1, 2024
1 parent 6b91fc4 commit f66b312
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,10 @@ public synchronized void processTimeAdvanceGrant(long time) throws InternalFeder
for (DetectorRegistration registration: registeredDetectors ) {
DetectedObject[] detections = carlaXmlRpcClient.getDetectedObjects( registration.getInfrastructureId() , registration.getDetector().getSensorId());
for (DetectedObject detected: detections) {
detectedObjectInteractions.add(new DetectedObjectInteraction(time, detected));
DetectedObjectInteraction interaction = new DetectedObjectInteraction(time, detected);
// Convert nanosecond timestamp to millisecond timestamp
interaction.getDetectedObject().setTimestamp((int)(time/1e6));
detectedObjectInteractions.add(interaction);
}
}
// trigger all detection interactions
Expand Down

0 comments on commit f66b312

Please sign in to comment.