trajectory_supervisor.supervisor_modules.supmod_RSS.src.supmod_RSS module¶
- class trajectory_supervisor.supervisor_modules.supmod_RSS.src.supmod_RSS.SupModRSS(supmod_config_path: str, veh_params: dict, localgg: numpy.ndarray)[source]¶
Bases:
objectClass handling the safety rating based on the RSS principle presented by Shalev Shwartz.
NOTE: This SupMod is a drafted version and in BETA state, handle with care.
Note
For further details:
Shalev-Shwartz, S. Shammah, and A. Shashua, “On a Formal Model of Safe and Scalable Self-driving Cars,” 2017.
- Authors
Yujie Lian
Tim Stahl <tim.stahl@tum.de>
- Created on
15.05.2019
Init the RSS SupMod.
- Parameters
localgg – maximum g-g-values at a certain position on the map (currently, only the max a used)
supmod_config_path – path pointing to the config file hosting relevant parameters
veh_params – dict of vehicle parameters; must hold the following keys: veh_width - width of the ego-vehicle [in m] veh_length - length of the ego-vehicle [in m]
- calc_score(ego_pos: numpy.ndarray, ego_heading: float, ego_curv: float, ego_vel: float, objects: dict)[source]¶
This function uses kinematic data of the ego as well as the object vehicle and use the data to calculate the safety of the vehicle. Since the curvature of the object vehicle is needed but not provided, the path of the object vehicle is used as the input of the function in order to calculate the curvature of the vehicle. Due to the noise, the calculated curvature might not be that accurate, so there’s also a flag which gives an option to use the calculated curvature or not.
- Parameters
ego_pos – numpy array holding global x and y of the ego-vehicle
ego_heading – heading of the ego-vehicle in the global coordinate frame
ego_curv – curvature of the path at the current position
ego_vel – absolute velocity of the ego-vehicle
objects – dict of objects, each holding a dict (with at least: ‘X’, ‘Y’, ‘theta’, ‘v_x’)
- Returns
safety_rss - the binary result of the safety assessment(true: safe, false: not safe)
safety_parameters - a descriptive dict holding more detailed log / debugging information