Visualization
visualize_physics(idm_trajectory, idm_config, delta_t, threshold_plot_v_max=3.0, threshold_plot_acc_max=0.5, threshold_plot_decel_max=0.5, save_img=False, save_path=None)
Visualizes physical properties of planner, such as velocity, acceleration and jerk
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
idm_trajectory
|
IDMTrajectory
|
idm trajectory |
required |
idm_config
|
IDMConfig
|
idm config |
required |
delta_t
|
float
|
time-step size |
required |
threshold_plot_v_max
|
float
|
v_max threshold |
3.0
|
threshold_plot_acc_max
|
float
|
accel threshold |
0.5
|
threshold_plot_decel_max
|
float
|
decel threshold |
0.5
|
save_img
|
bool
|
if True, image is not displayed but saved to save_path |
False
|
save_path
|
Union[str, Path]
|
idm_path to save images to |
None
|
Source code in commonroad_idm_planner/util/visualization/visualize_physics.py
15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 | |
obtain_plot_limits_from_reference_path(reference_path, margin=10.0)
Obtrains plot limits from reference idm_path
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
reference_path
|
ndarray
|
reference idm_path (2,) np.ndarray |
required |
Returns:
| Type | Description |
|---|---|
List[int]
|
list [xmin, xmax, ymin, xmax] of plot limits |
Source code in commonroad_idm_planner/util/visualization/visualize_scenario.py
123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 | |
visualize_idm_trajectory(scenario, planning_problem, idm_path, idm_trajectory, idm_config, size_x=10.0, save_img=False, save_path=None)
Visualizes IDM Trajectory
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
scenario
|
Scenario
|
cr scenario |
required |
planning_problem
|
PlanningProblem
|
cr planning problem |
required |
idm_path
|
IDMPath
|
cr idm path |
required |
idm_trajectory
|
IDMTrajectory
|
idm trajectory |
required |
idm_config
|
IDMConfig
|
idm config |
required |
size_x
|
float
|
size of fig |
10.0
|
save_img
|
bool
|
if True, image is not displayed but saved |
False
|
save_path
|
Union[str, Path]
|
idm_path image is saved to if save_img |
None
|
Source code in commonroad_idm_planner/util/visualization/visualize_scenario.py
29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 | |
visualize_acceleration_input_over_time(input_list, acc_max=0.5, decel_max=0.5, save_img=False, save_path=None)
Visualizes acceleration input of planner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_list
|
List[IDMInput]
|
list of idm inputs |
required |
acc_max
|
float
|
accel threshold |
0.5
|
decel_max
|
float
|
decel threshold |
0.5
|
save_img
|
bool
|
image is not displayed but saved to save_path |
False
|
save_path
|
Union[str, Path]
|
idm_path to save images to |
None
|
Source code in commonroad_idm_planner/util/visualization/visualize_inputs.py
45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 | |
visualize_inputs(input_list, max_steering_angle_vel=0.5, acc_max=0.5, decel_max=0.5, save_img=False, save_path=None)
Visualizes inputs of planner, such as acceleration and steering angle velocity
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_list
|
Optional[List[IDMInput]]
|
list of idm inputs |
required |
max_steering_angle_vel
|
float
|
max steering angle velocity |
0.5
|
acc_max
|
float
|
accel threshold |
0.5
|
decel_max
|
float
|
decel threshold |
0.5
|
save_img
|
bool
|
if True, image is not displayed but saved to save_path |
False
|
save_path
|
Union[str, Path]
|
idm_path to save images to |
None
|
Source code in commonroad_idm_planner/util/visualization/visualize_inputs.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | |
visualize_steering_angle_velocity_input_over_time(input_list, max_steering_angle_vel=0.5, save_img=False, save_path=None)
Visualizes steering angle velocity input of planner.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
input_list
|
List[IDMInput]
|
list of idm inputs |
required |
max_steering_angle_vel
|
float
|
max steering angle velocity |
0.5
|
save_img
|
bool
|
image is not displayed but saved to save_path |
False
|
save_path
|
Union[str, Path]
|
idm_path to save images to |
None
|
Source code in commonroad_idm_planner/util/visualization/visualize_inputs.py
86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 | |