-
Notifications
You must be signed in to change notification settings - Fork 53
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
How to use a method from a custom class as the func in ObservationTermCfg #38
Comments
These are part of the code for my custom class```
|
and,I am using these functions like this:
|
Hi, you can write like this Add a new obs func in def phase(env: ManagerBasedRLEnv) -> torch.Tensor:
# Compute phase here
phase_tensor = xxx
return phase_tensor Then import and use it import robot_lab.tasks.locomotion.velocity.mdp as mdp
from robot_lab.tasks.locomotion.velocity.velocity_env_cfg import ObservationsCfg
@configclass
class XXXObservationsCfg(ObservationsCfg):
@configclass
class PolicyCfg(ObservationsCfg.PolicyCfg):
phase = ObsTerm(func=mdp.phase, scale=1.0)
def __post_init__(self):
super().__post_init__()
policy: PolicyCfg = PolicyCfg() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When I try to create a class to manage the observation functions by myself, I encounter an error.
The text was updated successfully, but these errors were encountered: