Visualization
draw_route_state(renderer, reference_point, velocity, v_min, v_max, point_radius=0.1)
Draws reference_path state
Parameters:
Name | Type | Description | Default |
---|---|---|---|
renderer
|
MPRenderer
|
cr MPRenderer |
required |
reference_point
|
ndarray
|
point to draw as (2,) np.ndarry |
required |
velocity
|
float
|
velocity of point |
required |
v_min
|
float
|
v_min |
required |
v_max
|
float
|
v_max |
required |
point_radius
|
float
|
radius to display point |
0.1
|
Source code in commonroad_velocity_planner/utils/visualization/visualize_velocity_planner.py
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 |
|
get_velocity_min_max_from_trajectory(velocity_profile)
Gets min and max velocity from global trajectory for color coding.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
velocity_profile
|
ndarray
|
velocity profile as (n,2) np.ndarray |
required |
Returns:
Type | Description |
---|---|
Tuple[float, float]
|
tuple[v_min, v_max] |
Source code in commonroad_velocity_planner/utils/visualization/visualize_velocity_planner.py
138 139 140 141 142 143 144 145 146 147 148 |
|
obtain_plot_limits_from_reference_path(reference_path, margin=10.0)
Obtrains plot limits from reference path
Parameters:
Name | Type | Description | Default |
---|---|---|---|
reference_path
|
ndarray
|
reference path (2,) np.ndarray |
required |
Returns:
Type | Description |
---|---|
List[int]
|
list [xmin, xmax, ymin, xmax] of plot limits |
Source code in commonroad_velocity_planner/utils/visualization/visualize_velocity_planner.py
151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
|
visualize_global_trajectory(scenario, velocity_planning_problem, global_trajectory, save_path, size_x=10.0, save_img=False, saving_format='png', test=False)
Visualizes global trajectory in scenario
Parameters:
Name | Type | Description | Default |
---|---|---|---|
scenario
|
Scenario
|
cr scenario |
required |
velocity_planning_problem
|
VelocityPlanningProblem
|
velocity planning problem object |
required |
global_trajectory
|
GlobalTrajectory
|
global trajectory object |
required |
save_path
|
str
|
path to save image to |
required |
size_x
|
float
|
fig size |
10.0
|
save_img
|
bool
|
if true, saves image, otherwise displays it |
False
|
saving_format
|
str
|
saving format |
'png'
|
test
|
bool
|
if true, neither displays nor saves iamge |
False
|
Source code in commonroad_velocity_planner/utils/visualization/visualize_velocity_planner.py
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 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 |
|
visualize_acceleration_over_arclength(path_length_per_point, acceleration_profile, a_min, a_max, save_path, save_img=False, saving_format='png', test=False)
Visualizes acceleration over arc length
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_length_per_point
|
ndarray
|
arc length per point |
required |
acceleration_profile
|
ndarray
|
acceleration profile |
required |
a_min
|
float
|
minimum acceleration threshold |
required |
a_max
|
float
|
maximum acceleration threshold |
required |
save_path
|
str
|
path to save image to |
required |
save_img
|
bool
|
if true, saves image, otherwise displays it |
False
|
saving_format
|
str
|
saving format |
'png'
|
test
|
bool
|
if true, neither saves nor displays figures |
False
|
Source code in commonroad_velocity_planner/utils/visualization/visualize_quantities.py
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 |
|
visualize_velocity_over_arclength(path_length_per_point, velocity_profile, v_min, v_max, save_path, save_img=False, saving_format='png', test=False)
Visualizes velocity over arc length
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_length_per_point
|
ndarray
|
arc length per point |
required |
velocity_profile
|
ndarray
|
velocity profile |
required |
v_min
|
float
|
minimum velocity threshold |
required |
v_max
|
float
|
maximum velocity threshold |
required |
save_path
|
str
|
path to same image to |
required |
save_img
|
bool
|
if true, saves image, otherwise displays it |
False
|
saving_format
|
str
|
saving format |
'png'
|
test
|
bool
|
if test, neither displays nor saves images |
False
|
Source code in commonroad_velocity_planner/utils/visualization/visualize_quantities.py
5 6 7 8 9 10 11 12 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 |
|
visualize_acceleration_over_arclength(path_length_per_point, velocity_profile, save_path, save_img=False, saving_format='png', test=False)
Visualization for the velocity
Parameters:
Name | Type | Description | Default |
---|---|---|---|
path_length_per_point
|
ndarray
|
arc length per point |
required |
velocity_profile
|
SplineProfile
|
spline velocity provile |
required |
save_path
|
str
|
save image to |
required |
save_img
|
bool
|
if true, saves image, otherwise displays it |
False
|
saving_format
|
str
|
saving format |
'png'
|
test
|
bool
|
if test, image is neither shown nor displayed |
False
|
Source code in commonroad_velocity_planner/utils/visualization/visualize_acceleration.py
11 12 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 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 |
|