Add keyboard control for MuJoCo humanoid robot with PD stabilization - #7652
Merged
donghaiwang merged 1 commit intoOct 1, 2026
Merged
Conversation
- main_keyboard_control.py: pygame keyboard control with PD controller - Use home keyframe qpos as target, keyboard input as offset - Pin root pose/velocity each step to keep robot stably standing - demo_keyboard.gif: screen recording showing keyboard control of all joints - README.md: add keyboard control section with operation table and PD principle
donghaiwang
approved these changes
Oct 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
修改概述:
修改内容
为
src/mujoco01模块添加基于 pygame 的键盘实时控制脚本,使用 PD 控制器保持人形机器人稳定姿态。新增文件
main_keyboard_control.py:pygame 键盘监听 + MuJoCo 被动视图 + PD 力矩控制demo_keyboard.gif:演示动图(键盘控制全身关节)修改文件
README.md:新增"键盘控制"章节,包含操作说明表、PD 控制原理公式、演示动图技术要点
tau = Kp * (target - q) - Kd * q_dot,其中target = home_qpos + keyboard_offsetKp = 40.0,Kd = 4.0运行环境
carla(Python 3.10.21)运行方式
运行效果
相关 PR