GithubHelp home page GithubHelp logo

mujoco_rgbd's People

Stargazers

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

Forkers

hidakay1

mujoco_rgbd's Issues

Range Finder Array quite slow

Hi,

I want to implement something similar to the TouchGrid Sensor Plugin, but instead of building a grid from contact points, I want to use distance measures.

Mujoco offers the function mj_ray to shoot and intersect a single ray (p + x*v, x>=0). However, using a lot of these individual ray casts significantly slows down the simulation speed.

There exists a function called mj_multiRay, but it only works if all rays have a common origin (and internally it does single ray casts).

Is there any more performant way to batch up ray casts and speed up the simulation?
Or any other way to measure short distances (0.1 m) to the environment at arbitrary sensing points?
In similar application using gazbeo the performance stays okay.

Here are some sim times:

Without any raycasts in my model I get:

Running 10000 steps at dt = 0.001 ...

 Simulation time      : 0.48 s
 Steps per second     : 20781
 Realtime factor      : 20.78 x
 Time per step        : 0.0481 ms

 Broadphase accuracy  : 17.69%
 Midphase accuracy    : 17.69%
 Contacts per step    : 3.53
 Constraints per step : 16.98
 Degrees of freedom   : 36

If I add 1000 mj_ray calls (distributed over the surface of the same model) I get down to:

Running 10000 steps at dt = 0.001 ...

 Simulation time      : 27.53 s
 Steps per second     : 363
 Realtime factor      : 0.36 x
 Time per step        : 2.7526 ms

 Broadphase accuracy  : 17.69%
 Midphase accuracy    : 17.69%
 Contacts per step    : 3.53
 Constraints per step : 16.98
 Degrees of freedom   : 36

The code in my plugin compute function looks something like this:

    int geomid = -1;
    for(size_t i = 0; i < patch_dyn.dist.size(); ++i)
    {
      // position world
      cell_pos_w[0] = patch_stat.positions(0, i);
      cell_pos_w[1] = patch_stat.positions(1, i);
      cell_pos_w[2] = patch_stat.positions(2, i);
      mju_rotVecMat(cell_pos_w, cell_pos_w, mat_w);
      mju_addTo3(cell_pos_w, pos_w);

      // orientation in world
      cell_n_w[0] = patch_stat.normals(0, i);
      cell_n_w[1] = patch_stat.normals(1, i);
      cell_n_w[2] = patch_stat.normals(2, i);
      mju_rotVecMat(cell_n_w, cell_n_w, mat_w);

      // raycast
      patch_dyn[i]  = mj_ray(m, d, cell_pos_w, cell_n_w, nullptr, 1, body_id_, &geomid);
   }

Thanks

Issues compiling example code on M2 Mac.

Hello,

I attempted to compile the example code on M2 MacBook Pro on MuJoCo 3.1.1, but I am running into this error:

*** Assertion failure in -[NSMenu _setMenuName:], NSMenu.m:772
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'NSWindow should only be instantiated on the main thread!'

Do you have any suggestions on how to proceed? I've looked around the web and issue seems to be MacOS specific. On which platforms has this code been ran on?

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.