Farama-Foundation / HighwayEnv

A minimalist environment for decision-making in autonomous driving

Home Page:https://highway-env.farama.org/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Limit acceleration in a certain range

skonwa opened this issue · comments

I used DiscreteMetaAction action type,and set lateral=False in intersection environment.I found there is something wrong with action['acceleration'], that it's absolute value is too large, can i clip acceleration in controller.py-class ControlledVehicle-method act,like this action['acceleration'] = np.clip(action['acceleration'], -self.MAX_ACC, self.MAX_ACC) below action['steering'] = np.clip(action['steering'], -self.MAX_STEERING_ANGLE, self.MAX_STEERING_ANGLE)?

Hi. Yes, you can clip acceleration as you suggested, but there is a risk of making the underlying controller unstable.
Instead (or in addition), I would recommend damping the speed controller by choosing a lower response time TAU_ACC here:

https://github.com/Farama-Foundation/HighwayEnv/blob/a897328f9679c0760307beb9f74692f123318c0e/highway_env/vehicle/controller.py#L24C8-L24C8

For instance, you can try changing it from 0.6s to 1.2s

ok, thanks for your suggestions!