Skip to content

bug: push_by_setting_velocity 对 RigidEntity 静默失效(set_vel/set_ang 不存在) #242

Description

@humble02

Pre-flight checklist

  • I searched existing issues (open and closed) and found no duplicate.
  • I checked the README Troubleshooting section — this is not one of the documented pitfalls.
  • The bug does not reproduce in a pure Genesis script without GeneLab. (GeneLab 侧调用了不存在的 API,属于 GeneLab 自身问题。)

What happened

push_by_setting_velocity 事件不起作用:对机器人 articulation(Genesis RigidEntity)推力/速度扰动完全没有生效,训练时配置了 push 事件但基座速度从未被改写,且没有任何报错或警告——静默失效。

原因:该函数通过 getattr(handle, "set_vel", None) / getattr(handle, "set_ang", None) 取方法,取不到就直接跳过。而 Genesis 的 RigidEntity没有 set_velset_ang(这两个方法只存在于 fem_entitytool_entity 上),所以对刚体 articulation 两个分支都拿到 None,函数变成 no-op。

Steps to reproduce

# genesis 1.2.0
from genesis.engine.entities import RigidEntity

print(hasattr(RigidEntity, "set_vel"))          # False
print(hasattr(RigidEntity, "set_ang"))          # False
print(hasattr(RigidEntity, "set_dofs_velocity")) # True

任何配置了 push_by_setting_velocity 事件的任务(例如 examples/unitree 下 G1 / Go1 的 env_cfg.py)均可复现:事件按 interval 触发,但基座线速度/角速度不变。

代码位置:src/genelab/mdp/events.py#L151-L184

Environment

genelab 0.4.0
genesis 1.2.0
(报告者原始环境未提供;上述版本为维护者复核环境)

RL backend

Not applicable

Simulation backend

Not applicable / unknown

Logs / traceback

(无输出——问题恰恰是静默失效,没有任何报错或警告)

Anything else

正确做法:浮动基座速度应通过 RigidEntity.set_dofs_velocity 写入 free joint 的前 6 个基座 DoF(0–2 线速度,3–5 角速度),而不是不存在的 set_vel / set_ang

维护者按 bug 模板重排了本 issue(2026-07-10);原始内容见编辑历史。感谢 @humble02 的报告与根因分析。

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions