PteraSoftware icon indicating copy to clipboard operation
PteraSoftware copied to clipboard

Adding free flight simulations

Open camUrban opened this issue 1 month ago • 1 comments

Description

This PR adds the ability to perform simulations that couple an airplane's motion to the aerodynamic forces due to its motion.

Motivation

Adding coupled simulations increases the use-cases of Ptera Software beyond pure aerodynamic investigations and makes it more attractive for general robotics simulations.

Relevant Issues

Closes #65 and improves upon solution to #50.

Changes

  • Adds the CoupledOperatingPoint class to pterasoftware/operating_point.py
  • Adds the CoupledMovement class to pterasoftware/movements/movement.py
  • Adds the CoupledUnsteadyProblem class to pterasoftware/problems.py
  • Adds the CoupledSteadyProblem class to pterasoftware/problems.py
  • Adds pterasoftware/mujoco_model.py, which contains the MuJoCoModel class.
  • Adds pterasoftware/coupled_unsteady_ring_vortex_lattice_method.py, which contains the CoupledUnsteadyRingVortexLatticeMethodSolver class.
  • Updates pterasoftware/__init__.py to import the new modules.
  • Fixes inconsistency in UnsteadyRingVortexLatticeMethodSolver's _calculate_loads method where it was using different functions for calculating the cross product for each LineVortex leg.
  • Removes redundant increment of index variable in pterasoftware.output.animate.
  • Adds checks to prevent plotting non-existent wake RingVortex pterasoftware.output.animate and pterasoftware.output.draw.
  • Changes output formatting in output.print_results to display values in scientific notation for better readability across scales.
  • Introduces the rotationPointOffset_Gs_Ler parameter to WingMovement, allowing specification of a custom rotation point for wing angular motion.
  • Improves delta_time's "optimize" mode by tuning the local optimizer and introducing a fall back to dual annealing as a global optimizer.
  • Fixes a bug in delta_time's "optimize" mode where static cases weren't improved.
  • Speeds up test suite by removing redundant tests and using coarser mesh parameters for geometry fixtures.
  • Refactors CLAUDE.md to be significantly shorter by breaking up instructions and guidelines into other files in docs/. This uses the progressive disclosure strategy known to produce better results.
  • Adds MUJOCO_CONVENTIONS.md file with verified interpretations of MuJoCo's relevant inputs and outputs.
  • Adds animate_free_flight function in output.py, along with a few helper functions.

Temporary Debug Scripts to Remove Before Merging

  • [ ] debugging_scripts and all files within
  • [ ] docs/FREE_FLIGHT_DEVELOPMENT.md
  • [ ] gammabot_simulations and all files within

New Dependencies

  • MuJoCo

Change Magnitude

Moderate: Medium-sized change that adds or modifies a feature without large-scale impact.


Checklist

  • [x] I have created or claimed an issue for this work as described in Contributing Code.
  • [ ] My branch is based on main and is up to date with the upstream main branch.
  • [x] All calculations use S.I. units.
  • [x] Code is formatted with black (line length = 88).
  • [x] Code is well documented with block comments where appropriate.
  • [x] Any external code, algorithms, or equations used have been cited in comments or docstrings.
  • [x] All new modules, classes, functions, and methods have docstrings in reStructuredText format, and are formatted using docformatter (--in-place --black). See the style guide for type hints and docstrings for more details.
  • [x] All new classes, functions, and methods in the pterasoftware package use type hints. See the style guide for type hints and docstrings for more details.
  • [ ] If any major functionality was added or significantly changed, I have added or updated tests in the tests package.
  • [x] Code locally passes all tests in the tests package.
  • [ ] After pushing, PR passes all automated checks (codespell, black, mypy, and tests).
  • [x] PR description links all relevant issues and follows this template.

camUrban avatar Nov 24 '25 22:11 camUrban