-
Notifications
You must be signed in to change notification settings - Fork 2
Speed State Machine
This component makes sure to transition the acceleration beheaviour based on the the input from the Perception layer. To accomplish this the state machine uses the states [ACCEL, BRAKE, KEEP]. A input in form of a Sensor Fusion called SpeedObservation delivers input information to the Speed State Machine where a transition Function will determine the next State.
The Speed Observation is a Sensor Fusion connected to the Perception Layer. The main thread request the latest Speed Observation which collects the most recent stored informations regarding the surroundings and fusions them into one observation. This Observation consits of:
- The most recent detect traffic light color
- the distance to the nearest traffic light or the corresponding stopping line
- a boolean parameter telling if the trajectory is blocked
- the speed limit
- the speed of the obstacle detected
- the distance to the next curve
- the speed that should be driven in the curve
- the distance to the next stop sign
The function starts out by calculating the time until we need to start to break so we stop at the desired location. This will be calculated for traffic lights, speed signs, curves and obstacles. then the most critical, a.k.a the minimum, will be selected. If there is a value smaller than the reaction time of the PID controller the car will transition into BREAK, The next decision will compare the current vehicle speed to the targeted speed to determine if we have to accelerate. This will transition the car into ACCEL. The last check will check if the vehicles current velocity is in a certain range of the targeted speed and will transition into the KEEP state. As a note KEEP will also be the state for standing still because the vehicle is keeping a velocity of 0.
The state machine was modeled after the approach of this paper, whis designed their Decision Making component as a Markov Decision Process (MDP) which could be solved by a solving algorithm explained in a different paper. Thats why our State Machine can be easily redesigned as a MDP. The output action only depends on the Speed Observation as an input. Therefore the Speed Observation could represent a very large state space and the current "States" represent the available action.