HighwayEnv icon indicating copy to clipboard operation
HighwayEnv copied to clipboard

Visualising Nodes in Road Graph

Open TibiGG opened this issue 2 years ago • 3 comments

Hi @eleurent,

I was interested in making my own road layout for my project, but I am having a bit of a hard time setting up the lanes to connect correctly. Is there any way to visualise the nodes during debugging, to make sure they are positioned correctly?

Thanks! Tibi

TibiGG avatar May 24 '22 17:05 TibiGG

I also very interested in the problem. I have a question about creating vehicles: other_vehicles_type(road, road.network.get_lane(("j", "k", 0)).position(110, 0), speed=20) Do I only need to specify the longitudinal displacement 110?

piccupl avatar May 25 '22 17:05 piccupl

Hi TibiGG. I am not sure what you mean exactly, since the nodes do not have positions: they are only abstract vertices in the graph which defines the topological road network, i.e. which road is connected to which other road. The edges of this graph however, that link two nodes, have geometries, and these can be rendered. For instance, you could render e.g. a green dot at the beginning of each lane segment (lane.position(0, 0)), and a red dot at the end (lane.position(lane.length, 0)). Does that make sense?

eleurent avatar May 29 '22 14:05 eleurent

@piccupl not sure about your question either, you can specify the longitudinal displacement to any value you want, and you can also set a lateral displacement. Alternatively, you can set any cartesian position (x,y) that you like directly, without resorting to get_lane(...).position(...)

eleurent avatar May 29 '22 14:05 eleurent