diff --git a/src/embodied_robot/README.md b/src/embodied_robot/README.md index 2d82baa853..2e58b1c5d1 100644 --- a/src/embodied_robot/README.md +++ b/src/embodied_robot/README.md @@ -4,6 +4,7 @@ # 核心库(必须安装) mujoco==3.3.6 numpy==2.2.6 + python==3.12 # 间接依赖(通常自动安装,若缺失则补充) absl-py==2.3.1 diff --git a/src/embodied_robot/main.py b/src/embodied_robot/main.py index 6a798d96e8..e69de29bb2 100644 --- a/src/embodied_robot/main.py +++ b/src/embodied_robot/main.py @@ -1,84 +0,0 @@ -import mujoco -import time -from mujoco import viewer - - -def main(): - # 定义简单的双轮机器人模型 - robot_xml = """ - - - """ - - # 加载模型 - model = mujoco.MjModel.from_xml_string(robot_xml) - data = mujoco.MjData(model) - - # 初始化可视化器 - viewer_instance = viewer.launch_passive(model, data) - - # 设置直行速度(左右轮相同速度) - forward_speed = 1.0 - data.ctrl[0] = forward_speed # 左轮速度 - data.ctrl[1] = forward_speed # 右轮速度 - - # 运行仿真10秒 - total_time = 10.0 - steps = int(total_time / model.opt.timestep) - - start_time = time.time() - for _ in range(steps): - # 执行仿真步 - mujoco.mj_step(model, data) - - # 更新可视化 - viewer_instance.sync() - - # 维持实时速率 - elapsed = time.time() - start_time - expected = _ * model.opt.timestep - if elapsed < expected: - time.sleep(expected - elapsed) - - print(f"仿真完成,机器人最终位置: {data.body('base').xpos}") - viewer_instance.close() - - -if __name__ == "__main__": - main() - - - diff --git a/src/embodied_robot/robot_walk/MUJOCO_LOG.TXT b/src/embodied_robot/robot_walk/MUJOCO_LOG.TXT new file mode 100644 index 0000000000..c3f60e46b9 --- /dev/null +++ b/src/embodied_robot/robot_walk/MUJOCO_LOG.TXT @@ -0,0 +1,27 @@ +Mon Dec 15 09:31:10 2025 +WARNING: Nan, Inf or huge value in QVEL at DOF 6. The simulation is unstable. Time = 0.8450. + +Mon Dec 15 09:31:11 2025 +WARNING: Nan, Inf or huge value in QACC at DOF 15. The simulation is unstable. Time = 0.2150. + +Mon Dec 15 09:31:24 2025 +WARNING: Nan, Inf or huge value in QVEL at DOF 6. The simulation is unstable. Time = 5.2000. + +Mon Dec 15 09:31:25 2025 +WARNING: Nan, Inf or huge value in QACC at DOF 6. The simulation is unstable. Time = 0.1700. + +Mon Dec 15 10:46:22 2025 +WARNING: Nan, Inf or huge value in QVEL at DOF 17. The simulation is unstable. Time = 0.5050. + +Mon Dec 15 10:46:23 2025 +WARNING: Nan, Inf or huge value in QPOS at DOF 6. The simulation is unstable. Time = 0.1400. + +Mon Dec 15 13:22:44 2025 +WARNING: Nan, Inf or huge value in QVEL at DOF 6. The simulation is unstable. Time = 0.7500. + +Mon Dec 15 13:23:19 2025 +WARNING: Nan, Inf or huge value in QACC at DOF 6. The simulation is unstable. Time = 0.9500. + +Mon Dec 15 13:23:23 2025 +WARNING: Nan, Inf or huge value in QVEL at DOF 6. The simulation is unstable. Time = 0.9750. + diff --git a/src/embodied_robot/robot_walk/Robot_move_straight.xml b/src/embodied_robot/robot_walk/Robot_move_straight.xml index aa65f0e3a4..5226423051 100644 --- a/src/embodied_robot/robot_walk/Robot_move_straight.xml +++ b/src/embodied_robot/robot_walk/Robot_move_straight.xml @@ -1,333 +1,279 @@ - - - -