-
Notifications
You must be signed in to change notification settings - Fork 26
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
Implement Domain Randomization #41
Comments
From the SDF side, we could make use of the new support of custom elements and attributes introduced in osrf/sdf_tutorials#32. |
For what concerns the model, probably the most straightforward way to randomize its dynamics is:
Considering the structure of the project, we can decide whether to use C++ or Python. C++ will be faster and we can use SDFormat and the resources provided by I tried to develop a first C++ prototype, but it turns out that SDFormat is not really suitable for this task. It provides a great flexibility for what concerns deserialization, but it has severe serialization limits. More specifically, all the helpers like At this point, I'm considering to switch to Python. The default xml module (and many other alternatives) support OOTB XPath, that provides a very compact way to access fields. The only drawback is that in Python we should convert URDF models to SDF beforehand, since the randomizer Python class will work on just one of the two formats (it will be SDF). This choice could lead to small model differences particularly when dealing with fixed joints, and users should be warned to be careful. I'm not really concerned about the speed of the process, most likely the rollout (and model insertion for big models) will be at least one or two order of magnitude longer than the deserialization / serialization process. cc @traversaro Resources: |
Tagging a few model-based control guys here, as domain randomization can also be really useful to test the robustness of model-based control algorithms to model uncertainties: @robotology/iit-dynamic-interaction-control . |
I do not know if we can find a n easy way (like randomize the densities) to link link geometry and inertial parameters |
From the point of view of URDF and SDF representation, inertia parameters and geometry are completely decoupled parameters. An alternative representation would be to use geometry + density, and randomize that, that would require some code to automatically compute the inertial parameters given the geometry and the density, see these related issues:
Note that for primitive shapes the amount of parameter to randomize over would probably remain similar (10 for inertial parameters vs 7/8 for primitive shapes) while for meshes the parameters that could be changed are much more (potentially every point in the mesh), unless you fix the shape and assume that you randomize over some kind of deformation (such as scaling, rotation, translation) that would limit the number of parameters. |
Thanks @traversaro for the insight. I think that the best we can achieve is exactly what you wrote:
Actually, already achieving a proper meshes scaling would be an excellent achievement. We have to remember that implementing this feature means that also the corresponding collision should be scaled accordingly, and not always the geometry is the same (e.g. when simplified collisions are used). Plus, there could be multiple visual and collision elements associated to a link. I propose to start with simple parameters randomization, and then discuss if also geometry is necessary. From my early tests with the trained policies stored in the xbpeng/DeepMimic repository, they were already quite robust to geometry changes without the need to randomize link geometry during training. |
Quick TODO list of quantities to randomize:
Physics Engine
Model
The text was updated successfully, but these errors were encountered: