v0.1.7; fix prob of not adjusting resample cmd based on the terrains

This commit is contained in:
wty-yy
2026-01-08 12:44:17 +08:00
parent 6f477bf42d
commit 47755ce06c
7 changed files with 41 additions and 14 deletions

View File

@@ -45,3 +45,11 @@ def sample_disjoint_intervals(env_ids, limit_bound, cfg_min, cfg_max, device):
cfg_max - width_pos + (u - width_neg)
)
return samples
def sample_single_interval(env_ids, cfg_min, cfg_max, device):
"""
sample uniform distribution from [cfg_min, cfg_max]
"""
r = torch.rand(len(env_ids), device=device)
samples = cfg_min + r * (cfg_max - cfg_min)
return samples