robotology / gym-ignition

Framework for developing OpenAI Gym robotics environments simulated with Ignition Gazebo

Home Page:https://robotology.github.io/gym-ignition

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Enable self-collision for Panda

FirefoxMetzger opened this issue · comments

I don't know if this issue should live here or in the gym_ignition_models repo.

Currently, Panda doesn't seem to have self-collisions enabled. Collision with other objects works fine. See for example this video (at around 0:08 - 0:09):

my_video.mp4

Would it be possible to enable it by default, or provide an option to enable it?

Contacts and collisions are part of what I call the bottleneck features. When enabled, simulations could slow down considerably.

For this reason, contact detection and self collisions are disabled by default (contacts [1], collisions). You can enable self collisions model-wise with the following method:

/**
* Enable the detection of self-collisions.
*
* It will enable contact detection if it was disabled.
*
* @param enable True to enable the self-collision detection, false to
* disable.
* @return True for success, false otherwise.
*/
bool enableSelfCollisions(const bool enable = true);

[1] I actually realized that contacts are enabled by default. We should understand what is the impact to the real time factor, and if it makes sense to disable them by default.

In python this will need to be cast to_gazebo() first:

panda.to_gazebo().enable_self_collisions(True)

I should first read the docs more thoroughly before opening new issues 🥇 I totally forgot to check the Gazebo API and just looked at the core API. Closing...

No worries, we can consider issues as part of a project's documentation 😉 One nice thing with SWIG (much more difficult to get with pybind11) is that the C++ doxygen documentation is copied to the Python's docstring. I admit that, as you, I rarely rely on the online documentation. Nowadays autocompletion is much faster.