$darkmode
Public Member Functions | |
| AdaptiveCruiseControl (const AccConfiguration &c) | |
| void | add_hmi (utility::ContactMap< Duration > &hmi, const std::string &prefix="") |
| void | control (Vehicle &v, const Sync &sync, const std::string &driver_request) |
| const std::pair< std::string, distance::Algorithm > & | get_distance_algorithm () const |
Public Attributes | |
| AccConfiguration | config |
| std::shared_ptr< Vehicle > | vehicle {nullptr} |
| bool | enabled {false} |
| bool | active {false} |
| size_t | distance_algorithm {0} |
| std::optional< double > | target_speed {} |
Protected Attributes | |
| double | uki_last {0.0} |
| double | uki_m_last {0.0} |
| double | deviation_last {0.0} |
| double | deviation_m_last {0.0} |
Friends | |
| void | to_json (Json &j, const AdaptiveCruiseControl &c) |
|
inline |
Add HMI buttons to the given ContactMap.
The HMI semantic is as follows:
ENABLE [enabled] When toggled to true, resets target_speed and active to false. When false, none of the other HMI elements are respected, the following descriptions therefore assume that enabled is true.
CANCEL [active] Sets active to false.
RESUME [active, target_speed] Sets active to true; sets target_speed to the current vehicle speed only if it was previously unset.
PLUS [target_speed] Rounds target_speed up to the nearest ten. If target_speed is unset, it uses the current vehicle speed.
MINUS [target_speed] Rounds the target_speed down to the nearest ten. If target_speed is unset, it uses the current vehicle speed as it's initial state.
DISTANCE [distance_algorithm] Toggles the distance_algorithm between the available distance algorithms: SAFE Keeps vehicle.norm_speed in distance, minimum vehicle length. NORMAL Keeps vehicle.norm_speed / 2 in distance, minimum vehicle length. FIFTY Keeps 50 m distance. CRAZY Keeps a vehicle length from the front car.
|
inline |
FIXME(ben): The HMI should not be manipulated while we are in this part.