Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR addresses an RSim “teleport” issue where the first vision frame after reset_field could be stale, which in turn destabilizes downstream filtering. It also adds/adjusts tests and test setup code to better reflect the actual number of robots spawned in RSim.
Changes:
- Adjusts RSIM frame gating logic to advance the environment step counter during
wait_until_game_valid(). - Tweaks
PositionRefinerKalman initialization logic to avoid filtering against missing “last frame” data for newly seen robot IDs. - Adds a new strategy-runner test for “first frame reflects teleports” and simplifies several motion-planning test
reset_field()implementations.
Reviewed changes
Copilot reviewed 9 out of 9 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
utama_core/run/game_gater.py |
Attempts to ensure RSIM observations refresh across teleports by bumping steps. |
utama_core/data_processing/refiners/position.py |
Avoids Kalman filtering when a robot has no corresponding last-frame state. |
utama_core/tests/strategy_runner/teleport_position_accuracy_test.py |
New regression tests asserting first-frame positions match teleports. |
utama_core/tests/motion_planning/strategies/random_movement_strategy.py |
Makes expected-friendly-robot count check strict (==). |
utama_core/tests/motion_planning/single_robot_static_obstacle_test.py |
Simplifies reset to only teleport the robots that exist in the scenario. |
utama_core/tests/motion_planning/single_robot_moving_obstacle_test.py |
Simplifies reset to only teleport the robots that exist in the scenario. |
utama_core/tests/motion_planning/random_movement_test.py |
Makes randomized starts reproducible; simplifies reset and ball placement. |
utama_core/tests/motion_planning/multiple_robots_test.py |
Simplifies reset to only teleport robots used by the scenario. |
Comments suppressed due to low confidence (1)
utama_core/tests/strategy_runner/teleport_position_accuracy_test.py:106
- Leftover debug
print("hello!")statements add noise to test output and can make CI logs harder to read. Please remove these prints (the asserts already provide useful failure context).
print("hello!")
assert passed, "Test episode did not complete."
print("hello!")
assert test_manager.first_frame_position is not None, f"Robot {robot_id} was never seen in the first game frame."
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 10 out of 10 changed files in this pull request and generated no new comments.
Comments suppressed due to low confidence (1)
utama_core/run/game_gater.py:34
- The comment "Increment the step count to simulate time passing in the environment" is slightly misleading. The increment is primarily needed to invalidate the observation cache in StandardSSL._frame_to_observations, not to simulate time passing. Consider updating the comment to: "Increment the step count to invalidate the observation cache and get fresh data after teleporting".
rsim_env.steps += 1 # Increment the step count to simulate time passing in the environment
fred-huang122
previously approved these changes
Feb 26, 2026
fred-huang122
approved these changes
Feb 26, 2026
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.
fix rsim teleport bug that was causing the filters to go crazy. Essentialy teleporting the robots didn't step the simulator. For some reason, the
_frame_to_observationmethod in StandardSSL has a cache that relies onself.stepsincrementing. Hence, after teleporting, the frames we were pulling were stale because the steps didn't increment.very long and confusing bug, fixed by a single line of code basically.
Also default filtering to
Falsefor now.Also fixed grSim bug caused by mismatch between pre-bounds checked vision frames and post-bounds checked vision. This cause Kalman filters to build for robots that were out of bounds.