Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[core] Faster ground profile querying. #824

Merged
merged 2 commits into from
Jul 13, 2024
Merged

[core] Faster ground profile querying. #824

merged 2 commits into from
Jul 13, 2024

Conversation

duburcqa
Copy link
Owner

@duburcqa duburcqa commented Jul 13, 2024

  • [core] Replace MurmurHash3 by xxHash32 which is faster.
  • [core] Make gradient computation optional for heightmap functions.

Fixes #666

The snippet mentioned here #799 (comment) is now taking 6us instead of 13us on my machine (3us if all points are co-located, 11us is they are extremely far away from each other). I don't think it is possible to do any better at this point without significant refactoring, but I think it is good enough now.

In particular, this meaningful snippet runs in 17us on my machine:

import numpy as np
from jiminy_py.core import random_perlin_ground, query_heightmap

x_dim, y_dim = 20, 20
x_grid, y_grid = (np.linspace(-1.0, 1.0, i) for i in (x_dim, y_dim))
vertices = np.stack((
    np.tile(x_grid, y_dim),
    np.repeat(y_grid, x_dim),
    np.empty((x_dim * y_dim,))
), axis=0)

ground_fun = random_perlin_ground(wavelength=1.0, num_octaves=8, seed=42)
%timeit query_heightmap(ground_fun, vertices[:2], vertices[2])

@duburcqa duburcqa disabled auto-merge July 13, 2024 18:01
@duburcqa duburcqa merged commit 3306e66 into dev Jul 13, 2024
23 of 29 checks passed
@duburcqa duburcqa mentioned this pull request Jul 17, 2024
duburcqa added a commit that referenced this pull request Jul 17, 2024
* [core] Fix robot serialization issue. (#821)
* [core] Minor improvement periodic Perlin process and periodic stair ground. (#799) 
* [core] 'PeriodicGaussianProcess' and 'PeriodicFourierProcess' are now differentiable. (#799) 
* [core] Fix negative time support for all existing random processes. (#799) 
* [core] Add N-dimension Perlin processes. (#799) (#823) 
* [core] Add gradient computation for all Perlin processes. (#799) (#823) (#825)
* [core] Make all Perlin processes faster and copy-able. (#799) 
* [core] Add Perlin ground generators. (#799) 
* [core] Replace MurmurHash3 by xxHash32 which is faster. (#824) 
* [core] Make gradient computation optional for heightmap functions. (#824) 
* [jiminy_py] Fix 'tree.unflatten_as' mixing up key order for 'gym.spaces.Dict'. (#819)
* [python/simulator] Consistent keyword arguments between 'Simulator.build' and 'Simulator.add_robot'. (#821)
* [python/viewer] Fix MacOS support. (#822)
* [python/viewer] Add support of user-specified extra cameras (rgb and depth). (#826)
* [python/viewer] Significantly speed-up both offscreen and onscreen rendering for Panda3D. (#826)
* [gym/common] More generic stacking quantity. (#812) 
* [gym/common] Add termination condition abstraction. (#812) 
* [gym/common] Add quantity shift and drift tracking termination conditions. (#812) 
* [gym/common] Add support of termination composition in pipeline environments. (#812) 
* [gym/common] Add base roll/pitch termination condition. (#813) 
* [gym/common] Add base relative height termination condition. (#813) 
* [gym/common] Add foot collision termination condition. (#813) 
* [gym/common] More generic actuated joint kinematic quantity. (#814) 
* [gym/common] Add multi-ary operator quantity. (#814) 
* [gym/common] Add safety limits termination condition. (#814) 
* [gym/common] Add robot flying termination condition. (#815)
* [gym/common] Add power consumption termination condition. (#816) 
* [gym/common] Add ground impact force termination condition. (#816) 
* [gym/common] Add base odometry pose drift tracking  termination condition. (#817) 
* [gym/common] Add  motor positions shift tracking termination condition. (#817) 
* [gym/common] Add relative foot odometry pose shift tracking termination conditions. (#820)
* [gym/common] Add unit test checking that observation wrappers preserve key ordering. (#820)
* [gym/common] Fix quantity hash collision issue in quantity manager. (#821)
* [gym/common] Refactor quantity management to dramatically improve its performance. (#821)
* [gym/common] Add 'order' option to 'AdditiveReward'. (#821)
* [misc] Fix missing compositions documentation. (#812) 

---------

Co-authored-by: Mathias Wulfman <101942083+mwulfman@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[core] Replace hashing method used by random signal generators
1 participant