Skip to content

Settable collision check rate#324

Merged
Mark2000 merged 2 commits intodevelopfrom
feature/collision-check-rate
Dec 3, 2025
Merged

Settable collision check rate#324
Mark2000 merged 2 commits intodevelopfrom
feature/collision-check-rate

Conversation

@Mark2000
Copy link
Copy Markdown
Contributor

@Mark2000 Mark2000 commented Nov 5, 2025

Description

Allows for collisions to be checked for at a different rate than the sim. Helpful if you know motion is slow relative to the sim rate.

Also uses the new basilisk stop condition for better behavior.

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

Future Work

Do other things need configurable rates?

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 November 5, 2025 16:17
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 introduces configurable collision checking rates and updates stop condition behavior in Basilisk simulations. The key improvement allows collision detection to run at a different frequency than the main simulation rate, which is beneficial when spacecraft motion is slow relative to the simulation timestep.

Key changes:

  • Added conjunction_check_rate parameter to setup_conjunctions() with optional configuration
  • Updated ConfigureStopTime calls to use StopCondition=">=" for more reliable stop behavior
  • Set exactRateMatch=False for conjunction events to allow flexible timing

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
src/bsk_rl/sim/dyn/relative_motion.py Added configurable conjunction check rate with optional parameter defaulting to sim rate
src/bsk_rl/sim/simulator.py Updated stop time configuration to use ">=" stop condition
tests/unittest/sim/test_simulator.py Updated test assertion to verify new stop condition parameter

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Mark2000 Mark2000 force-pushed the feature/collision-check-rate branch from d1b8626 to 70f29d2 Compare November 5, 2025 16:21
Copy link
Copy Markdown
Contributor

@dhutererprats dhutererprats left a comment

Choose a reason for hiding this comment

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

Looks good to me.

One thing thought is that I dont see where you are using the exactRateMatch flag yet... or is this something you plan on further implementing later?

Copy link
Copy Markdown
Contributor

@dhutererprats dhutererprats left a comment

Choose a reason for hiding this comment

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

Helpful new feature!

@Mark2000 Mark2000 merged commit 6524a61 into develop Dec 3, 2025
14 checks passed
@Mark2000 Mark2000 deleted the feature/collision-check-rate branch December 3, 2025 22:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants