Is there any existing method to spawn a vehicle giving a global longitudinal position? #729
Answered
by
QuanyiLi
lev-smolentsev-K1
asked this question in
Q&A
-
For now, I see it by manually iterating by block & each lane calculating the total length and comparing with desired longitude of a vehicle. Am I missing some existing method? |
Beta Was this translation helpful? Give feedback.
Answered by
QuanyiLi
Jun 9, 2024
Replies: 1 comment 1 reply
-
I think it is allowed to generate vehicles by filling in the global position and heading as the argument: The reason we calculate the lane length for lanes in each block and place vehicles is that we want to scatter vehicles on the map evenly or randomly and avoid overlapping. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
lev-smolentsev-K1
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I think it is allowed to generate vehicles by filling in the global position and heading as the argument:
metadrive/metadrive/component/vehicle/base_vehicle.py
Line 121 in 05ec6c8
The reason we calculate the lane length for lanes in each block and place vehicles is that we want to scatter vehicles on the map evenly or randomly and avoid overlapping.