Skip to content

Commit

Permalink
chore: modify filenames for extracted px4 params
Browse files Browse the repository at this point in the history
  • Loading branch information
sjschlapbach authored and Jaeyoung-Lim committed Mar 1, 2023
1 parent a11ed6f commit f4d41f6
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ make estimate-model model=quadrotor_model log=resources/quadrotor_model.ulg

## Extract PX4 Parameters from Aerodynamic Model (currently only supported for Fixed Wing Vehicles)

In order to extract important longitudinal trimming parameters directly from the identified aerodynamic model, just add the flag --extraction True to the function call. The extracted parameters are then saved in the same folder as the model results. The configuration has to include the extractor model that is to be used (e.g. the FixedWingExtractorModel) and an extractor configuration, containing user-determined minimum and maximum flight speeds (and optionally a cruise flight speed).
In order to extract important longitudinal trimming parameters directly from the identified aerodynamic model, just add the flag `--extraction True` to the function call. The extracted parameters are then saved in the same folder as the model results. The configuration has to include the extractor model that is to be used (e.g. the FixedWingExtractorModel) and an extractor configuration, containing user-determined minimum and maximum flight speeds (and optionally a cruise flight speed).

In preparation for a potentially more model-based control approach in the PX4-Autopilot, more parameters then currently required as estimated. Currently not supported parameters are marked correspondingly:

Expand Down
2 changes: 1 addition & 1 deletion Tools/parametric_model/generate_parametric_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ def start_model_estimation(config, log_path, data_selection="none", plot=False,

extractor.compute_px4_params()
px4_params = extractor.get_px4_params()
extractor.save_px4_params_to_yaml('model_results/' + data_handler.config.extractor_class + '_px4_params')
extractor.save_px4_params_to_yaml('model_results/')

if plot:
model.compute_residuals()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ def get_px4_params(self):
"""
return self.px4_params

def save_px4_params_to_yaml(self, output_file):
def save_px4_params_to_yaml(self, output_folder):
"""
Save the extracted px4 parameters to a yaml file
:param output_file: path to the output file
:param output_folder: path to the output file
"""
timestr = time.strftime("%Y-%m-%d-%H-%M-%S")
file_path = output_file + "_" + timestr + ".yaml"
file_path = output_folder + self.model_name + '_px4_params' + "_" + timestr + ".yaml"

with open(file_path, 'w') as outfile:
yaml.dump(self.px4_params, outfile, default_flow_style=False)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ def get_px4_params(self):
"""
return self.px4_params

def save_px4_params_to_yaml(self, output_file):
def save_px4_params_to_yaml(self, output_folder):
"""
Save the extracted px4 parameters to a yaml file
:param output_file: path to the output file
:param output_folder: path to the output file
"""
timestr = time.strftime("%Y-%m-%d-%H-%M-%S")
file_path = output_file + "_" + timestr + ".yaml"
file_path = output_folder + self.model_name + '_px4_params' + "_" + timestr + ".yaml"

with open(file_path, 'w') as outfile:
yaml.dump(self.px4_params, outfile, default_flow_style=False)
Expand Down

0 comments on commit f4d41f6

Please sign in to comment.