CEN-3024-Code-Implementation/RoadSensor.java
2024-04-13 21:16:13 -04:00

32 lines
1.1 KiB
Java

public class RoadSensor {
private boolean hazardDetected; //flag for whether a hazard is detected
private String roadwayDetails; //stores road quality details, eg wet, uneven
private double[] laneEdges; //stores distance to left/right lane edges
private String roadSigns; //stores roadsign text for visible signs
public void detectLaneEdges() {
laneEdges[0] = 1;
laneEdges[1] = 1.1;
}
public int detectSpeedLimit() {
//image intepretation api call to review any street signs with a speed limit marking
//in practice this will be combined with route mapping data to confirm current
//speed limits
return 45;
}
public int identifyHazard() {
//image processing algorithms from external cameras would
//review data and identify a hazard
//types of hazards could be
//Stopped vehicle
//Road construction
//lane closure
//pedestrian on roadway
//stationary object on roadway
//for testing, this function will return 0 to signal no hazard detected
return 0;
}
}