Skip to content

Commit

Permalink
[python/viewer] Remove support of 'gepetto-gui' backend.
Browse files Browse the repository at this point in the history
  • Loading branch information
Alexis Duburcq committed Feb 24, 2022
1 parent 7a3b27d commit c5aa835
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 360 deletions.
20 changes: 1 addition & 19 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,7 @@

#### Dependencies installation

There is not requirement to install `jiminy_py` on linux if one does not want to build it. Nevertheless, this package does not provide the backend viewer `gepetto-gui` (still, the backend `meshcat` is available).

##### (optional) Gepetto viewer

The first step to install `gepetto-gui` is to setup the APT repository `robotpkg` to have access to compiled binaries.

```bash
sh -c "echo 'deb [arch=amd64] http://robotpkg.openrobots.org/packages/debian/pub bionic robotpkg' >> /etc/apt/sources.list.d/robotpkg.list" && \
curl http://robotpkg.openrobots.org/packages/debian/robotpkg.key | sudo apt-key add -
apt update
```

Once done, it is straightforward to install the required package for Python 3.6.

For Python 3.6

```bash
sudo apt install -y robotpkg-gepetto-viewer=4.4.0 robotpkg-py36-qt4-gepetto-viewer-corba=5.1.2 robotpkg-py36-omniorbpy
```
There is no requirement to install `jiminy_py` on linux if one does not want to build it.

#### Install Jiminy Python package

Expand Down
3 changes: 1 addition & 2 deletions build_tools/easy_install_deps_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,7 @@ fi
# Note that `apt-get` is used instead of `apt` because it supports wildcard in package names
apt-get install -y --allow-downgrades --allow-unauthenticated \
robotpkg-octomap=1.9.0 robotpkg-urdfdom-headers=1.0.4 robotpkg-hpp-fcl=1.7.1 robotpkg-pinocchio=2.5.6 \
robotpkg-qt5-osgqt=3.5.7r2 robotpkg-py3*-qt5-gepetto-viewer=4.12.0r2 robotpkg-py3*-qt5-gepetto-viewer-corba=5.6.0 \
robotpkg-py3*-omniorbpy=4.2.4 robotpkg-py3*-eigenpy=2.6.2 robotpkg-py3*-hpp-fcl=1.7.1 robotpkg-py3*-pinocchio=2.5.6
robotpkg-py3*-eigenpy=2.6.2 robotpkg-py3*-hpp-fcl=1.7.1 robotpkg-py3*-pinocchio=2.5.6

# Add openrobots libraries to python packages search path
if ! [ -f "${PYTHON_SITELIB}/openrobots.pth" ]; then
Expand Down
6 changes: 3 additions & 3 deletions examples/python/tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,10 @@
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"The results of a simulation can also be visualized in a 3D viewer: either `gepetto-gui` or `meshcat`. We use the latter here as it can be integrated in jupyter."
],
"metadata": {}
"The results of a simulation can also be visualized in a 3D viewer: either `panda3d` or `meshcat`. We use the latter here as it can be integrated in jupyter."
]
},
{
"cell_type": "code",
Expand Down
7 changes: 1 addition & 6 deletions python/jiminy_py/src/jiminy_py/core/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@
_module = _importlib.import_module(".".join((__name__, module_name)))
_sys.modules[module_name] = _module

# Register pinocchio_pywrap to avoid importing bindings twise, which messes up
# Register pinocchio_pywrap to avoid importing bindings twice, which messes up
# with boost python converters. In addition, submodules search path needs to be
# fixed for releases older than 2.5.6.
submodules = _inspect.getmembers(
Expand All @@ -82,11 +82,6 @@
__all__.append(name)
attrib.__module__ = __name__

# Patch Pinocchio to avoid loading ground geometry in viewer, and force
# `np.ndarray` type for from/to Python matrix converters.
from . import _pinocchio_init # noqa


# Define helpers to build extension modules
def get_cmake_module_path():
return _os.path.join(_os.path.dirname(__file__), "cmake")
Expand Down
19 changes: 0 additions & 19 deletions python/jiminy_py/src/jiminy_py/core/_pinocchio_init.py

This file was deleted.

4 changes: 0 additions & 4 deletions python/jiminy_py/src/jiminy_py/simulator.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,10 +465,6 @@ def render(self,
"""Render the current state of the simulation. One can display it
or return an RGB array instead.
.. note::
Gepetto-gui supports parallel rendering, which means that one can
display multiple simulations at the same time in different tabs.
:param return_rgb_array: Whether or not to return the current frame as
an rgb array.
:param width: Width of the returned RGB frame, if enabled.
Expand Down
6 changes: 2 additions & 4 deletions python/jiminy_py/src/jiminy_py/viewer/meshcat/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@
console.info("not connected to MeshCat server: ", e);
}

// Replace the mesh grid by a filled checkerboard, similar to
// the one of Gepetto-gui. The paving size is 1m by 1m.
// Replace the mesh grid by tiles. The paving size is 1m by 1m.
var segments = 20;
var cmap = [new MeshCat.THREE.Color(0x222233), new MeshCat.THREE.Color(0xf2f2fe)];
var geometry = new MeshCat.THREE.PlaneBufferGeometry(
Expand All @@ -199,8 +198,7 @@

viewer.scene_tree.find(["Axes", "<object>"]).object.material.linewidth = 2.5

// Update the "zoom" of the camera to match the behavior of
// Gepetto-gui, and update the default position of the camera.
// Update the "zoom" of the camera and its default position
viewer.camera.fov = 30;
viewer.camera.position.set(8.0, 1.2, 0);
viewer.render();
Expand Down
12 changes: 6 additions & 6 deletions python/jiminy_py/src/jiminy_py/viewer/replay.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,8 @@ def play_trajectories(trajs_data: Union[
"""Replay one or several robot trajectories in a viewer.
The ratio between the replay and the simulation time is kept constant to
the desired ratio. One can choose between several backend (gepetto-gui or
meshcat).
the desired ratio. One can choose between several backend ('panda3d' or
'meshcat').
.. note::
Replay speed is independent of the platform (windows, linux...) and
Expand Down Expand Up @@ -172,9 +172,9 @@ def play_trajectories(trajs_data: Union[
input before starting to play the trajectories.
Only available if `record_video_path` is None.
Optional: False by default.
:param backend: Backend, one of 'panda3d', 'meshcat', or 'gepetto-gui'. If
`None`, the most appropriate backend will be selected
automatically, based on hardware and python environment.
:param backend: Backend, one of 'panda3d', 'meshcat'. If `None`, the most
appropriate backend will be selected automatically, based
on hardware and python environment.
Optional: `None` by default.
:param delete_robot_on_close: Whether or not to delete the robot from the
viewer when closing it.
Expand Down Expand Up @@ -690,7 +690,7 @@ def _play_logs_files_entrypoint() -> None:
"assuming the robot has a freeflyer."))
parser.add_argument(
'-b', '--backend', default='panda3d',
help="Display backend (panda3d, meshcat, or gepetto-gui).")
help="Display backend ('panda3d' or 'meshcat').")
parser.add_argument(
'-m', '--mesh_package_dir', default=None,
help="Fullpath location of mesh package directory.")
Expand Down
Loading

0 comments on commit c5aa835

Please sign in to comment.