Randomizer no longer randomize on each frame if cosmos is enabled#1
Open
BarceloChristian wants to merge 1 commit intomainfrom
Open
Randomizer no longer randomize on each frame if cosmos is enabled#1BarceloChristian wants to merge 1 commit intomainfrom
BarceloChristian wants to merge 1 commit intomainfrom
Conversation
Signed-off-by: Christian Barcelo <christian.barcelo@ekumenlabs.com>
3ddaf7d to
f67c8e7
Compare
IDavGal
approved these changes
Dec 18, 2025
Contributor
IDavGal
left a comment
There was a problem hiding this comment.
Minor comments, otherwise looks good. Love the template too
Comment on lines
+68
to
+75
| def randomize_lights() -> None: | ||
| """Randomize lights attributes.""" | ||
| with self.lights: | ||
| rep.modify.attribute("inputs:color", rep.distribution.uniform(self.min_color, self.max_color)) | ||
| rep.modify.attribute("inputs:enableColorTemperature", self.enable_color_temperature) | ||
| rep.modify.attribute( | ||
| "inputs:exposure", rep.distribution.uniform(self.min_exposure, self.max_exposure) | ||
| ) |
Contributor
There was a problem hiding this comment.
Is it a necessity that the registered functions need to receive no params? Otherwise, for consistency and to reduce nesting, I'd suggest define the randomization method we're registering as a class method and just register it when randomize_all_frames is set for all randomizers that use replication.
if randomize_all_frames:
rep.register(self.randomize_this)
with rep.trigger.on_frame():
randomize_this()
else:
# Single time randomization logic
Comment on lines
+82
to
+90
| def randomize(self) -> None: | ||
| """Apply randomization to the robot.""" | ||
| if self.randomize_all_frames: | ||
| return | ||
| fps = float(self.timeline_iface.get_time_codes_per_seconds()) | ||
| self.timeline_iface.set_current_time(self.current_frame / fps) | ||
| self.current_frame += 1 | ||
| if self.current_frame >= NUM_FRAMES: | ||
| self.current_frame = FIRST_MOVING_FRAME |
Contributor
There was a problem hiding this comment.
This method loops over the animation sequentially?
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.
Pull Request
📝 Description
Randomizers no longer randomize on each frame is Cosmos is enabled.
Robot animation moves frame by frame.
🎯 Type of Change
Please delete options that are not relevant.
📋 Checklist
Please check all applicable items:
Code Quality
pre-commit run --all-filesand all checks passDocumentation