Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix(application): complete VehicleRoute object if it is missing node ids or connection ids #472

Merged
merged 2 commits into from
Mar 6, 2025

Conversation

kschrab
Copy link
Contributor

@kschrab kschrab commented Feb 24, 2025

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 VehicleRoutes in an internal cache. If the application simulator already have a route internally with the same ID, it is overridden with the new VehicleRoute 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 like getOs().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

  • Resolves internal issue 1006

Affected parts of the online documentation

Changes in the documentation required?

No

Definition of Done

Prerequisites

  • You have read CONTRIBUTING.md carefully.
  • You have signed the Contributor License Agreement.
  • Your GitHub user id is linked with your Eclipse Account.

Required

  • The title of this merge request follows the scheme type(scope): description (in the style of Conventional Commits)
  • You have assigned a suitable label to this pull request (e.g., enhancement, or bugfix)
  • origin/main has been merged into your Fork.
  • Coding guidelines have been followed (see CONTRIBUTING.md).
  • All checks on GitHub pass.
  • All tests on Jenkins pass.

Requested (can be enforced by maintainers)

  • New functionality is covered by unit tests or integration tests. Code coverage must not decrease.
  • If a bug has been fixed, a new unit test has been written (beforehand) to prove misbehavior
  • There are no new SpotBugs warnings.

Special notes to reviewer

@kschrab kschrab added the bugfix Pull requests that fixes a bug label Feb 24, 2025
@kschrab kschrab self-assigned this Feb 24, 2025
Copy link
Contributor

@hoelger hoelger left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apart from minor taste things, LGTM

@kschrab kschrab merged commit 0328cfb into main Mar 6, 2025
5 checks passed
@kschrab kschrab deleted the 1006-complete-route-definitions branch March 6, 2025 15:14
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bugfix Pull requests that fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants