-
Notifications
You must be signed in to change notification settings - Fork 55
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
feat: introducing SensorModule to provide access to environmental events #420
base: main
Are you sure you want to change the base?
Conversation
had a very brief read and came up with following things:
|
# Conflicts: # app/tutorials/traffic-light-communication/src/main/java/org/eclipse/mosaic/app/tutorial/EventSendingApp.java # app/tutorials/weather-warning/src/main/java/org/eclipse/mosaic/app/tutorial/WeatherServerApp.java # app/tutorials/weather-warning/src/main/java/org/eclipse/mosaic/app/tutorial/WeatherWarningApp.java # fed/mosaic-application/src/main/java/org/eclipse/mosaic/fed/application/ambassador/simulation/AbstractSimulationUnit.java
} | ||
|
||
@Override | ||
public void reactOnSensorDataUpdate(Consumer<EnvironmentSensorData> consumer) { | ||
callbacks.add(consumer); |
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.
Why do we remove this handy option to add callbacks? :)
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.
I removed that at least for this basic sensor, as I noticed it was not implemented correctly and doing it right would require more effort. The callback was only triggered when the vehicle entered the event area, but not when it left it or when the event time has reached its end. We can later offer this method, but right now it would not work as expected and would be out of scope of this re-design.
@@ -99,7 +94,6 @@ public abstract class AbstractSimulationUnit implements EventProcessor, Operatin | |||
|
|||
private final AdHocModule adhocModule; | |||
private final CellModule cellModule; | |||
private final SensorModule sensorModule; |
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.
I don't understand why the module now goes into VehicleUnit
. So implementing it here was wrong in the first place?
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.
Yes, as long as we only support vehicles with the proposed sensor modules, it's sufficient to initialize the implementation in the VehicleUnit
only. We can discuss if we already want RSUs or TrafficLights to be able be Sensible
, but again, this more sounds like a feature than a re-design.
Description
BasicSensorModule
is a single-value based sensor model which can be used to detect icy or rainy areas (e.g., viagetOs().getBasicSensorModule().getStrengthOf(SensorType.ICE)
. This replaces the methodgetOs().getStateOfEnvironmentSensor(SensorType.ICE)
in the generalOperatingSystem
. The data for this sensor module is produced by theEnvironmentAmbassador
.LidarSensorModule
provides access to the previously addedPointCloud
structure which is produced by vehicle simulators such as PHABMACS or Carla.VehicleUnit
s are able to use the new sensor modules.WeatherWarningApp
).Issue(s) related to this PR
Affected parts of the online documentation
Changes in the documentation required?
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