-
Notifications
You must be signed in to change notification settings - Fork 47
feat(sim): add map and terrain inputs #68
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
Open
Komzpa
wants to merge
23
commits into
meshtastic:master
Choose a base branch
from
Komzpa:codex/split-input-terrain
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
d12c62f
feat(sim): add map and terrain inputs
Komzpa 2d0cdfb
fix(sim): handle uncovered SRTM scenario bbox
Komzpa 63bbdd1
fix(sim): clarify map terrain import defaults
Komzpa efdb5ed
fix(sim): preserve map altitude during terrain recompute
Komzpa 8568faf
feat(sim): import local NodeDB positions
Komzpa 6e619a2
fix(sim): validate nodedb port and edge srtm tiles
Komzpa 59fe5d6
fix(sim): sample srtm edge coordinates from existing tiles
Komzpa fade708
fix(sim): limit auto srtm tiles to reachable paths
Komzpa 5645d61
docs(sim): clarify nodedb and srtm usage
Komzpa cf1ab3e
fix(sim): fit bounds to imported node coordinates
Komzpa 7fd31e9
fix(sim): keep bounds unchanged on rejected terrain imports
Komzpa a7f0399
fix(sim): adapt terrain inputs to current radio config
Komzpa 5351c12
fix(sim): reset imported bounds and cap terrain cache
Komzpa 7b37280
fix(sim): preserve numeric NodeDB roles
Komzpa f3afb94
fix(sim): harden terrain input reuse
Komzpa a71e586
fix(sim): decode near-zero integer coordinates
Komzpa 362527a
fix(sim): distinguish scaled integer coordinates
Komzpa 4c9d024
fix(sim): harden map altitude and role imports
Komzpa 4db15ff
fix(sim): reject unusable scenario origin blocks
Komzpa 81ad320
fix(sim): isolate concurrent srtm tile downloads
Komzpa 64cc94c
fix(sim): invalidate terrain loss cache across grid swaps
Komzpa a249052
perf(sim): prefilter srtm link pairs by maximum flat range
Komzpa b0530ee
fix(sim): bound nodedb TCP connection attempts
Komzpa File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| """Small geographic validation helpers shared by map-oriented inputs.""" | ||
|
|
||
| import math | ||
|
|
||
|
|
||
| def valid_lat_lon(lat, lon): | ||
| """Return whether latitude/longitude are finite WGS84-style coordinates.""" | ||
| return ( | ||
| math.isfinite(lat) | ||
| and math.isfinite(lon) | ||
| and -90.0 <= lat <= 90.0 | ||
| and -180.0 <= lon <= 180.0 | ||
| ) |
Oops, something went wrong.
Oops, something went wrong.
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.
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.
📐 Maintainability & Code Quality | 🟠 Major | ⚡ Quick win
node_antenna_heightis copy-pasted across modules and the copies already differ. The shared root cause is that each module defines its own helper instead of importing one definition. Thelib/common.pycopy readsantennaHeightbeforeantenna_height; thelib/terrain.pycopy reads them in the opposite order. Both resolve to the same value forNodeConfigandMeshNodetoday, so this is not a live defect, but a future node type that carries only one of the two attributes would behave differently depending on which copy runs.loraMesh.pyholds a fourth copy with the same problem.lib/common.py#L9-L11: keep this as the single definition and fix the lookup order to match the terrain semantics you want.lib/common.pyhas no terrain dependency, so it stays import-cycle free.lib/terrain.py#L131-L137: delete the local definition and import the helper fromlib.common.lib/packet.py#L4-L7: keep thefrom lib.common import node_antenna_heightimport at line 4 and delete the shadowing local definition reported at lines 9-11.Apply the same deletion to the
loraMesh.pycopy so all call sites resolve one definition.📍 Affects 3 files
lib/common.py#L9-L11(this comment)lib/terrain.py#L131-L137lib/packet.py#L4-L7🤖 Prompt for AI Agents