Consume wind msgs in all drag effectors#1333
Conversation
90a63b8 to
b3b4f48
Compare
5c07b1b to
9a0cc56
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9a0cc5622c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
9a0cc56 to
1747fe8
Compare
|
Should I add example scenarios demonstrating the use of wind messages with drag effectors? |
schaubh
left a comment
There was a problem hiding this comment.
nice work. Very minor recommendation only. Should be quick to address my feedback.
src/simulation/forceTorque/cannonballDrag/_UnitTest/test_cannonballDrag.py
Outdated
Show resolved
Hide resolved
|
Example scenarios are always nice. Or, instead of adding a new scenario, we have an atmospheric drag example already. Why not enhance that scenario to include the wind model? This way we have one scenario that shows everything. You can state in the python example script that the use of the wind module is optional? |
1747fe8 to
ade24d9
Compare
ade24d9 to
cbd65c7
Compare
Description
Extends atmosphere-relative velocity to all three drag effectors:
DragDynamicEffector,FacetDragDynamicEffector, andCannonballDrag. Replaces the former manual co-rotation approach with consumption of theWindMsgPayloadproduced by the wind environment modules introduced in PR #1329.Motivation
DragDynamicEffectorpreviously exposed auseAtmosphereRelativeVelocity/planetOmega_Npair to approximate co-rotating atmosphere drag (PR #1318 ).
FacetDragDynamicEffectorandCannonballDraglacked any relative-velocity support at all. Now that
WindBase/ZeroWindModelproduce awell-defined
WindMsgPayload, the drag modules can consume it directly and all three effectorsshare an identical, consistent interface.
Changes
DragDynamicEffectorwindVelInMsg(ReadFunctor<WindMsgPayload>).updateDragDir()now subtractsv_air_Nfromv_BN_Nwhen the message is linked, yieldingv_B_air_N(spacecraft velocity relative to air, body frame) as the drag velocity.useAtmosphereRelativeVelocity,setPlanetOmega_N(),getPlanetOmega_N(),hubPosition, and the associatedReset()guard — superseded by the wind message.astroConstants.hinclude.FacetDragDynamicEffectorwindVelInMsg(ReadFunctor<WindMsgPayload>) — same contract asDragDynamicEffector.updateDragDir()follows the samev_BN_N/v_B_air_Npattern.CannonballDragwindVelInMsg(ReadFunctor<WindMsgPayload>).UpdateState()subtractsv_air_Nfromv_BN_Nwhen the message is linked before rotating intothe site frame, yielding
v_B_air_N.ExamplesscenarioDragDeorbit.py: added optionaluseWind=Falseargument to run(); when True, loads SPICE with theIAU_EARTHframe, instantiatesZeroWindModel, and subscribesdragEffector.windVelInMsgto it so drag is computed against the atmosphere-relative velocity.scenarioDragRendezvous.py: sameuseWind=Falseargument added to bothdrag_simulator()andrun(); when True, a singleZeroWindModelis shared between chief and deputy - each spacecraft is registered viaaddSpacecraftToModeland the corresponding output message subscribed to each drag effector independently.scenarioStochasticDragSpacecraft.py:useWind=Falseargument added torun(); SPICE +ZeroWindModelblock inserted after the gravity setup, linked to the cannonball drag effector.scenarioAerocapture.py:useWind=Falseargument added torun(); the wind block is guarded byplanetCase == "Earth"so the Mars case is unaffected.Verification
Unit tests updated in each effector's
_UnitTest/directory.test_atmoDrag.py:test_dragInertialVelocity— numerical check: drag matches cannonball reference when no windmessage is linked (inertial velocity path).
test_drag_wind_velocity_automatic_usage— smoke test: simulation initialises andReset()completes without error when
windVelInMsgis not linked.test_drag_wind_velocity_with_wind_message— integration test withZeroWindModel: verifiesthat
v_air_Nis non-trivial (co-rotation) and is consumed by the effector.test_scenarioDragOrbit— pre-existing orbit scenario retained unchanged.test_unitFacetDrag.py:test_facetDragInertialVelocity— numerical check: facet drag matches reference when no wind islinked.
test_facet_drag_wind_velocity_automatic_usage— smoke test (no wind linked).test_facet_drag_wind_velocity_with_wind_message— integration test withZeroWindModel.test_DragCalculationandtest_ShadowCalculationparametrised tests retained.test_cannonballDrag.py:test_cannonball_drag_wind_velocity_automatic_usage— smoke test (no wind linked).test_cannonball_drag_wind_velocity_with_wind_message— integration test withZeroWindModel.test_cannonballDrag(isolated numerical) andtest_orbit(MuJoCo integration)retained unchanged.
Documentation
dragDynamicEffector.rst: replaced "Atmosphere Relative Velocity" section with "Wind VelocityInput"; added
windVelInMsgto I/O table; updatedv_Bmember comment.facetDragDynamicEffector.rst: Wind Velocity Input section, andwindVelInMsgto I/O table.cannonballDrag.rst: addedwindVelInMsgto I/O table; updated Detailed Behavior step list todescribe the relative-velocity computation.
docs/source/Support/bskReleaseNotesSnippets/1325-atmo_rel_vel_all_drag.rst.1317-atmo_rel_vel_dragDynEff.rstremoved.