-
Notifications
You must be signed in to change notification settings - Fork 192
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
Graceful handle of TraCI connection errors #1138
Merged
Merged
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
457f48b
Graceful handle of traci connection errors
Gamenot 6751f7d
Make format
Gamenot 066d519
Fix check for empty route
Gamenot 18cc074
Fix bugs with provider changes
Gamenot ed5f65d
Add required property to provider
Gamenot 79f0597
Add provider error handling
Gamenot 0d15ccf
Add `__sim__` done
Gamenot 60ebc4d
Format
Gamenot dcc6812
Update changelog
Gamenot 3ab1f1e
Fix missing changes
Gamenot 92fbea7
Add unsaved file
Gamenot 203c857
Push another unsaved file.
Gamenot a0d9978
Document new methods
Gamenot 57175d4
Move recovery flag configuration to SMARTS
Gamenot 6d951d2
Apply suggestions
Gamenot 1c519f8
Fix provider not inheriting from Provider
Gamenot 2fcc59f
Revert unimportant changes
Gamenot 68dbe98
Note make test test_notebook timeout in CHANGELOG
Gamenot 482baec
Make sure notebook tests do not time out
Gamenot ac4aeaa
Update changelog
Gamenot d39aa38
Remove unnecessary EmptyProvider
Gamenot 5a8ae79
Improve provider error handling
Gamenot 929a0f9
Ensure that error handling is working
Gamenot c66c9a8
Fix issue that causes crash with TrapManager
Gamenot a3ec597
Fix `SumoTrafficSimulation.recover` definition
Gamenot 2ff5ef3
Add missing import
Gamenot 4330279
Handle `SMARTS.reset(..)` errors
Gamenot fabe209
Set default recover to re-raise exception
Gamenot 35b0b92
Address comments.
Gamenot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,7 +30,7 @@ | |
from shapely.geometry import CAP_STYLE, JOIN_STYLE, Point, Polygon | ||
|
||
from smarts.core.data_model import SocialAgent | ||
from smarts.core.plan import Mission, Plan, PositionalGoal, Start | ||
from smarts.core.plan import EndlessGoal, Mission, Plan, PositionalGoal, Start | ||
from smarts.core.road_map import RoadMap | ||
from smarts.core.utils.id import SocialAgentId | ||
from smarts.core.utils.string import truncate | ||
|
@@ -550,10 +550,11 @@ def _prepare_sensors_for_agent_control( | |
# Setup mission (also used for observations) | ||
# XXX: this is not quite right. route may not be what the agent wants to take. | ||
route = sim.traffic_sim.vehicle_route(vehicle_id=vehicle.id) | ||
mission = Mission( | ||
start=Start(vehicle.position[:2], vehicle.heading), | ||
goal=PositionalGoal.from_road(route[-1], sim.scenario.road_map), | ||
) | ||
if len(route) > 0: | ||
goal = PositionalGoal.from_road(route[-1], sim.scenario.road_map) | ||
else: | ||
goal = EndlessGoal() | ||
Comment on lines
+553
to
+556
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I believe this was a bug with a 0 length route being considered a positional goal when there is no end edge. |
||
mission = Mission(start=Start(vehicle.position[:2], vehicle.heading), goal=goal) | ||
plan.create_route(mission) | ||
|
||
def _start_social_agent( | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is that we could treat the sim as also having the possibility to be done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It can come through the
dones
fromSMARTS
; however, at the gym level it would need to be translated.