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

Patch: Running example_vasarhelyi with quadcopter drone type #12

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

d-marson
Copy link

These proposed changes are based on attempts to run example_vasarhelyi with DRONE_TYPE = "quadcopter"

First issue addressed:

  • Indexing error occurs on line 287 of Swarm.m after the main simulation is finished but during plotting and swarm state analysis. The error seems to be because vel_xyz_history is empty. When example_vasarhelyi is run with DRONE_TYPE = "point_mass", each drone's pos_ned_history and vel_xyz_history are saved by the method Drone.update_state (lines 376 to 387). When running DRONE_TYPE = "quadcopter", Drone.compute_kinematics is called instead and it saves pos_ned_history but does not save vel_xyz_history.
  • This merge request suggests a modification to Drone.compute_kinematics to save vel_xyz_history. The if statement needs to check for an empty array because vel_xyz_history does not have values assigned to it prior to this point (pos_ned_history appears to have values assigned to it by the method Drone.set_pos by swarm initialization)
  • I have also encapsulated the check against a vector of NaNs within an isequal to ensure the if statement does its check against a logical scalar.

Second issue addressed:

  • The drones appear to spend the first part of the simulation traveling down, below an altitude of 0, before they start to maintain altitude. The file param_swarm includes a line that is commented out with the comment "leave empty if you use a real drone model."
  • The addition of an if statement that assigns a value to p_swarm.max_a based on DRONE_TYPE appears to fix the issue, and is consistent with other usages of DRONE_TYPE in other parameter files to assign parameter values.
  • See attached plots.

altitude_timeStep_beforeFix

altitude_timeStep_afterFix

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.

1 participant