HighwayEnv icon indicating copy to clipboard operation
HighwayEnv copied to clipboard

How to obtain the target_lane_index parameter from intersection_env.py

Open wuyukun-tong opened this issue 2 years ago • 5 comments

I want to import "steering_control" function which in the class "ControlledVehicle" in control.py to intersection_env.py. It need "target_lane_index" parameter,how to obtain the target_lane_index parameter from intersection_env.py I am looking forward to your reply. Sincerely

wuyukun-tong avatar May 12 '22 14:05 wuyukun-tong

you don't need to import anything, if you have access to a vehicle you can directly check its target lane index.

For instance: vehicle = env.vehicle or vehicle = env.road.vehicles[0] and print(vehicle.target_lane_index)

eleurent avatar May 13 '22 15:05 eleurent

Then print(env.vehicle.target_lane_index)

eleurent avatar May 13 '22 16:05 eleurent

I just want to get ego-vehicle.Is this method used to obtain the target_lane_index of ego-vehicle thank you for your replay

| | @.*** | | @.*** |

---- Replied Message ---- | From | Edouard @.> | | Date | 05/14/2022 00:38 | | To | @.> | | Cc | @.@.> | | Subject | Re: [eleurent/highway-env] How to obtain the target_lane_index parameter from intersection_env.py (Issue #306) |

Then print(env.vehicle.target_lane_index)

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

wuyukun-tong avatar May 13 '22 16:05 wuyukun-tong

yes

eleurent avatar May 13 '22 16:05 eleurent

Thank you so much

| | @.*** | | @.*** |

---- Replied Message ---- | From | Edouard @.> | | Date | 05/14/2022 00:44 | | To | @.> | | Cc | @.@.> | | Subject | Re: [eleurent/highway-env] How to obtain the target_lane_index parameter from intersection_env.py (Issue #306) |

yes

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

wuyukun-tong avatar May 13 '22 16:05 wuyukun-tong