-
Notifications
You must be signed in to change notification settings - Fork 17
Add Blimp, AntennaTracker, and AP_Periph #12
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
HTRamsey
wants to merge
1
commit into
ArduPilot:main
Choose a base branch
from
HTRamsey:dev-blimp-antenna-periph
base: main
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
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
| Original file line number | Diff line number | Diff line change | ||||||
|---|---|---|---|---|---|---|---|---|
|
|
@@ -20,13 +20,18 @@ class Groundskeeper: | |||||||
| temp_folder = tempfile.mkdtemp() | ||||||||
|
|
||||||||
| valid_name_map = { | ||||||||
| 'AntennaTracker': 'Tracker', | ||||||||
| 'AP_Periph': 'AP_Periph', | ||||||||
| 'APMrover2': 'Rover', | ||||||||
| 'ArduCopter': 'Copter', | ||||||||
| 'ArduPlane': 'Plane', | ||||||||
| 'ArduSub': 'Sub', | ||||||||
| 'Blimp': 'Blimp', | ||||||||
| 'Copter': 'Copter', | ||||||||
| 'Plane': 'Plane', | ||||||||
| 'Rover': 'Rover', | ||||||||
| 'Sub': 'Sub', | ||||||||
| 'Tracker': 'Tracker' | ||||||||
| } | ||||||||
|
|
||||||||
| def __init__(self): | ||||||||
|
|
@@ -45,7 +50,19 @@ def get_version_for_tag(self, tag) -> Tuple[int, int]: | |||||||
| # try to read <vehicle>/version.h | ||||||||
| path1 = Path(f'{self.repository_path}/{tag["matches"]["name"]}/version.h') | ||||||||
| path2 = Path(f'{self.repository_path}/{self.valid_name_map[tag["matches"]["name"]]}/version.h') | ||||||||
| file = path1 if path1.exists() else path2 | ||||||||
| path3 = Path(f'{self.repository_path}/Tools/{tag["matches"]["name"]}/version.h') | ||||||||
| path4 = Path(f'{self.repository_path}/Tools/{self.valid_name_map[tag["matches"]["name"]]}/version.h') | ||||||||
| if path1.exists(): | ||||||||
| file = path1 | ||||||||
| elif path2.exists(): | ||||||||
| file = path2 | ||||||||
| elif path3.exists(): | ||||||||
| file = path3 | ||||||||
| elif path4.exists(): | ||||||||
| file = path4 | ||||||||
| else: | ||||||||
| raise FileNotFoundError(f'No version.h found for tag {tag["matches"]["name"]}') | ||||||||
|
|
||||||||
| with open(file=file, mode='r') as version_file: | ||||||||
| content = version_file.read() | ||||||||
| match = re.search(r'#define\s+FW_MAJOR\s+(\d+)', content) | ||||||||
|
|
@@ -126,7 +143,7 @@ def run(self): | |||||||
|
|
||||||||
| print(f'Processing: {folder_name}..') | ||||||||
| # Old versions are not mantained and generation of the files is not fully supported | ||||||||
| if tag_major_version < 4: | ||||||||
| if vehicle_type != "AP_Periph" and tag_major_version < 4: | ||||||||
| print("Ignoring old version") | ||||||||
| continue | ||||||||
|
|
||||||||
|
|
@@ -157,7 +174,7 @@ def run(self): | |||||||
| os.remove(data) | ||||||||
|
|
||||||||
| # Run MAVLink messages parser | ||||||||
| vehicle = f'{"Ardu" if vehicle_type != "Rover" else ""}{vehicle_type}' | ||||||||
| vehicle = f'{"Ardu" if vehicle_type in ["Copter", "Plane", "Sub"] else ""}{vehicle_type}' | ||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||||
| try: | ||||||||
| # The parser expects to be run from its normal place in the repository | ||||||||
| script_folder = f'{self.repository_path}/Tools/scripts/' | ||||||||
|
|
||||||||
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.
This isn't particularly necessary, but it does make it easier to add additional options in future...