Skip to content
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

clean(perception): Improve generics usage in perception module #416

Merged
merged 48 commits into from
Dec 9, 2024

Conversation

schwepmo
Copy link
Contributor

@schwepmo schwepmo commented Sep 24, 2024

Description

  • This PR implements a more coherent way to use generics when handling different SpatialObjects
  • Additionally some cleanup was done
  • This should be merged after build: migrate to Java 17 #410

Issue(s) related to this PR

  • not related to an issue

Affected parts of the online documentation

Changes in the documentation required?

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

@schwepmo schwepmo added the clean-up Aesthetically improving code label Sep 24, 2024
@schwepmo schwepmo changed the title improvement(perception): Improve generics usag in perception module improvement(perception): Improve generics usage in perception module Dec 2, 2024
hoelger and others added 9 commits December 2, 2024 17:14
* add gitignore
* run `npm install` > new lockfile version
* run `npx browserslist@latest --update-db`
* run `npm audit fix`
* run `npm audit fix --force`
* fix: exclude the node_modules folder from build
…419)

* chore: `npm run-script debug` output is now spanning multiple lines
* fix: remove double bookkeeping (equippedVehicles) and directly add vehicles to the map, although there's no position yet
* fix: take into account the vehicleClass, show 'unknown' if not a car
* swap icons
* feat: add bicycle and bus icons
* refactor: remove line that has no effect
* refactor: change tab size from 2 to 4
* fix: only display equipped traffic lights
* fix: replace non-existing link
)

* fix: disallow servers to read environmental data
* fix: adapt ReleaseBarnimIT tests
* fix: enable assert in ReleaseBarnimLibsumoIT
* fix: Use own position when logging at which point the route was changed
* fix: separate event-tx and message-rx functionality
* fix: rather print connections than nodes because that's the more critical information
* fix: remove redundant information
* refactor: use precise wording, as the route switch may still fail
* feat: fail hard when running ns3 on windows
* fix: do not download if the file already exists
* fix: remove assumption that glob resolves to only one file
* fix: rewrite so that protobuf genereration can be skipped
* fix: require protobuf-compiler
* fix: improve error message
hoelger and others added 18 commits December 2, 2024 17:14
* build: store etc-files in mosaic-starter and copy them to bundle and integration tests
* clean: remove unnecessary properties from copy-resources definition
* ci: use SUMO 1.21.0 for testing
* feat(sumo): support SUMO 1.21.0

Added hint, that SUMO_HOME/bin must be present in the PATH variable. Pre-loading some libraries is not required anymore then.
* refactor: don't use this whenever possible
… routing (#428)

* feat(sns): cleanup, minor performance improvement for flooding (early exit if flooding could not be progressed)
…nts (#420)

* feat: introducing SensorModule to provide access to environmental events
* feat(application): allow registration of callback for lidar sensor module
* feat(application): re-use Perceptive interface for accessing new sensor modules
* feat: support win:mosaic-git together with wsl:omnet
* fix: correctly log inside ObjectInstantiation
* feat: throw error if omnetpp.ini file is missing
* feat: throw error if ns3_federate_config.xml file is missing
* fix(workshop): Enabled color changing of externally added vehicles in SUMO
* feat: Refactored AdHoc message routing
* feat: Added hops argument for builder
* refactor: tabs to spaces
* feat: provide dev mode where src files are not deleted
* feat: make available over CL args
* fix: Added comments for CellMessageRoutingBuilder and fixed AdHocMessageRoutingBuilder
@schwepmo
Copy link
Contributor Author

schwepmo commented Dec 2, 2024

@kschrab the commit history is somewhat destroyed, but the branch should be ready for review again.

@kschrab
Copy link
Contributor

kschrab commented Dec 5, 2024

@schwepmo can you briefly elaborate what the main motivation/reason was for this PR? I see the changes, and they make sense, I just don't exactly found the starting point from where you improved the use of generics/wildcards here.

@schwepmo schwepmo self-assigned this Dec 6, 2024
@schwepmo schwepmo requested a review from kschrab December 6, 2024 08:40
@schwepmo
Copy link
Contributor Author

schwepmo commented Dec 6, 2024

@schwepmo can you briefly elaborate what the main motivation/reason was for this PR? I see the changes, and they make sense, I just don't exactly found the starting point from where you improved the use of generics/wildcards here.

@kschrab
I think I started from <T extends SpatialObject<T>> List<SpatialObject<T>> getPerceivedObjects(); in the PerceptionModule, as well as the apply-method in the PerceptionModifier class.
The AbstractPerceptionModule the overrides the return type of getPerceivedObjects with a raw version of SpatialObject. Now with the introduction of the upper-bounded wildcards a) the signature of getPerceivedObjects() is somewhat cleaner and b) we get rid of some IDE warnings.

Functionally these changes do nothing. Though in the MR of the extended part there is some cleanup of applications

@kschrab kschrab changed the title improvement(perception): Improve generics usage in perception module clean(perception): Improve generics usage in perception module Dec 9, 2024
@kschrab kschrab merged commit 6650436 into main Dec 9, 2024
5 checks passed
@kschrab kschrab deleted the improve-perception-generics branch December 9, 2024 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
clean-up Aesthetically improving code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants