Skip to content

examples: draw the Óbuda street map in the SatelliteMobility config - #1399

Open
adamgeorge309 wants to merge 2 commits into
masterfrom
topic/gy/osm-map-coordinate-system
Open

adamgeorge309 wants to merge 2 commits into
masterfrom
topic/gy/osm-map-coordinate-system

Conversation

@adamgeorge309

Copy link
Copy Markdown
Contributor

Before this change, the SatelliteMobility config of examples/mobility showed an empty canvas in Qtenv when the user opened europe and then budapest. The OpenStreetMapSceneCanvasVisualizer inside the Budapest module kept its coordinateSystemModule default, "coordinateSystem", which OMNeT++ resolves from the network. It therefore projected the Óbuda streets through the network's Wgs84EcefGeographicCoordinateSystem instead of the Wgs84AnchoredGeographicCoordinateSystem beside it. The streets landed far outside the map bounds, and adjustBackgroundBox stretched the background box (bgb) over them, so the view fitted to that box (zoom 0.001) showed no street.

After this change, the ini sets *.europe.budapest.map.coordinateSystemModule = "^.coordinateSystem", and the Budapest canvas shows the street map. The setting is in the ini file, beside the other coordinateSystemModule settings of this network, such as that of *.europe.budapest.mobility.

The fix is in the example, not in the default of the parameter. The NED documentation of OpenStreetMapSceneCanvasVisualizer says the default refers to a top-level module, and SceneOsgEarthVisualizer uses the same default. examples/openstreetmap relies on it. There the visualizer is visualizer.sceneVisualizer, so a default of "^.coordinateSystem" would name the nonexistent visualizer.coordinateSystem, and the mandatory reference would stop that example with an error. These two examples are the only users of the visualizer in examples/, showcases/, tests/ and tutorials/. The risk is limited to the SatelliteMobility config in a graphical user interface.

Closes #1398

Commits

  1. tests: change: re-record the SatelliteMobility tyf fingerprint for the new fake GUI probabilities (17a67ca219) prepares: it moves the tyf row of SatelliteMobility in tests/fingerprint/store.json from 772e-b194 to 332a-ea89 and changes nothing else. The cause is opp_repl commit 5049cc8fbe, which changed the fake graphical user interface (GUI) probabilities of the tyf ingredients from 0.1 to 0.001; INET does not change. Without it, the row fails on master under the current opp_repl, and the fix commit would carry two causes in one value. The same commit is the first commit of pull request examples: the Europe map image lines up with the latitudes drawn on it #1397 (the Europe map image) and of a sky view title change that is not filed yet, so it merges once.
  2. examples: fix: draw the Óbuda street map in the SatelliteMobility config sets the parameter in examples/mobility/omnetpp.ini and moves the same row from 332a-ea89 to 4268-429c. It changes what Qtenv draws. The default fingerprints do not change.

No architectural surface is touched: no contract, packet content, feature descriptor or NED default changes; the configuration change is one ini line of an example.

Evidence

All results are from this branch rebased onto master a40c4ffcdc3b05619999411023a916214e2c0fde (build: fix: the description of the INET package names the Testing chapter as text), release build. "Master" below means that commit; its behavior is reproduced on the branch with --*.europe.budapest.map.coordinateSystemModule="coordinateSystem", which restores the old effective value of the only changed line.

Qtenv, examples/mobility, inet -u Qtenv -c SatelliteMobility, canvas of SatelliteNetwork.europe.budapest fitted to a 584 x 455 pixel view, then exported with Qtenv's image export, which writes the whole canvas at the fitted zoom: 2048 x 712 pixels on master and 565 x 352 pixels on this branch. On master the fitted zoom is 0.001, the lowest zoom that Qtenv allows, and the canvas is an empty grey background:

Budapest canvas before the fix

On this branch the fitted zoom is 0.452 and the canvas shows the Óbuda street map:

Budapest canvas after the fix

The world and Europe canvases of the same run still show their maps:

World canvas after the fix

Europe canvas after the fix

examples/openstreetmap (inet -u Qtenv, unchanged by this pull request) still draws the Óbuda map:

examples/openstreetmap after the fix

Fingerprints, with opp_repl at 39e15bcd6e (its current main):

opp_run_fingerprint_tests -m release -f 'examples/(mobility|openstreetmap)'

Master and this branch: 33 PASS each. The visualizer returns from initialize() early without a graphical user interface, so the default fingerprint ingredients (tplx, ~tNl and ~tND) cannot see it.

The graphical fingerprint (tyf) runs with cmdenv-fake-gui, so the visualizer draws, and its background box (in the display strings, y) and street figures (f) enter the hash:

opp_run_fingerprint_tests -m release -f 'examples/(mobility|openstreetmap)' --ingredients tyf

The stored SatelliteMobility row, 772e-b194, was recorded with the fake GUI probabilities 0.1 that opp_repl used before its commit 5049cc8fbe. Since that commit opp_repl runs tyf with 0.001, the values of INET's former fingerprinttest. The SatelliteMobility value under both argument sets:

tyf arguments master this branch
probabilities 0.1 (opp_repl before 5049cc8fbe) 772e-b194 (equals the stored row) 3693-5ddd
probabilities 0.001 (opp_repl since 5049cc8fbe) 332a-ea89 4268-429c

Commit 1 re-records the row from 772e-b194 to 332a-ea89, which the opp_repl runner change alone causes, on the same INET code. Commit 2 moves it from 332a-ea89 to 4268-429c, because the street figures and the background box are now computed in the anchored frame.

At each of the two commits, opp_run_fingerprint_tests -m release --no-build -f 'examples/(mobility|openstreetmap)' gives 33 PASS, and opp_run_fingerprint_tests -m release --no-build -w examples/mobility -c '^SatelliteMobility$' --ingredients tyf gives PASS, against 332a-ea89 after commit 1 and 4268-429c after commit 2. With the re-recorded row, the full tyf run above gives 30 PASS and 2 FAIL on this branch. The two failures, AttachedMobility and SuperpositioningMobility, fail on master too, and this change does not reach them. examples/openstreetmap passes on both.

Two other changes also move this row from 332a-ea89, after the same commit 1: pull request #1397 (the Europe map image) and a change that adds titles above the sky view plots, not filed yet. Whichever of the three merges later must re-record the row again on the merged code.

Gates, on this description without its title line:

doc/project/enforcement/check-pull-request.sh --base origin/master --head HEAD --description-file <this description>

All six gates pass with 0 violations and 0 notes: check-commits.sh, check-classification.sh, check-includes.sh, check-ned-params.sh, check-whatsnew.sh and check-pr-description.sh.

…e new fake GUI probabilities

Before this commit, the tyf fingerprint test of the SatelliteMobility configuration of examples/mobility fails on an unchanged INET tree: the stored value is 772e-b194, and the test now calculates 332a-ea89. The stored value was recorded when opp_repl ran the tyf ingredients with fake graphical user interface (GUI) probabilities of 0.1. opp_repl commit 5049cc8fbe changed these probabilities (before event, after event, on hold and on simulation time) to 0.001.

After this commit, the row stores 332a-ea89, and the test passes again. No INET source, configuration or image changes. The y (display strings) and f (canvas figures) ingredients are added on each refreshDisplay() call that the fake GUI makes, and the probabilities decide when those calls happen, so the new arguments alone move the value. The simulation itself does not change: the other ingredient sets of this configuration keep their stored values.

Provenance: opp_run_fingerprint_tests of opp_repl main 39e15bc, -m release -w examples/mobility -c '^SatelliteMobility$' --ingredients tyf, release build of a40c4ff.

Change: tests | behavior.change | fingerprint
Before this commit, opening europe and then budapest of the SatelliteMobility config in Qtenv showed an empty canvas instead of the Óbuda street map. The OpenStreetMapSceneCanvasVisualizer inside the Budapest module kept its coordinateSystemModule default, "coordinateSystem". OMNeT++ resolves a module path that starts with neither "." nor "^" from the network, so the visualizer used the network's Wgs84EcefGeographicCoordinateSystem, not the Wgs84AnchoredGeographicCoordinateSystem next to it. The streets landed far outside the map bounds, adjustBackgroundBox stretched the background box (bgb) over them, and the fitted view had zoom 0.001 and showed no street.

After this commit, the visualizer refers to its sibling with "^.coordinateSystem", the anchored frame that the comment above the setting describes, whose origin is the north-west corner of obuda.osm. The Budapest canvas shows the street map at a fitted zoom of 0.452 in a 584 x 455 pixel view.

The default of the parameter stays. Its NED documentation says that it refers to a top-level module, and examples/openstreetmap relies on that: there the visualizer is visualizer.sceneVisualizer, so a default of "^.coordinateSystem" would name the nonexistent visualizer.coordinateSystem and stop that example with an error.

To reproduce: in examples/mobility, run "inet -u Qtenv -c SatelliteMobility", open europe, then budapest. The visualizer draws only with a graphical user interface or cmdenv-fake-gui (initialize() returns early otherwise), so the fingerprints of the default ingredients (tplx, ~tNl and ~tND) of examples/mobility and examples/openstreetmap do not see the defect and are unchanged.

The tyf fingerprint of SatelliteMobility runs with cmdenv-fake-gui, so this visualizer's background box (display strings, y) and street figures (f) enter it. The row moves from 332a-ea89 to 4268-429c, because both are now computed in the anchored frame. No other row moves. The tyf rows of AttachedMobility and SuperpositioningMobility fail on master too, and this change does not reach them.

Change: examples | behavior.change.fix | fingerprint

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

examples: the SatelliteMobility Óbuda map projects through the network's coordinate system, not the Budapest module's own

1 participant