Skip to content
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

Adding Fixed-Wing Model #115

Merged
merged 6 commits into from
Aug 1, 2021
Merged

Adding Fixed-Wing Model #115

merged 6 commits into from
Aug 1, 2021

Conversation

manumerous
Copy link
Contributor

@manumerous manumerous commented Jul 20, 2021

Problem Description
Since there were no fixedwing model in this pipeline, this PR adds a fixedwing model in order to test the estimation of aerodynamic parameters

@manumerous manumerous marked this pull request as draft July 20, 2021 20:22
Adding a standard wing model that corresponds to the PX4 standard plane airframe. It has ailerons but no flaps and estimated all present forces but not yet the moments.
The old fuselage drag model had an dependence on the angle of attack in x-direction. This seems very overkill given that even a single fuselage drag coefficient is hard to observe separatly from the dominant rotor drag force.
This commit adds the standard plane model and adapts the generation of the stadard vtol model to be based on this new model.
@Jaeyoung-Lim
Copy link
Member

Added model configs, but still errors as below

$ make estimate-model model=standardplane_model log=resources/standardplane_model.ulg 
python3 Tools/parametric_model/generate_parametric_model.py --model standardplane_model --config /home/jaeyoung/dev/data-driven-dynamics/Tools/parametric_model/configs/standardplane_model.yaml --data_selection False resources/standardplane_model.ulg 
Visual Data selection enabled:  False
Initializing of configuration succesfull. 
Resample frequency:  100.0 Hz
Starting data resampling of topic types:  dict_keys(['actuator_outputs', 'vehicle_local_position', 'vehicle_attitude', 'vehicle_angular_velocity', 'sensor_combined', 'vehicle_angular_acceleration'])
Traceback (most recent call last):
  File "Tools/parametric_model/generate_parametric_model.py", line 76, in <module>
    start_model_estimation(arg_list)
  File "Tools/parametric_model/generate_parametric_model.py", line 33, in start_model_estimation
    data_handler.loadLog(arg_list.log_path)
  File "/home/jaeyoung/dev/data-driven-dynamics/Tools/parametric_model/src/tools/data_handler.py", line 62, in loadLog
    self.compute_resampled_dataframe()
  File "/home/jaeyoung/dev/data-driven-dynamics/Tools/parametric_model/src/tools/data_handler.py", line 95, in compute_resampled_dataframe
    fts = compute_flight_time(self.ulog)
  File "/home/jaeyoung/dev/data-driven-dynamics/Tools/parametric_model/src/tools/dataframe_tools.py", line 45, in compute_flight_time
    t_start = act_df_crp.iloc[1, 0]
  File "/home/jaeyoung/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 873, in __getitem__
    return self._getitem_tuple(key)
  File "/home/jaeyoung/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 1443, in _getitem_tuple
    self._has_valid_tuple(tup)
  File "/home/jaeyoung/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 702, in _has_valid_tuple
    self._validate_key(k, i)
  File "/home/jaeyoung/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 1352, in _validate_key
    self._validate_integer(key, axis)
  File "/home/jaeyoung/.local/lib/python3.6/site-packages/pandas/core/indexing.py", line 1437, in _validate_integer
    raise IndexError("single positional indexer is out-of-bounds")
IndexError: single positional indexer is out-of-bounds
Makefile:33: recipe for target 'estimate-model' failed
make: *** [estimate-model] Error 1

@Jaeyoung-Lim
Copy link
Member

Jaeyoung-Lim commented Aug 1, 2021

This is because the data frame is filtered by the minimum PWM threshold 1500, but none of it exists:

act_df_crp = act_df[act_df.iloc[:, 2] > pwm_threshold]

Fixed with a hack: by moving the default index to the third actuator (which the fixedwing has a motor).

The default index for filtering out invalid data had to be switched to the third actuator


Shift index for plotting


F
@Jaeyoung-Lim
Copy link
Member

Since I think all the structure to run is now in place, I am merging this so that I can work on linking the model with simulation.

I guess we can fix all the issues there 😄

Thanks @manumerous !

@Jaeyoung-Lim Jaeyoung-Lim marked this pull request as ready for review August 1, 2021 10:39
@Jaeyoung-Lim Jaeyoung-Lim merged commit e438bbb into master Aug 1, 2021
@Jaeyoung-Lim Jaeyoung-Lim deleted the pr-add-fw-model branch August 1, 2021 10:40
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.

None yet

2 participants