HighwayEnv icon indicating copy to clipboard operation
HighwayEnv copied to clipboard

Why my range of controlling the speed of my own vehicle didn't work

Open AHPUymhd opened this issue 3 months ago • 3 comments

My configuration is as follows: image But with a minimum speed of 20 and a maximum of 29.999, it is clear that this speed range is not -10 to 10 that I set image I am very looking forward to hearing from you

AHPUymhd avatar Mar 11 '24 08:03 AHPUymhd

@eleurent Thank you very much

AHPUymhd avatar Mar 11 '24 08:03 AHPUymhd

Hi, This is because this config["observation"]["features_range"]["vx"/"vy"] does not control the range of speeds that can be reached by the vehicle, but only how the observed speed values get normalised into the [-1, 1] range. (i.e. an observed speed of 1 means 10m/s with this config).

To change the range of speeds actually tracked by the vehicles, you must change the action config instead of the observation: Something like

env.configure({
                "action": {
                    "type": "DiscreteMetaAction",
                    "longitudinal": True,
                    "lateral": True,
                    "target_speeds": [-10, 0, 10],
                },
})

eleurent avatar Mar 16 '24 14:03 eleurent

Hi, This is because this config["observation"]["features_range"]["vx"/"vy"] does not control the range of speeds that can be reached by the vehicle, but only how the observed speed values get normalised into the [-1, 1] range. (i.e. an observed speed of 1 means 10m/s with this config).

To change the range of speeds actually tracked by the vehicles, you must change the action config instead of the observation: Something like

env.configure({
                "action": {
                    "type": "DiscreteMetaAction",
                    "longitudinal": True,
                    "lateral": True,
                    "target_speeds": [-10, 0, 10],
                },
})

Thank you very much for answering your questions!!!!!this solved my doubts.

AHPUymhd avatar Mar 22 '24 02:03 AHPUymhd