Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How can I spawn vehicles on the opposite lane? #584

Open
nivolog opened this issue Oct 3, 2022 · 2 comments
Open

How can I spawn vehicles on the opposite lane? #584

nivolog opened this issue Oct 3, 2022 · 2 comments

Comments

@nivolog
Copy link

nivolog commented Oct 3, 2022

Hello there, I'm trying to create custom scenario with custom scene made in Roadrunner. The scene is displayed below.
image

And main problem is - no matter how I change parameters or lane configs - vehicles always drive on the same lane, as shown on the picture.

image

The road configuration is: road 0 starts at top left side and road 1 starts right about the turn at the bottom. So what i did recently is changed lane configs for left and right lane, so road ids are [0,1] and [1,0] for left_lane and right_lane respectively. That help me to spawn vehicles on different ends of the road(s). However, no matter how i chnge lane_corridor_id, or source and sink position, vehicles refused to spawn correctly. The code I used for lane confiigs is displayed below. I was trying to comment something and change numbers here, however, as I said, it didn't lead to any progress. Hope You can help me understand, what's going on!

left_lane = LaneCorridorConfig(params=param_server, source_pos=[1, 48], sink_pos=[1, 2], road_ids=[0,1], lane_corridor_id=1, behavior_model=BehaviorIDMClassic(param_server), min_vel=5., max_vel=5., ds_min=8., ds_max=10., s_min=15., s_max=35.) right_lane = LaneCorridorConfig(params=param_server, #source_pos=[30,-3], #sink_pos=[1, -3], road_ids=[1,0], lane_corridor_id=-1, behavior_model=BehaviorIDMClassic(param_server), controlled_ids=True, max_vel=5., ds_min=8., ds_max=10., s_min=15., s_max=35.)

@nivolog
Copy link
Author

nivolog commented Oct 3, 2022

The geometry of the scene is simple. Suppose that beggining of this U-turn is bottom-left corner. Therefore main anchor points are: (0,0) for the center of the begining of the road, about (100,25) for the middle of the U-turn, and (0,50) for the end of the road.

@nivolog
Copy link
Author

nivolog commented Oct 3, 2022

UPD: I've conducted some experiments and found out that the problem occures only on curved roads, like I posted before, with U-turn. On simple straight roads it is possible for me to generate opposite traffic even on 4 lanes. But with exactly the same lane configs on exactly the same scene except it is a bit longer and has U-turn this scenario refused to work. Example of successfull launch is on the picture below:
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant