PteraSoftware
PteraSoftware copied to clipboard
Adding free flight simulations
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
CoupledOperatingPointclass topterasoftware/operating_point.py - Adds the
CoupledMovementclass topterasoftware/movements/movement.py - Adds the
CoupledUnsteadyProblemclass topterasoftware/problems.py - Adds the
CoupledSteadyProblemclass topterasoftware/problems.py - Adds
pterasoftware/mujoco_model.py, which contains theMuJoCoModelclass. - Adds
pterasoftware/coupled_unsteady_ring_vortex_lattice_method.py, which contains theCoupledUnsteadyRingVortexLatticeMethodSolverclass. - Updates
pterasoftware/__init__.pyto import the new modules. - Fixes inconsistency in
UnsteadyRingVortexLatticeMethodSolver's_calculate_loadsmethod where it was using different functions for calculating the cross product for eachLineVortexleg. - Removes redundant increment of index variable in
pterasoftware.output.animate. - Adds checks to prevent plotting non-existent wake
RingVortexpterasoftware.output.animateandpterasoftware.output.draw. - Changes output formatting in
output.print_resultsto display values in scientific notation for better readability across scales. - Introduces the
rotationPointOffset_Gs_Lerparameter toWingMovement, 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.mdfile with verified interpretations of MuJoCo's relevant inputs and outputs. - Adds
animate_free_flightfunction inoutput.py, along with a few helper functions.
Temporary Debug Scripts to Remove Before Merging
- [ ]
debugging_scriptsand all files within - [ ]
docs/FREE_FLIGHT_DEVELOPMENT.md - [ ]
gammabot_simulationsand 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
mainand is up to date with the upstreammainbranch. - [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
pterasoftwarepackage 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
testspackage. - [x] Code locally passes all tests in the
testspackage. - [ ] After pushing, PR passes all automated checks (
codespell,black,mypy, andtests). - [x] PR description links all relevant issues and follows this template.