Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nuplan-devkit
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Eli Henry Dykhne
nuplan-devkit
Commits
2cb17706
Commit
2cb17706
authored
1 year ago
by
sacardoz
Browse files
Options
Downloads
Patches
Plain Diff
cleanup in propagate
parent
bf5d8e37
No related branches found
Branches containing commit
No related tags found
2 merge requests
!21
Major changes. convert nuplan devkit to handle occlusions for project
,
!4
Multiagent ML Agents + Inserting New Agents into the scene
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
nuplan/planning/simulation/observation/ml_planner_agents.py
+15
-7
15 additions, 7 deletions
nuplan/planning/simulation/observation/ml_planner_agents.py
with
15 additions
and
7 deletions
nuplan/planning/simulation/observation/ml_planner_agents.py
+
15
−
7
View file @
2cb17706
...
@@ -199,6 +199,13 @@ class MLPlannerAgents(AbstractObservation):
...
@@ -199,6 +199,13 @@ class MLPlannerAgents(AbstractObservation):
new_observations
=
[]
new_observations
=
[]
faux_ego_obervations
=
[]
faux_ego_obervations
=
[]
# Construct a timestep/track_token to observation loopup table for faster proessing
track_token_agent_dict
=
{}
for
t
,
observation
in
enumerate
(
observation_buffer
):
track_token_agent_dict
[
t
]
=
{}
for
agent
in
observation
.
tracked_objects
.
tracked_objects
:
track_token_agent_dict
[
t
][
agent
.
metadata
.
track_token
]
=
agent
# Loop through history buffer
# Loop through history buffer
for
t
,
(
ego_state
,
observation
)
in
enumerate
(
zip
(
ego_state_buffer
,
observation_buffer
)):
for
t
,
(
ego_state
,
observation
)
in
enumerate
(
zip
(
ego_state_buffer
,
observation_buffer
)):
...
@@ -210,18 +217,19 @@ class MLPlannerAgents(AbstractObservation):
...
@@ -210,18 +217,19 @@ class MLPlannerAgents(AbstractObservation):
# Get agent object corresponding to agent from observation buffer. If one does not exist for current timestep, take from the future,
# Get agent object corresponding to agent from observation buffer. If one does not exist for current timestep, take from the future,
# if one does not exist from the future, take the current state. This might occur at the first timestep for observations that have no
# if one does not exist from the future, take the current state. This might occur at the first timestep for observations that have no
# logged history prior to simulation start, or observations inserted mid-simulation.
# logged history prior to simulation start, or observations inserted mid-simulation.
i
=
t
matched_agent
=
None
matched_obs
=
[]
while
len
(
matched_obs
)
==
0
and
i
<
len
(
observation_buffer
):
for
i
in
range
(
t
,
len
(
observation_buffer
)):
matched_obs
=
[
ag
for
ag
in
observation_buffer
[
i
].
tracked_objects
.
tracked_objects
if
ag
.
metadata
.
track_token
==
agent_track_token
]
if
i
in
track_token_agent_dict
and
agent_track_token
in
track_token_agent_dict
[
i
]:
i
+=
1
matched_agent
=
track_token_agent_dict
[
i
][
agent_track_token
]
break
# Convert agent state to a corresponding "ego state" object, or pull it from cache if already computed.
# Convert agent state to a corresponding "ego state" object, or pull it from cache if already computed.
if
len
(
matched_
obs
)
==
0
:
if
matched_
agent
is
None
:
faux_ego_observation
=
deepcopy
(
current_state
)
faux_ego_observation
=
deepcopy
(
current_state
)
faux_ego_observation
.
_time_point
=
ego_state
.
time_point
faux_ego_observation
.
_time_point
=
ego_state
.
time_point
else
:
else
:
faux_ego_observation
=
self
.
_build_ego_state_from_agent
(
matched_
obs
[
0
]
,
ego_state
.
time_point
)
faux_ego_observation
=
self
.
_build_ego_state_from_agent
(
matched_
agent
,
ego_state
.
time_point
)
# Rebuild timestep and buffer - creating a new observations object with old ego appended.
# Rebuild timestep and buffer - creating a new observations object with old ego appended.
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment