HighwayEnv icon indicating copy to clipboard operation
HighwayEnv copied to clipboard

Vehicle heading angle

Open izvvv opened this issue 10 months ago • 2 comments

How do I change the heading angle of a parked vehicle? I need to keep the vehicle level.

image image

izvvv avatar Apr 08 '24 02:04 izvvv

And I've already added PI/2 to my goal image

izvvv avatar Apr 08 '24 02:04 izvvv

v = Vehicle.make_on_lane(...) aligns the vehicle heading with the lane direction, by default. you can just add the following line below to rotate the vehicles:

v = Vehicle.make_on_lane(...)
v.heading += np.pi / 2
v.color = ...

(or you can just replace the call to make_on_lane by a copy of the function's code and change the heading as needed)

eleurent avatar Apr 14 '24 10:04 eleurent