Hi,
As I understand from the GPUDrive paper, road objects contain information on their segment length/width/height. When looking into the code, it seems that map observation is processed in level_gen.cpp. In particular these two lines suggest that for both polylines and polygons, it is the half lengths (& half widths) that are used:
|
auto scale = Diag3x3{.d0 = start.distance(end)/2, .d1 = 0.1, .d2 = 0.1}; |
|
auto scale = Diag3x3{.d0 = lengths[maxLength_i]/2, .d1 = lengths[minLength_i]/2, .d2 = 0.1}; |
For road edges, this seems to be confirmed in the visualization code:
|
def _get_endpoints(self, x, y, length, yaw): |
|
"""Compute the start and end points of a road segment.""" |
|
center = np.array([x, y]) |
|
start = center - np.array([length * np.cos(yaw), length * np.sin(yaw)]) |
|
end = center + np.array([length * np.cos(yaw), length * np.sin(yaw)]) |
|
return start, end |
But for polygons like crosswalks, it seems to suggest that they are full lengths and widths:
|
# corners |
|
tl = pt + (length / 2) * u - (width / 2) * ut |
|
tr = pt + (length / 2) * u + (width / 2) * ut |
|
br = pt - (length / 2) * u + (width / 2) * ut |
|
bl = pt - (length / 2) * u - (width / 2) * ut |
I would like to confirm whether in practice, the segment information you get from GPUDriveTorchEnv's observation is actually half lengths for both polylines and polygons or do polygons get full lengths?
Thank you in advance
Hi,
As I understand from the GPUDrive paper, road objects contain information on their segment length/width/height. When looking into the code, it seems that map observation is processed in level_gen.cpp. In particular these two lines suggest that for both polylines and polygons, it is the half lengths (& half widths) that are used:
gpudrive/src/level_gen.cpp
Line 180 in b2e575f
gpudrive/src/level_gen.cpp
Line 237 in b2e575f
For road edges, this seems to be confirmed in the visualization code:
gpudrive/gpudrive/visualize/core.py
Lines 552 to 557 in b2e575f
But for polygons like crosswalks, it seems to suggest that they are full lengths and widths:
gpudrive/gpudrive/visualize/core.py
Lines 571 to 575 in b2e575f
I would like to confirm whether in practice, the segment information you get from GPUDriveTorchEnv's observation is actually half lengths for both polylines and polygons or do polygons get full lengths?
Thank you in advance