trajectory_supervisor.helper_funcs.src.export_traj module¶
- trajectory_supervisor.helper_funcs.src.export_traj.export_traj(file_path: str, bound_l: numpy.ndarray, bound_r: numpy.ndarray, ego_traj_xy: numpy.ndarray, ego_psi: numpy.ndarray, ego_kappa: numpy.ndarray, ego_vx: numpy.ndarray, ego_ax: numpy.ndarray, sp_res: float = 2.0) → None[source]¶
This function is used to export a trajectory to a file for further usage in the graph-based local trajectory planner. Therefore, a reference-line and matching normal-vectors (required by the planner) are calculated and exported.
- Parameters
file_path – path (including file name) the generated trajectory file should be stored to
bound_l – coordinates of the left bound (numpy array with columns x and y)
bound_r – coordinates of the right bound (numpy array with columns x and y)
ego_traj_xy – coordinates of the ego trajectory (numpy array with columns x and y)
ego_psi – heading of the ego-trajectory at given coordinates
ego_kappa – curvature of the ego-trajectory at given coordinates
ego_vx – velocity of the ego-trajectory at given coordinates
ego_ax – acceleration of the ego-trajectory at given coordinates
sp_res –
(optional) support point resolution, defines the step-width of the reference line
a small step-width might result in curvature spikes, since the splines have less freedom
a large step-width might result in hitting the bounds due to less accurate tracking
- Authors
Tim Stahl <tim.stahl@tum.de>
- Created on
12.05.2020
- trajectory_supervisor.helper_funcs.src.export_traj.intersect(pnt_a: tuple, pnt_b: tuple, pnt_c: tuple, pnt_d: tuple) → bool[source]¶
Determines if two line segments [pnt_a pnt_b] and [pnt_c pnt_d] intersect.
- Parameters
pnt_a – point defined by a tuple of x and y coordinate
pnt_b – point defined by a tuple of x and y coordinate
pnt_c – point defined by a tuple of x and y coordinate
pnt_d – point defined by a tuple of x and y coordinate
- Returns
intersect - ‘true’ if the line-segments intersect, ‘false’ otherwise
- trajectory_supervisor.helper_funcs.src.export_traj.intersect_point(pnt_a: tuple, pnt_b: tuple, pnt_c: tuple, pnt_d: tuple) → tuple[source]¶
Determines the intersection point (x, y) of two lines, each going through the point pairs [pnt_a pnt_b] and [pnt_c pnt_d].
- Parameters
pnt_a – point defined by a tuple of x and y coordinate
pnt_b – point defined by a tuple of x and y coordinate
pnt_c – point defined by a tuple of x and y coordinate
pnt_d – point defined by a tuple of x and y coordinate
- Returns
intersect - intersection point defined by a tuple of x and y coordinate; ‘false’ if no intersection