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

Question: How a planner get a scenario in simulation? #87

Closed
YFHhhhhh opened this issue Jul 19, 2022 · 9 comments
Closed

Question: How a planner get a scenario in simulation? #87

YFHhhhhh opened this issue Jul 19, 2022 · 9 comments
Assignees

Comments

@YFHhhhhh
Copy link

I want to get the future tracked objects, so I should get a scenario first and ues get_future_tracked_objects() fuction.
But the class AbstractPlanner only gives me the initialization and current_input, how can a get a scenario?

@patk-motional
Copy link
Collaborator

Hi @YFHhhhhh,

For any simulation, we purposefully abstracted away the AbstractScenario interface. We wanted to hide GT (ground-truth) data away from the planner that is available in the AbstractScenario class.

I want to quickly ask for clarification. Are you looking for:

  1. getting future detections for a given horizon? This can have varying numbers of agents per time step
  2. getting the future trajectories (prediction) for each agent in the current time step? This will only get the GT predictions of the agents that exist in this time step

FYI @mspryn-motional

@YFHhhhhh
Copy link
Author

  1. I want to get the future trajectories(prediction) for each agent in the current timestamp to do collision checker with my planning trajectory.I only find the scenario api can get the prediction trajectory(GT).Is there any other method?

  2. So I want to know how I can get a scenario instance(NuplanScenario) in my planner? The inputs of the planner don't give me the scenario api like the map_api in 'PlannerInitialization', so how can I get the scenario api?

@patk-motional @mspryn-motional Thanks!!!

@patk-motional
Copy link
Collaborator

  1. Are you doing collision checking for planning or collision for evaluation?
  • For the first case, this is not really provided as you need to make your own prediction based on the information provided by the simulation.
  • For the latter case, you want to check for collision I recommend using our collision metrics with the simulation. For example, you can append this to your simulation call selected_simulation_metrics="[ego_lane_change_statistics, ego_at_fault_collisions_statistics]". This will yield a chart like this on nuBoard
    image
  1. Generally speaking, the planner should not have access to the scenario as that would be revealing GT information to the planner and can be used to cheat

@YFHhhhhh
Copy link
Author

YFHhhhhh commented Jul 20, 2022

1.I am doing collision checking for planning instead of collision evaluation.
2.You are right that I should use the history buffer information to do my own prediction for planning.But now I want to use the future GT as my prediction to preliminarily test my planning method, is this feasible in NuPlan?
@patk-motional @mspryn-motional Thanks!!!

@patk-motional
Copy link
Collaborator

As a hack, you can take a look at how LogFuturePlanner does it

@YFHhhhhh
Copy link
Author

Oh, it seems to be what I want!!!
And I have another confuse, how I tell simulation the type of my planner? In the simulation config in tutorial, the planner config only consists of 'simple_planner' and 'ml_planner', so how I config the LogFuturePlanner?
@patk-motional @mspryn-motional Thanks!!!

@patk-motional patk-motional removed the enhancement New feature or request label Jul 20, 2022
@patk-motional
Copy link
Collaborator

patk-motional commented Jul 22, 2022

  1. How to simulate using a new planner: You need to create a hydra configuration for it. For example, this is how it is defined for the LogFuturePlanner. From there you can specify your planner in simulation script. For example:

    • create a hydra config called my_planner.yaml
    • simulate using python nuplan_devkit/nuplan/planning/script/run_simulation.py +simulation=closed_loop_nonreactive_agents planner=my_planner
  2. How to config LogFuturePlanner: simply put in log_future_planner instead

@YFHhhhhh
Copy link
Author

Thank you for your answer! It really helps!!! @patk-motional

@patk-motional
Copy link
Collaborator

Welcome :)

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

No branches or pull requests

3 participants