youyou826 / humanoid-gym-loong

This project shows how to use your own urdf to run on humanoid-gym, taking loong as an example
7 stars 0 forks source link

XML running sim2sim error #1

Open wangxudong1998 opened 2 months ago

wangxudong1998 commented 2 months ago

After adjusting the generated XML file based on the video (https://www.bilibili.com/video/BV1KTvNeTEck/?spm_id_from=333.999.0.0), running the sim2sim file reported the following error:

Traceback (most recent call last):
  File "scripts/sim2sim.py", line 195, in <module>
    run_mujoco(policy, Sim2simCfg())
  File "scripts/sim2sim.py", line 117, in run_mujoco
    q, dq, quat, v, omega, gvec = get_obs(data)
  File "scripts/sim2sim.py", line 75, in get_obs
    quat = data.sensor('orientation').data[[1, 2, 3, 0]].astype(np.double)
KeyError: "Invalid name 'orientation'. Valid names: []"

After adding the sensor attribute, the error message is as follows:

Traceback (most recent call last):
  File "scripts/sim2sim.py", line 195, in <module>
    run_mujoco(policy, Sim2simCfg())
  File "scripts/sim2sim.py", line 98, in run_mujoco
    model = mujoco.MjModel.from_xml_path(cfg.sim_config.mujoco_model_path)
ValueError: Error: unrecognized name of sensorized object in sensor 'orientation' (id = 0)
Object name = orientation, id = 0, line = 0, column = -1

What is the reason for this? How can I solve it?

wangxudong1998 commented 2 months ago

I solved the above problem because the site was not written. However, when I ran sim2sim.py, my robot floated around in the mujoco simulator. What is the reason for this? How can I solve it?