fix(application): complete VehicleRoute object if it is missing node ids or connection ids #472
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.
Description
If SumoAmbassador is started with a SUMO configuration which includes routes, then all routes from SUMO are read via TraCI and send to the RTI. The application ambassador stores these
VehicleRoute
s in an internal cache. If the application simulator already have a route internally with the same ID, it is overridden with the newVehicleRoute
object coming from SUMO.There is one major issue: All
VehicleRoute
objects created by SumoAmbassador only contain a list of connection IDs. The list of node IDs is always empty. This leads to the problem, that applications which want to use these routes cannot do stuff likegetOs().getNavigationModule().getCurrentRoute().getLastNodeId()
, which is useful for dynamic route calculation.This PR therefore adds the functionality, that the
VehicleRoute
object is always completed/filled with the missing list of nodes or connections, as long at least one of these properties exists. If both are already given, nothing happens.We still override the VehicleRoute in the internal cache of the application simulator, as this is the source of truth when coming from SUMO.
Issue(s) related to this PR
Affected parts of the online documentation
Changes in the documentation required?
No
Definition of Done
Prerequisites
Required
type(scope): description
(in the style of Conventional Commits)enhancement
, orbugfix
)origin/main
has been merged into your Fork.Requested (can be enforced by maintainers)
Special notes to reviewer