Skip to content

Commit

Permalink
Fix detach call.
Browse files Browse the repository at this point in the history
  • Loading branch information
Gamenot committed Jan 27, 2023
1 parent a58b990 commit 57a83c3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ Copy and pasting the git commit messages is __NOT__ enough.
- Scenario paths is no longer manually supplied to Envision server while setup. Scenario paths are automatically sent to Envision server from SMARTS during simulation startup phase.
### Deprecated
### Fixed
- Fix sensor detach call when a bubble vehicle exits a bubble at same time it is done.
### Removed
### Security

Expand Down
5 changes: 3 additions & 2 deletions smarts/core/agent_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -681,6 +681,7 @@ def attach_sensors_to_vehicles(self, agent_interface, vehicle_ids):

def detach_sensors_from_vehicle(self, vehicle_id: str):
"""Called when agent observation is finished and sensors should be removed from a vehicle"""
if not vehicle_id in self._vehicle_with_sensors:
return
self._vehicle_index.stop_agent_observation(vehicle_id)
if vehicle_id in self._vehicle_with_sensors:
del self._vehicle_with_sensors[vehicle_id]
del self._vehicle_with_sensors[vehicle_id]

0 comments on commit 57a83c3

Please sign in to comment.