Skip to content

Bugfix/event issues#292

Merged
Mark2000 merged 3 commits intodevelopfrom
bugfix/event-issues
Jul 1, 2025
Merged

Bugfix/event issues#292
Mark2000 merged 3 commits intodevelopfrom
bugfix/event-issues

Conversation

@Mark2000
Copy link
Copy Markdown
Contributor

@Mark2000 Mark2000 commented Jul 1, 2025

Description

Closes #269
Closes #291
Closes #279
Closes #287

Fixes a variety of event system issues.

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)

How should this pull request be reviewed?

  • By commit
  • All changes at once

How Has This Been Tested?

Please describe how tests have been updated to verify your changes.

Future Work

#287 fix is not robust.

Checklist

  • I have performed a self-review of my code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation and release notes
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works

Copilot AI review requested due to automatic review settings July 1, 2025 18:56

This comment was marked as outdated.

@Mark2000 Mark2000 force-pushed the bugfix/event-issues branch from 35e471b to a1dccfc Compare July 1, 2025 20:46
@Mark2000 Mark2000 requested a review from Copilot July 1, 2025 20:46
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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/actionFunction in simulator and dynamics modules
  • Refactored satellite event handling to support callable extra_actions and improved image event callbacks
  • Rounded time_limit to match sim_rate and 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_N is already a NumPy array, avoid wrapping it in np.array on every tick to reduce allocations. Use the native arrays directly if possible.
                    )

@Mark2000 Mark2000 force-pushed the bugfix/event-issues branch from a1dccfc to 5e3b6b5 Compare July 1, 2025 20:49
Copy link
Copy Markdown
Contributor

@LorenzzoQM LorenzzoQM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice changes. The code looks much cleaner and easier to debug

@Mark2000 Mark2000 merged commit 869bd2e into develop Jul 1, 2025
5 checks passed
@Mark2000 Mark2000 deleted the bugfix/event-issues branch July 1, 2025 21:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

3 participants