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

custom environment #583

Open
lihua12312 opened this issue Mar 29, 2024 · 3 comments
Open

custom environment #583

lihua12312 opened this issue Mar 29, 2024 · 3 comments

Comments

@lihua12312
Copy link

Hello! Can I control all the background vehicles myself, for example, by using a prediction model to output the trajectories of background vehicles, while the main vehicle uses IDM?

@lihua12312
Copy link
Author

"Can environments that are not for reinforcement learning purposes be constructed?"

@eleurent
Copy link
Collaborator

eleurent commented Apr 6, 2024

Hello! Can I control all the background vehicles myself, for example, by using a prediction model to output the trajectories of background vehicles, while the main vehicle uses IDM?

It's not natively supported, but you can edit an environment and set the class of other vehicles in the scene (created in env._make_vehicles()) as Vehicle, and then at any time you can control them by setting their vehicle.action['acceleration'] and vehicle.action['steering'], for vehicle in env.road.vehicles

"Can environments that are not for reinforcement learning purposes be constructed?"

Likewise, it's not really natively supported as this project is mostly intended for RL, but the code can be adapted. You can make a custom environment without any ego-vehicle (to be controlled), simply populate the scenes with other vehicles and call env.simulate()

@lihua12312
Copy link
Author

Thank you very much for your response!

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

2 participants