-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Adds single-shot events #3454
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?
Adds single-shot events #3454
Conversation
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.
lgtm
Would there be a case where someone says they want N-shot? 🤔 |
Maybe yes, personally I think it's unlikely. In this case, one could just put N single shot events in the config. Thinking about it, being able to specify initial delay and interval on the other hand, might be interesting and would be able to also mimic the single shot behavior (infinite interval time with finite inital delay). But I fear this would introduce unwanted breaking changes. |
I am wonder if feature like this is better to be written as custom function to combined with |
I think there are enough practical use cases to justify a dedicated flag. Requiring a custom functor would force the user to move away from the functional interface and implement a separate class with state, which adds unnecessary complexity for something that could be handled more directly. |
ok between combining |
To me the current implementation is more efficient coding wise whereas Thinking more about it, imo the cleanest solution would be to introduce EventResetTermCfg, EventIntervalTermCfg, EventSingleShotTermCfg, ... and move all "interval|reset only" arguments to these configs. But this would introduce quite some breaking changes. What's your opinion? I think removing the argument and having it in the mode as you said is cleaner. |
if this is the future way to go, then having one shot mode will prepare us to that goal and somewhat aligns with that separation, I'd say removing the argument and having it in the mode. But no rush at all : )) @Mayankm96 would also be great if you can give some input here as well |
Description
This PR introduces one-shot events.
A one-shot event is triggered at most once before the environment is reset. This makes it possible to modify the environment at a specific time, for example by lowering the friction after one second or by applying forces at different moments such as 1s, 2s, and 3s.
Example
The following example schedules different forces to be applied at one-second intervals without being repeated. Without the is_single_shot option, the pull_up event would instead be triggered repeatedly at 1s, 2s, and 3s.
Type of change
Checklist
pre-commit
checks with./isaaclab.sh --format
config/extension.toml
fileCONTRIBUTORS.md
or my name already exists there