Skip to content

wasm demo calling an error API #2960

@ShanningZhuang

Description

@ShanningZhuang

Intro

Hi!

I am a PhD student at Tsinghua University, I use MuJoCo for my research on Reinforcement Learning in Robotics Control.

My setup

M4 Macbook Pro
Environment settings as in https://github.com/google-deepmind/mujoco/blob/main/wasm/README.md

What's happening? What did you expect?

Running the demo with error
Initialization error: TypeError: mujoco.MjModel.loadFromXML is not a function at App.loadModel (app.ts:211:35) at main (app.ts:489:9)

Steps for reproduction

Preparing environment as in the https://github.com/google-deepmind/mujoco/blob/main/wasm/README.md
git clone https://github.com/emscripten-core/emsdk.git ./emsdk/emsdk install 4.0.10 ./emsdk/emsdk activate 4.0.10 source ./emsdk/emsdk_env.sh npm install --prefix ./wasm export PATH="$(pwd)/wasm/node_modules/.bin:$PATH" python3 -m venv .venv source .venv/bin/activate pip install -r python/build_requirements.txt npm run dev:demo --prefix ./wasm
And opening the port in broswer

Minimal model for reproduction

No response

Code required for reproduction

this.mjModel = mujoco.MjModel.loadFromXML('/working/model.xml');

I search the whole mujoco source code folder and I don't find any API in documentation as mujoco.MjModel.loadFromXML. I think it is deprecated, the right one should be mujoco.MjModel.mj_loadXML.
Or there are something I miss when preparing environment?

Confirmations

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions