-
Notifications
You must be signed in to change notification settings - Fork 0
Randomizer no longer randomize on each frame if cosmos is enabled #1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Signed-off-by: Christian Barcelo <christian.barcelo@ekumenlabs.com>
3ddaf7d to
f67c8e7
Compare
IDavGal
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor comments, otherwise looks good. Love the template too
| 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) | ||
| ) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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| 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method loops over the animation sequentially?
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