Class LSDAlertManager
- Last UpdatedMar 28, 2025
- 3 minute read
- java.lang.Object
-
- com.here.see.livesense.ar_lib.alerts.LSDAlertManager
-
public class LSDAlertManager extends Object
LSDAlertManager contains heuristics for alerting user of possible hazards in their path.
-
-
Field Summary
Fields Modifier and Type Field and Description LSDWeakCallbacks<List<LSDAlert>>
onAlerts
LSDWeakCallbacks<List<LSDAlert>>
onLaneAlerts
-
Constructor Summary
Constructors Constructor and Description LSDAlertManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description List<LSDAlert>
determineAlerts(List<LSDObjectRecognition> recognitions, int frameWidth, int frameHeight, int sensorOrientation, Date frameDateTime)
Determine if any alerts should be generated for a frame of detections.List<LSDAlert>
determineLaneAlerts(List<Recognition> recognitions, int frameWidth, int frameHeight, int sensorOrientation, Date frameDateTime)
Determine if any lane-related alerts should be generated for a frame of lane detections.void
setAlertSettings(LSDAlertSettings alertSettings)
void
setCameraProperties(LSDCameraProperties cameraProperties)
Set properties of camera used for detections, if not set, then only a subset of alerts will be produced.void
setCollisionBufferDistance(float collisionBufferDistance)
Set the buffer distance, in meters, used during collision calculations.void
setCurrentSpeed(float currentSpeed)
Set current speed of vehiclevoid
setMinimumSpeed(float minimumSpeed)
Set minimum speed threshold for proximity alerts to trigger.void
setRoi(Roi roiPtr)
void
setTimeToCollisionAlert(float timeInSeconds)
Set time to collision threshold under which a collision should be considered a danger.void
setTimeToCollisionWarning(float timeInSeconds)
Set time to collision threshold under which a collision should be considered a warning.
-
-
-
Field Detail
-
onAlerts
public final LSDWeakCallbacks<List<LSDAlert>> onAlerts
-
onLaneAlerts
public final LSDWeakCallbacks<List<LSDAlert>> onLaneAlerts
-
-
Method Detail
-
setRoi
public void setRoi(Roi roiPtr)
-
setCameraProperties
public void setCameraProperties(LSDCameraProperties cameraProperties)
Set properties of camera used for detections, if not set, then only a subset of alerts will be produced.- Parameters:
cameraProperties
- Properties of camera used for detections
-
setAlertSettings
public void setAlertSettings(LSDAlertSettings alertSettings)
-
setMinimumSpeed
public void setMinimumSpeed(float minimumSpeed)
Set minimum speed threshold for proximity alerts to trigger. Alerts will not trigger when current speed is belowminimumSpeed
- Parameters:
minimumSpeed
- speed in meters per second
-
setCurrentSpeed
public void setCurrentSpeed(float currentSpeed)
Set current speed of vehicle- Parameters:
currentSpeed
- speed in meters per second
-
setTimeToCollisionAlert
public void setTimeToCollisionAlert(float timeInSeconds)
Set time to collision threshold under which a collision should be considered a danger.- Parameters:
timeInSeconds
- time in seconds
-
setTimeToCollisionWarning
public void setTimeToCollisionWarning(float timeInSeconds)
Set time to collision threshold under which a collision should be considered a warning. Value should be greater than time to collision alert for meaningful output.- Parameters:
timeInSeconds
- time in seconds
-
setCollisionBufferDistance
public void setCollisionBufferDistance(float collisionBufferDistance)
Set the buffer distance, in meters, used during collision calculations.This distance represents the distance between the camera position and the front of the vehicle.
The default buffer distance is 2.5 meters.
- Parameters:
collisionBufferDistance
- Buffer distance in meters. A negative value will set buffer distance to 0.
-
determineAlerts
public List<LSDAlert> determineAlerts(List<LSDObjectRecognition> recognitions, int frameWidth, int frameHeight, int sensorOrientation, Date frameDateTime)
Determine if any alerts should be generated for a frame of detections. Returned List is same as given byLSDAlertManager.onAlerts
callback.- Parameters:
recognitions
- Recognitions to processframeWidth
- Width of detection frameframeHeight
- Height of detection framesensorOrientation
- Relative rotation of detection frameframeDateTime
- Timestamp of frame- Returns:
- List of Alerts for processed recognitions, empty list if no new alerts.
-
determineLaneAlerts
public List<LSDAlert> determineLaneAlerts(List<Recognition> recognitions, int frameWidth, int frameHeight, int sensorOrientation, Date frameDateTime)
Determine if any lane-related alerts should be generated for a frame of lane detections.The returned list is the same as given by the lane alerts callback.
The alerts generated by this method are independent from
LSDAlertManager.determineAlerts(List, int, int, int, Date)
.This method does nothing if
recognitions
does not contain lane detections or there is insufficient lane information in the available lane detections.NOTE:This feature is in Beta and the API may change without notice.
- Parameters:
recognitions
- Lane recognitions to processframeWidth
- Width of detection frameframeHeight
- Height of detection framesensorOrientation
- Relative rotation of detection frameframeDateTime
- Timestamp of frame- Returns:
- List of alerts for processed lane recognitions, empty list if no new alerts
-
-