Conversation
35e471b to
a1dccfc
Compare
There was a problem hiding this comment.
Pull Request Overview
This PR fixes multiple issues in the event system by replacing string-based event definitions with function-based callbacks, improving time-limit handling in the Gym environment, and adding proper event cleanup when satellites are removed.
- Replaced legacy string conditions/actions with
conditionFunction/actionFunctionin simulator and dynamics modules - Refactored satellite event handling to support callable
extra_actionsand improved image event callbacks - Rounded
time_limitto matchsim_rateand remove stale events for dead satellites in the Gym
Reviewed Changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/bsk_rl/sim/simulator.py | Switched max-step-duration event to use lambda callbacks |
| src/bsk_rl/sim/dyn/relative_motion.py | Converted conjunction/range events to use conditionFunction and actionFunction |
| src/bsk_rl/sats/satellite.py | Refactored update_timed_terminal_event to accept callable actions |
| src/bsk_rl/sats/access_satellite.py | Updated image event creation to use a named side_effect function |
| src/bsk_rl/gym.py | Aligned time_limit to sim_rate and cleaned up terminal/image events on agent death |
Comments suppressed due to low confidence (1)
src/bsk_rl/sim/dyn/relative_motion.py:102
- [nitpick] If
r_BN_Nis already a NumPy array, avoid wrapping it innp.arrayon every tick to reduce allocations. Use the native arrays directly if possible.
)
a1dccfc to
5e3b6b5
Compare
LorenzzoQM
approved these changes
Jul 1, 2025
Contributor
LorenzzoQM
left a comment
There was a problem hiding this comment.
Nice changes. The code looks much cleaner and easier to debug
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Closes #269
Closes #291
Closes #279
Closes #287
Fixes a variety of event system issues.
Type of change
How should this pull request be reviewed?
How Has This Been Tested?
Please describe how tests have been updated to verify your changes.
Future Work
#287 fix is not robust.
Checklist