Code Monkey home page Code Monkey logo

mujoco_wasm's People

Contributors

kevinzakka avatar stillonearth avatar zalo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

mujoco_wasm's Issues

Updating to mujoco 2.3.5

I am trying to update the libs and rebuild the project for mujoco 2.3.3 (which I checked out the relevant files from the upstream repo at https://github.com/stillonearth/MuJoCo-WASM/tree/main/lib). This is in order to use some of the latest assets from Menagerie. However, building main.genned.c fails due to the updated libraries. Outside of the files in lib/ and include/ what are the files/folders in this repo to update in order to get the new version of mujoco to build with this project? Happy to make a PR / branch for this too if there is a need!

Here are some of the build errors I am seeing currently:

[ 50%] Building CXX object src/CMakeFiles/mujoco_wasm.dir/main.genned.cc.o
~/mujoco_wasm/src/main.genned.cc:59:43: error: no member named 'nmeshtexvert' in 'mjModel_'; did you mean 'nmeshvert'?
   59 |   int  nmeshtexvert  () const { return m->nmeshtexvert  ; }
      |                                           ^~~~~~~~~~~~
      |                                           nmeshvert
~/mujoco_wasm/include/mujoco/mjmodel.h:561:7: note: 'nmeshvert' declared here
  561 |   int nmeshvert;                  // number of vertices in all meshes
      |       ^
~/mujoco_wasm/src/main.genned.cc:228:74: error: no member named 'nmeshtexvert' in 'mjModel_'; did you mean 'nmeshvert'?
  228 |   val  mesh_texcoord          () const { return val(typed_memory_view(m->nmeshtexvert    * 2        , m->mesh_texcoord          )); }
      |                                                                          ^~~~~~~~~~~~
      |                                                                          nmeshvert
~/mujoco_wasm/include/mujoco/mjmodel.h:561:7: note: 'nmeshvert' declared here
  561 |   int nmeshvert;                  // number of vertices in all meshes
      |       ^
~/mujoco_wasm/src/main.genned.cc:644:91: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
  644 |   void   _error              (std::string msg     ) { return mju_error                   (msg.c_str()         ); }
      |                                                                                           ^~~~~~~~~~~
~/mujoco_wasm/src/main.genned.cc:644:91: note: treat the string as an argument to avoid this
  644 |   void   _error              (std::string msg     ) { return mju_error                   (msg.c_str()         ); }
      |                                                                                           ^
      |                                                                                           "%s", 
~/mujoco_wasm/src/main.genned.cc:647:91: warning: format string is not a string literal (potentially insecure) [-Wformat-security]
  647 |   void   _warning            (std::string msg     ) { return mju_warning                 (msg.c_str()         ); }
      |                                                                                           ^~~~~~~~~~~
~/mujoco_wasm/src/main.genned.cc:647:91: note: treat the string as an argument to avoid this
  647 |   void   _warning            (std::string msg     ) { return mju_warning                 (msg.c_str()         ); }
      |                                                                                           ^
      |                                                                                           "%s", 
~/mujoco_wasm/src/main.genned.cc:1584:39: error: no member named 'inteval' in 'mjLROpt_'; did you mean 'interval'?
 1584 |       .field("inteval"    , &mjLROpt::inteval)    // evaluation time interval (at the end)
      |                              ~~~~~~~~~^~~~~~~
      |                                       interval
~/mujoco_wasm/include/mujoco/mjmodel.h:364:10: note: 'interval' declared here
  364 |   mjtNum interval;                // evaluation time interval (at the end)
      |          ^

Thank you!

Finally setting aside some spare time to play around with this, and I really appreciate the polish/effort/examples/etc. you put into this. Thank you!! 🙏

make error

mkdir build
cd build
emcmake cmake ..
make

when I do make , something is error

[ 50%] Building CXX object src/CMakeFiles/mujoco_wasm.dir/main.genned.cc.o
[100%] Linking CXX executable /Downloads/mujoco_wasm-main/dist/mujoco_wasm.js
error: undefined symbol: saveSetjmp (referenced by root reference (e.g. compiled C/C++ code))
warning: To disable errors for undefined symbols use `-sERROR_ON_UNDEFINED_SYMBOLS=0`
warning: _saveSetjmp may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
error: undefined symbol: testSetjmp (referenced by root reference (e.g. compiled C/C++ code))
warning: _testSetjmp may need to be added to EXPORTED_FUNCTIONS if it arrives from a system library
Error: Aborting compilation due to previous errors
em++: error: '/home/zy/Downloads/emsdk/node/18.20.3_64bit/bin/node /home/zy/Downloads/emsdk/upstream/emscripten/src/compiler.mjs /tmp/tmpfhv1mae3.json' failed (returned 1)
make[2]: *** [src/CMakeFiles/mujoco_wasm.dir/build.make:100:/home/zy/Downloads/mujoco_wasm-main/dist/mujoco_wasm.js] 错误 1
make[1]: *** [CMakeFiles/Makefile2:98:src/CMakeFiles/mujoco_wasm.dir/all] 错误 2
make: *** [Makefile:136:all] 错误 2

cmake version 3.28.3
ubuntu 22.04

npm publishing

Hi,

seems this is far behind than initial demo. I can transfer you rights for npm's mujoco_wasm if you want to publish this

Are body names interpreted correctly?

for example, looking at the live demo (https://zalo.github.io/mujoco_wasm/)

image

the body names are initialized based on the model.name_bodyadr array.
However, the names array has less entries than the largest index in name_bodyadr

image

also, the 0th body should logically be world, but here the 9th entry in names is "thigh_left", so it looks like the indexing is not as expected.

My guess is that the name_bodyadr indexing is a character count, as model.names is a long array of chars, later converted into a string and then split.

If I have time I could look into a PR and fix, if you agree with this assessment.

direct mujo'co control ?

Hi very cool libs
just for info
is possible to add or remove object on fly ?
or is only xml init scene .

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.