HighwayEnv icon indicating copy to clipboard operation
HighwayEnv copied to clipboard

Generate polygonal obstacle

Open 201520906050 opened this issue 2 years ago • 2 comments

Hi Mr.Leurent ! I want to enrich some parking scenarios like the pictures below ,but these scenarios require some polygonal obstacles as well an initial point(green rectangle) and an end point(red rectangle). Is there any interface that I can use to generate those polygonal obstacles ? Thanks ! image

image

201520906050 avatar Jul 18 '22 06:07 201520906050

Additionally, these obstacles are made of a set of given points (e.g. X = [1, 2, 3] Y = [4, 5, 6])

201520906050 avatar Jul 22 '22 08:07 201520906050

Hi, The codebase currently only supports rectangle objects, but it should be quite easy to add support for polygons, especially since:

  • The rendering code can easily be replaced to draw polygons: https://github.com/eleurent/highway-env/blob/9e3649dfc53d253185705e62484b5595692ebbb2/highway_env/vehicle/graphics.py#L69
  • The collision detection code already supports polygons: https://github.com/eleurent/highway-env/blob/9e3649dfc53d253185705e62484b5595692ebbb2/highway_env/utils.py#L174

eleurent avatar Jul 27 '22 08:07 eleurent