Farama-Foundation / HighwayEnv

A minimalist environment for decision-making in autonomous driving
https://highway-env.farama.org/
MIT License
2.48k stars 726 forks source link

'Vehicle' object has no attribute 'target_speed' #563

Closed aseembits93 closed 5 months ago

aseembits93 commented 5 months ago

Hi @eleurent !

thank you for sharing your work. I started playing around with it and got stuck here.

import gymnasium as gym
env = gym.make("highway-v0")
env.configure({'other_vehicles_type': 'highway_env.vehicle.behavior.AggressiveVehicle','action':{"type": "ContinuousAction"}})
env.reset()
action = env.action_space.sample()
env.step(action)

This throws an error AttributeError: 'Vehicle' object has no attribute 'target_speed'

Let me know how I could resolve this issue, thanks!

eleurent commented 5 months ago

Hi! Thanks for providing the snippet, I was unable to reproduce the error, see my attempt on colab.

EDIT: Ok I got it, sorry it involved some randomness. I'll fix it.

eleurent commented 5 months ago

Should be fixed if you install the dev version from the main branch.