-
Notifications
You must be signed in to change notification settings - Fork 69
How to use a method from a custom class as the func in ObservationTermCfg #38
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
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() |
I have a similar question, I defined my own ObservationsCfg, ActionCfg, EventCfg, CommandsCfg, beacuse I didn't want to be covered if I used the configuration form robot_lab.tasks.locomotion.velocity.velocity_env_cfg, but when I trained, there is an error:Could not find git repository in /home/wu/miniconda3/envs/isaaclab/lib/python3.10/site-packages/rsl_rl/init.py. Skipping. |
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: