Git Product home page Git Product logo

gepetto-viewer-corba's Introduction

CORBA server/client for the Graphical Interface of Pinocchio and HPP

Building Status Pipeline status Coverage report Code style: black pre-commit.ci status

Summary

gepetto-viewer-corba

Setup from robotpkg apt binary package repository

  1. Add robotpkg to your apt configuration: http://robotpkg.openrobots.org/debian.html
  2. sudo apt update && sudo apt install robotpkg-py27-qt4-gepetto-viewer-corba (or py35 on 16.04 / py36 on 18.04)

Setup from sources

To compile this package, it is recommended to create a separate build directory:

mkdir _build
cd _build
cmake [OPTIONS] ..
make install

Please note that CMake produces a CMakeCache.txt file which should be deleted to reconfigure a package from scratch.

Makefile

A Makefile that installs the dependencies is provided for convinience. Please follow those steps:

  • copy doc/Makefile,
  • open and set the variable SRC_DIR and INSTALL_DIR,
  • optionally, change OSG_PACKAGE and QT_VERSION,
  • run make all

Note that the environment variables PATH, LD_LIBRARY_PATH and PKG_CONFIG_PATH should include the path to the installation directory.

Dependencies

The present software depends on several packages which have to be available on your machine.

  • Libraries:
    • omniORB4 (version >= 4.1.4)
    • openscenegraph (version >= 3.2)
    • GepettoViewer (Graphical Interface of Pinocchio and HPP)
  • System tools:
    • CMake (>=2.6)
    • pkg-config
    • usual compilation tools (GCC/G++, make, etc.)

gepetto-gui

Usage

Basic usage

Launch the binary file gepetto-gui and do as in this video.

Adding predefined robots and environments

For convenience, robots and environments can be predefined.

Automatic
  • Robots:
# Use option --predefined-robots to change the robots setting file.
# OPTIONS="--predefined-robots other-robots"
OPTIONS=""

# PR2 from hpp_tutorial
gepetto-gui -g ${OPTIONS} --add-robot "PR2-hpp_tutorial,pr2,planar,pr2,hpp_tutorial,,_manipulation"
# HRP2
gepetto-gui -g ${OPTIONS} --add-robot "HRP2,hrp2,freeflyer,hrp2_14,hrp2_14_description,,"
# Romeo
gepetto-gui -g ${OPTIONS} --add-robot "Romeo,romeo,freeflyer,romeo,romeo_description,,H37V1"
  • Environments:
# Use option --predefined-environments to change the environments setting file.
# OPTIONS="--predefined-environments other-environments"
OPTIONS=""

# Kitchen
gepetto-gui -g ${OPTIONS} --add-env "Kitchen,kitchen,iai_maps,kitchen_area"
Manually

The configuration files are - from the installation prefix - in etc/gepetto-gui. Open ${CMAKE_INSTALL_PREFIX}/etc/gepetto-gui/robots.conf and write:

[PR2 - hpp_tutorial]
RobotName=pr2
ModelName=pr2
RootJointType=planar
Package=hpp_tutorial
URDFSuffix=
SRDFSuffix=_manipulation

[HRP2]
RobotName=hrp2_14
ModelName=hrp2_14
RootJointType=freeflyer
Package=hrp2_14_description
URDFSuffix=
SRDFSuffix=

Open ${CMAKE_INSTALL_PREFIX}/etc/gepetto-gui/environments.conf and write:

[Kitchen]
RobotName=Kitchen
Package=iai_maps
URDFFilename=kitchen_area

Note: Do not forget to replace ${CMAKE_INSTALL_PREFIX} by a relevant path.

Loading plugins

Automatic
# Use option --config-file to change the settings file.
# OPTIONS="--config-file other-settings"
OPTIONS=""

# Using the core framework: hppcorbaserver
gepetto-gui -g ${OPTIONS} \
  --load-plugin hppwidgetsplugin.so \
  --load-plugin hppcorbaserverplugin.so \
  --load-plugin remoteimuplugin.so

# Using the manipulation framework: hpp-manipulation-server
gepetto-gui -g ${OPTIONS} \
  --load-plugin hppmanipulationwidgetsplugin.so \
  --load-plugin hppmanipulationplugin.so \
  --load-plugin hppmonitoringplugin.so \
  --load-plugin remoteimuplugin.so
Manually

Open ${CMAKE_INSTALL_PREFIX}/etc/gepetto-gui/settings.conf and write:

[plugins]
hppcorbaserverplugin.so=true
remoteimuplugin.so=true
hppwidgetsplugin.so=true

The plugins are looked for in the directory ${CMAKE_INSTALL_PREFIX}/lib/gepetto-gui-plugins

For HPP developpers

As HPP, the GUI can be controlled using a python interface. When the GUI starts, it launches a server for both HPP and the Gepetto Viewer exactly as if you were manually launching the two commands hppcorbaserver and gepetto-viewer-server. This means that you can run the same python scripts and it will work !

When you do so, pay attention to the following points:

  • the GUI has no way of knowing when to refresh the list of joints and bodies. There is a refresh button in the Tools menu.
  • you can run the hppcorbaserver (or any server embedding it, like hpp-manipulation-server) externally. Use Tools > Reset connection when the CORBA client has to reconnect to a new server. In this case, set hppcorbaserverplugin.so and hppmanipulationplugin.so to false in your settings file because they are launching the servers themselves.
  • moving the robot in the GUI while the server is processing data can lead to unexpected results, because you are modifying the current configuration of HPP when not expected.

Installation procedure

There are a few dependencies to be installed before installing gepetto-gui.

Dependencies

There are a few required dependencies and several optional ones.

Core interface

There are only one dependency:

  • Qt 4: sudo apt-get install qt4-dev-tools libqt4-opengl-dev libqtgui4.

Optionally, for a better rendering:

  • oxygen-icon-theme: sudo apt-get install oxygen-icon-theme

Plugins

It is possible to extend the abilities of gepetto-gui with plugins.

See hpp-gui and hpp-plot for examples.

Installation of gepetto-gui

To install gepetto-gui you just have to follow the installation step at the top of this page.

PythonQt

gepetto-gui offers the possibility to develop plugins in python. To do so, you must install PythonQt by following the instructions here: https://github.com/jmirabel/PythonQt#readme

Python 3

This section describes the procedure to get bindings for Python 3. The support for Python 3 is from OmniORB 4.2.2. In Ubuntu 16.04, the version is 4.2.1, and in Ubuntu 18.04 it is 4.2.2, but Ubuntu main repos do not provide python 3 support. Thus, to make it work you must manually compile OmniORB 4.2.2. Download latest versions of OmniORB and OmniORBpy from sourceforge. Then compile OmniORB making sure it finds python3:

export PYTHON=/usr/bin/python3
cd omniORB-4.2.2/
mkdir build
cd build
../configure --prefix=${CMAKE_INSTALL_PREFIX}
make
make install

Compile OmniORBpy making sure it finds python3:

cd omniORBpy-4.2.2/
mkdir build
cd build
../configure --prefix=${CMAKE_INSTALL_PREFIX}
make
make install

Finally you can compile and install gepetto-viewer-corba making sure it finds OmniORB 4.2.2.

Troubleshooting

## Display of large meshes is very slow

A solution to help reducing the rendering time is to use Level Of Details (LOD). In short, you can use the following command to generate a LOD for mesh named mesh.ext.

gvtools --input mesh.ext --simplify 1,0,1 --simplify 0.5,1,3 --simplify 0.2,3,100 --output mesh.ext.osgb

This will create a LOD with three levels:

  • from 0 to 1 meters, use original mesh,
  • from 1 to 3 meters, use simplified mesh with ratio 0.5 (half less vertices),
  • from 3 to 100 meters, use simplified mesh with ratio 0.2,
  • farther than 100 meters, don't show anything.

gvtools is part of gepetto-viewer package. See gvtools --help for more details.

CORBA::TRANSIENT when launching a server

It very often happens that the OmniNames server failed to start properly at boot.

To check if the server is running, run:

ps -C omniNames -o pid,args

If the process is not running, delete omniNames related log and backup files in /var/lib/omniorb. They may have different names on your computer, but most likely, something like:

sudo rm /var/lib/omniORB/omninames-`hostname`.log
sudo rm /var/lib/omniORB/omninames-`hostname`.bak

then restart the server:

sudo service omniorb4-nameserver restart

Collada files are not displayed

The nodes are created and exists in the body tree widget but nothing appears in the scene viewer. This is due to a conflict between OSG and Qt. A work around is to convert the DAE to osg using the following command:

# <file> is the name of the file including the DAE extension.
# The output filename will end with .dae.osg.
osgconv <file> <file>.osg

If you have many files, you may run that at the root of the meshes subdirectories:

find ${root_of_meshes_directory} -iname "*.dae" -type f -exec osgconv {} {}.osg \;

gepetto-viewer-corba's People

Contributors

florent-lamiraux avatar jcarpent avatar jmirabel avatar ksyy avatar medericfourmy avatar ngiftsun avatar nim65s avatar nmansard avatar olivier-stasse avatar pfernbach avatar pre-commit-ci[bot] avatar proyan avatar wxmerkt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

gepetto-viewer-corba's Issues

[Ubuntu 18.04] Cannot import gepetto

Versions

robotpkg-py27-qt4-gepetto-viewer is already the newest version (4.5.0).
robotpkg-py27-qt4-gepetto-viewer-corba is already the newest version (5.2.1).

Behavior

In [1]: import gepetto
---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-1-b6e9c433b0e8> in <module>()
----> 1 import gepetto

/opt/openrobots/lib/python2.7/site-packages/gepetto/__init__.py in <module>()
     16 # <http://www.gnu.org/licenses/>.
     17 
---> 18 from .color import Color
     19 from .quaternion import Quaternion
     20 from .corbaserver import Error

/opt/openrobots/lib/python2.7/site-packages/gepetto/color.py in <module>()
     18 # <http://www.gnu.org/licenses/>.
     19 
---> 20 from .corbaserver import Color

/opt/openrobots/lib/python2.7/site-packages/gepetto/corbaserver/__init__.py in <module>()
----> 1 from .gepetto.corbaserver import GraphicalInterface
      2 from .gepetto__POA.corbaserver import NodeCallback as POA_NodeCallback
      3 from .gepetto import Error
      4 
      5 from .client import Client

/opt/openrobots/lib/python2.7/site-packages/gepetto/corbaserver/gepetto/__init__.py in <module>()
      7 
      8 # ** 1. Stub files contributing to this module
----> 9 import gepetto.corbaserver.graphical_interface_idl
     10 
     11 # ** 2. Sub-modules

/opt/openrobots/lib/python2.7/site-packages/gepetto/corbaserver/graphical_interface_idl.py in <module>()
    770 _0_gepetto.corbaserver._objref_GraphicalInterface.registerNodeCallback.im_func.__doc__ = _0_gepetto.corbaserver.GraphicalInterface.registerNodeCallback__doc__
    771 _0_gepetto.corbaserver.GraphicalInterface.__doc__ = _0_gepetto.corbaserver.GraphicalInterface__doc__
--> 772 _0_gepetto.corbaserver._objref_GraphicalInterface.__doc__ = _0_gepetto.corbaserver.GraphicalInterface__doc__
    773 _0_gepetto.__doc__ = _0__GlobalIDL.gepetto__doc__
    774 

AttributeError: attribute '__doc__' of 'type' objects is not writable

Cannot choose robot from file in gepetto-gui

I can run the gepetto-gui when I load robot using robot = load('tiago', display=True) from another terminal.

But when I ran gepetto-gui, even the gui can be launched , however I cannot choose robot from file as this video do, which is no robot I can choose.
I already set the export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:/opt/openrobots/share

Have I missed something?

omniorb-nameserver needed as dependency

I tried to install gepetto-viewer on a clean system. The installation went well, but launching the gepetto-viewer-server gave me Corba::Transient errors. Installing omniorb-nameserver fixed this issue.
This should be added in the dependencies as well.

Compatibility with Qt4 broken

It appears that the inclusion of <QtGui/qopengl.h> in 3dc7f16 breaks the compatibility with Qt4, because it only exists in Qt5 and therefore, the project cannot compile.

I suppose this is not wanted…

Quaternion convention

Internally, the viewer is using the OSG convention (X,Y,Z,W) to represent quaternions. However, the python API convention is inverted to (W,X,Y,Z).

As most (if not all) software in the team switch to Pinocchio, most of them will also use the (X,Y,Z,W) convention, used by Eigen. I think it is simpler to use the same convention everywhere and propose to switch to (X,Y,Z,W) in the python bindings as well.

Anyone against such a change ?

[Python 3] AttributeError: 'function' object has no attribute 'im_func'

Hi,

While trying to test #123 on 16.04 / python 3, with an omniORB 4.2.2 build for python 3, I got the following error:

  File "robots.py", line 23, in main
    robot.initDisplay()
  File "…/lib/python3.5/site-packages/pinocchio/robot_wrapper.py", line 281, in initDisplay
    import gepetto.corbaserver
  File "…/lib/python3.5/site-packages/gepetto/__init__.py", line 18, in <module>
    from .color import Color
  File "…/lib/python3.5/site-packages/gepetto/color.py", line 20, in <module>
    from .corbaserver import Color
  File "…/lib/python3.5/site-packages/gepetto/corbaserver/__init__.py", line 1, in <module>
    from .gepetto.corbaserver import GraphicalInterface
  File "…/lib/python3.5/site-packages/gepetto/corbaserver/gepetto/__init__.py", line 9, in <module>
    import gepetto.corbaserver.graphical_interface_idl
  File "…/lib/python3.5/site-packages/gepetto/corbaserver/graphical_interface_idl.py", line 700, in <module>
    _0_gepetto.corbaserver._objref_GraphicalInterface.createWindow.im_func.__doc__ = _0_gepetto.corbaserver.GraphicalInterface.createWindow__doc__
AttributeError: 'function' object has no attribute 'im_func'

This can be fixed with sed -i 's/im_func.__doc__/__doc__/' graphical_interface_idl.py

Making videos with a script

In the good old days there was only one way to make a video with gepetto-viewer, which was to use to method startCapture, which would start saving screenshots on your disk, and then you could use ffmpg to generate a video from those images.

Now I see several new methods:

  • captureFrame
  • captureTransform
  • captureTransformOnRefresh

Can anybody help me figure out the best way to make videos?
Beware I need to do it by scripting, I cannot use the handy new button on the GUI.

Gepetto-viewer-corba not compiling anymore

I'm not sure if this is related to #115 or not, but here it is:
I'm on the current devel (65b8fb8). It is not compiling anymore.
I get the following error:

CMakeFiles/gepetto-gui.dir/gui/node-action.cc.o: In function gepetto::gui::NodeAction::act(bool)':
node-action.cc:(.text+0x9bb): undefined reference to graphics::WindowManager::attachCameraToNode(std::shared_ptr<graphics::Node>)'
windows-manager.cc:(.text+0x2094): undefined reference to `graphics::WindowsManager::addNode(std::__cxx11::basic_string<char, std::char_traits, std::allocator > const&, std::shared_ptrgraphics::Node, std::shared_ptrgraphics::GroupNode)'

Please let me know what info you need about versions etc in order to debug/help me solve it.

Segmentation fault on Ubuntu 18.04

Compiled in Release from source on Ubuntu 18.04, with libopenscenegraph-dev, omniidl, omniidl-python from binaries. When starting gepetto-gui it immediately segfaults:

$ gepetto-gui
libpng warning: iCCP: known incorrect sRGB profile
terminate called after throwing an instance of 'CORBA::TRANSIENT'
[1]    21653 abort (core dumped)  gepetto-gui

The gdb backtrace in Debug mode is not more helpful:

(gdb) bt
#0  0x00007ffff399be97 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1  0x00007ffff399d801 in __GI_abort () at abort.c:79
#2  0x00007ffff43908b7 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff4396a06 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff4396a41 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff4396cc9 in __cxa_rethrow () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff685d770 in QMetaObject::activate(QObject*, QMetaObject const*, int, void**) ()
    at /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#7  0x00007ffff6738e25 in  () at /usr/lib/x86_64-linux-gnu/libQtCore.so.4
#8  0x00007ffff46946db in start_thread (arg=0x7fffd109f700) at pthread_create.c:463
#9  0x00007ffff3a7e88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95

Python 3

Hi everybody,

is there any plan to provide bindings for Python 3 in the near future?
I've seen they are already available for Pinocchio, but not yet for gepetto-viewer.

Deadlock with Qt5 on NFS

On NFS file system, with Qt 5.5, gepetto-gui might be frozen when generating a video, just after the user select a filename.
The bug is in Qt and was reported and fixed in later version of Qt: https://bugreports.qt.io/browse/QTBUG-43454

The symptom is the following error in the standard output:

setNativeLocks failed: Ressource temporairement non disponible

The solution:

rm ~/.config/QtProject.conf.lock

gepetto-viewer none-exposed window

Hi,

I am using the usual 'pinocchio.RobotWrapper.initViewer()' to display a robot in gepetto-viewer,
recently I get the following error

QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined
omniORB: (3) 2020-09-14 13:13:52.994600: From endpoint: giop:tcp:[::1]:57524. Detected GIOP 1.0 protocol error in input message. giopImpl10.cc:491. Connection is closed.
omniORB: (3) 2020-09-14 13:13:52.994819: To endpoint: giop:tcp:[::1]:57524. Send GIOP 1.0 MessageError because a protocol error has been detected. Connection is closed.
omniORB: (4) 2020-09-14 13:13:52.994892: Error: received an invalid zero length string.
QOpenGLContext::swapBuffers() called with non-exposed window, behavior is undefined

any idea what might be going wrong ?

Showing romeo in gepetto-gui

Hi,

Loading Romeo as in the Pinocchio's tutorial in gepetto-gui on my 16.04 successfully shows the body tree, but doesn't show anything on the 3D view.

In the same setup, it works on gepetto-viewer-server, and ur5 is correctly displayed in both gepetto-gui and gepetto-viewer-server.

Which differences between gepetto-gui & gepetto-viewer-server could lead to this behavior ?

Fail to update binaries on Ubuntu 18.04

Not sure if this is the right place, but we ran into this error message while updating gepetto-viewer binaries, there seems to be a mismatch of dependency versions:

sudo apt-get install robotpkg-gepetto-viewer-corba
Lecture des listes de paquets... Fait
Construction de l'arbre des dépendances       
Lecture des informations d'état... Fait
Certains paquets ne peuvent être installés. Ceci peut signifier
que vous avez demandé l'impossible, ou bien, si vous utilisez
la distribution unstable, que certains paquets n'ont pas encore
été créés ou ne sont pas sortis d'Incoming.
L'information suivante devrait vous aider à résoudre la situation : 

Les paquets suivants contiennent des dépendances non satisfaites :
 robotpkg-gepetto-viewer-corba : Dépend: robotpkg-gepetto-viewer (= 4.2.0) mais 4.3.0 devra être installé

ping @nim65s

Btw, is there a place where we can check the versions of packages provided with the openrobots PPA for different platforms?

terminate called after throwing an instance of 'CORBA::NO_RESOURCES'

Using robotpkg I installed gepetto-viewer and gepetto-viewer-corba on a "fresh" virtual machine running ubuntu 14.04. Now when I run gepetto-viewer-server I get this error:

terminate called after throwing an instance of 'CORBA::NO_RESOURCES'

Any idea what the problem might be? At first I thought I didn't have given to the virtual box enough memory, but now it has 4 GB and the error is still there.

Qt5

It would be great to plan to support both Qt4 & Qt5

Gepetto_gui gives segmentation fault

Hi, I tried to run gepetto_gui and load PR2-hpp_tutorial. The links name (base_footprint, base_laser_link, etc.) are printed in the command line, and then the gui just close down with the sentence "Segmentation fault (core dumped)" printed in the command line. Does anyone have any idea why and how to solve this? Thank you!
( I am following the installation instruction of HPP in https://humanoid-path-planner.github.io, and it seems that the tutorial has not been updated, it tells me to run gepetto-viewer-server which has been deleted. I guess that if I change gepetto-viewer-server to gepetto-gui, everything will still run as normal? )

Gepetto-gui as a main graphical interface

After discussing with @jmirabel , it would be great to have gepetto-gui as a main interface for all the Gepetto's projects.
And to have the gepetto-viewer only as a plugin, gepetto-plot too (to plot graphics trough QCustomPlot), gepetto-graph (trough QGV) and so on.

The middleware would remain CORBA.

What do you think?

issue when using gui.setColor() in python

Hi,

I'm trying to change the colors of visual objects using gui.setColor(nodeName, [r,g,b,a])
this used to work fine until recent update, now it seems to work only if I add a mesh with an stl extension

  • if I add a mesh with .dae or use something like gui.addCone(,,, [r,g,b,a]) then what ever rgb scale I use it shows in black
  • if I check the body tree in the gepetto-gui and I click on the color of an object within the tree then it displays the values I used (you can see in the figure below some shade of orange) however it displays it in black
    Screenshot from 2020-09-27 20-39-22

is there anything I might be doing wrong ?

Remove gepetto-viewer-server

As the bug related to DAE should be fixed now, I propose to remove gepetto-viewer-server. It should simplify a few things in the code.

Gepetto viewer often crashes after system update

Hi guys,

I have updated today both gepetto-viewer-corba and gepetto-viewer. This is the information of my system:

  • installation: robotpkg
  • OS: Ubuntu 18.04
  • Python 2
  • robotpkg-py27-qt4-gepetto-viewer-corba:amd64 5.4.0
  • robotpkg-py27-qt4-gepetto-viewer:amd64 4.9.0

And this is the message error that appears sometimes when I run my Python script:

    self.robot.viewer.gui.setVector3Property(forceName, "Scale", [1. * forceMagnitud, 1., 1.])
  File "/opt/openrobots/lib/python2.7/site-packages/gepetto/corbaserver/graphical_interface_idl.py", line 549, in setVector3Property
    return self._obj.invoke("setVector3Property", _0_gepetto.corbaserver.GraphicalInterface._d_setVector3Property, args)
omniORB.CORBA.COMM_FAILURE: CORBA.COMM_FAILURE(omniORB.COMM_FAILURE_WaitingForReply, CORBA.COMPLETED_MAYBE)

Unable to create a window with a given name

Hi,
I am using Gepetto-gui with the helper functions implemented in the Pinocchio::RobotWrapper python class. They are using pretty classical methods of the IDL API, so I directly put the Pinocchio code here. Tell me if you want be to be more agnostic.

I typically create the window in gepetto-gui using the "pinocchio" name.
robot.initDisplay(loadModel=True,windowName='pinocchio') # windowName uses here the default argument
However, since some time, gepetto-gui silently reject this request, or more specifically, creates the windows internally but does not display it. The windows is then in the node list, but nothing is displayed.

Yet it is working if I name the window differently.
robot.initDisplay(loadModel=True,windowName='crocoddyl')
In that case, the window is properly displayed.

It seems that there are some kind of default configuration file for gepetto-gui, that I involuntarily change. I tried to re-install gepetto corba, but this does not change anythink.

I am with the APT binary packages on qt4.

Any idea?

add[Objects] methods should not throw when warning is enough

Since version 1.1.0, methods adding 3D objects (addSphere, addCylinder, addCapsule, etc) throw an error when an object of the same name already exists. This is not an error, but a normal usage of GVC. Indeed, GVC server mostly remains open with the scene loaded, while the client connects several times and ask to load again the same scene.
Consequently, GVC should not throw in that case. It would be preferable to simply returns "False" when adding the new object fails because of anticipated reasons. Only throw when an unexpected error (like windowsID does not exist) arises.

[bug] Crash when rapidly creating and deleting a node

When a node is created and then immediately destroyed, the gui crashes on my system.
I add a minimal example below

from gepetto import corbaserver

viewer = corbaserver.Client()

window_id = viewer.gui.createWindow("pinocchio")
viewer.gui.createScene("world")
viewer.gui.addSceneToWindow("world", window_id)

viewer.gui.setLightingMode("world/ball", "ON")
viewer.gui.addSphere("world/ball",1.,[1.,1.,1.,1.])

viewer.gui.refresh()

print("All is fine here")

# uncomment these lines to make the example work
#import time
#time.sleep(1)

viewer.gui.deleteNode("world/ball", False)

print("Bye")

Installation Issue

I have run sudo apt install robotpkg-py36-qt4-gepetto-viewer-corba but I have seen following errors. How can I fix it?

Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help resolve the situation:

The following packages have unmet dependencies:
 robotpkg-py36-qt4-gepetto-viewer-corba : Depends: robotpkg-qt4-osgqt (= 3.5.7r1) but 3.5.7r3 is to be installed or
                                                   robotpkg-qt4-osgqt (= 3.5.7r2) but 3.5.7r3 is to be installed
                                          Depends: robotpkg-py36-qt4-gepetto-viewer+doc (= 4.9.0r3) but it is not going to be installed or
                                                   robotpkg-py36-qt4-gepetto-viewer (= 4.6.0) or
                                                   robotpkg-py36-qt4-gepetto-viewer (= 4.9.0r1) or
                                                   robotpkg-py36-qt4-gepetto-viewer (= 4.9.0r3) or
                                                   robotpkg-py36-qt4-gepetto-viewer+doc (= 4.7.0) but it is not going to be installed or
                                                   robotpkg-py36-qt4-gepetto-viewer (= 4.9.0r2) or
                                                   robotpkg-py36-qt4-gepetto-viewer+doc (= 4.9.0r1) but it is not going to be installed or
                                                   robotpkg-py36-qt4-gepetto-viewer+doc (= 4.9.0) but it is not going to be installed or
                                                   robotpkg-py36-qt4-gepetto-viewer+doc (= 4.9.0r2) but it is not going to be installed or
                                                   robotpkg-py36-qt4-gepetto-viewer (= 4.7.0) or
                                                   robotpkg-py36-qt4-gepetto-viewer (= 4.9.0) or
                                                   robotpkg-py36-qt4-gepetto-viewer+doc (= 4.8.0) but it is not going to be installed or
                                                   robotpkg-py36-qt4-gepetto-viewer (= 4.8.0) or
                                                   robotpkg-py36-qt4-gepetto-viewer+doc (= 4.10.1r2) but it is not going to be installed or
                                                   robotpkg-py36-qt4-gepetto-viewer+doc (= 4.10.1r1) but it is not going to be installed or
                                                   robotpkg-py36-qt4-gepetto-viewer (= 4.10.1r1) or
                                                   robotpkg-py36-qt4-gepetto-viewer (= 4.10.1r2)
E: Unable to correct problems, you have held broken packages.

Packages for Ubuntu 20.04

We are looking to migrate our codebase on Ubuntu 20.04 LTS, and it seems there are no compatible binary packages for gepetto-gui.

Are there any plans to provide packages for Ubuntu 20.04 and python 3.8?

Provide an option to bypass the Omniorb name service.

Here is a simple Python example of how to do this.

  • server.idl
module server {
  interface foo {
    string hello (  );
  };
};
  • run_server.py:
import CORBA, server, server__POA

class Server(server__POA.foo):
    def hello(self):
        return "hello"

orb = CORBA.ORB_init(['-ORBendPoint', 'giop:tcp:localhost:12321'], CORBA.ORB_ID)
poa = orb.resolve_initial_references("omniINSPOA")

servant = Server (  )
poa.activate_object_with_id("exampleServer", servant)
print orb.object_to_string(poa.servant_to_reference (servant))

poa._get_the_POAManager().activate(  )
orb.run(  )
  • run_client.py
import CORBA, server, sys
orb = CORBA.ORB_init(sys.argv , CORBA.ORB_ID)
o = orb.string_to_object("corbaloc::localhost:12321/exampleServer")
o = o._narrow(server.foo)
print o.hello(  )

Compile server.idl with omniidl -bpython server.idl, then run python run_server.py and python run_client.py

Problems compiling gepetto-viewer-corba on python3

Hi folks,

when I try to compile the source from master for python3, I get

$ cmake .. -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/opt/openrobots_py35
-- omniORB4 >= 4.1.4 is required.
-- Checking for module 'omniORB4 >= 4.1.4'
--   Found omniORB4 , version 4.2.3
-- Pkg-config module omniORB4 v4.2.3 has been detected with success.
-- PythonInterp: /usr/bin/python
-- PythonLibraries: /usr/lib/x86_64-linux-gnu/libpython2.7.so
-- PythonLibraryDirs: /usr/lib/x86_64-linux-gnu
-- PythonLibVersionString: 2.7.12
-- gepetto-viewer > 4.3.0 is required.
-- Checking for module 'gepetto-viewer > 4.3.0'
--   Found gepetto-viewer > 4.3.0, version 4.4.0
-- Pkg-config module gepetto-viewer v4.4.0 has been detected with success.
-- Looking for Qt 4.
-- Could NOT find PythonQt (missing:  PYTHONQT_LIBRARY PYTHONQT_INCLUDE_DIR QtAll) 
-- qgv is optional.
-- Checking for module 'qgv'
--   No package 'qgv' found
CMake Error at CMakeLists.txt:118 (INCLUDE):
  include called with wrong number of arguments.  include() only takes one
  file.


CMake Error at plugins/CMakeLists.txt:20 (INCLUDE):
  include called with wrong number of arguments.  include() only takes one
  file.


CMake Error at plugins/omniorbserver/CMakeLists.txt:25 (GEPETTO_GUI_PLUGIN):
  Unknown CMake command "GEPETTO_GUI_PLUGIN".


-- Configuring incomplete, errors occurred!
See also "/home/jviereck/dev/tools/gepetto-viewer-corba/build/CMakeFiles/CMakeOutput.log".
See also "/home/jviereck/dev/tools/gepetto-viewer-corba/build/CMakeFiles/CMakeError.log".

It looks like the variable GEPETTO_VIEWER_CMAKE_PLUGIN is not set, which leads to the empty include at CMakeLists.txt:118. Also, there is the missing GEPETTO_GUI_PLUGIN command.

Any idea how to fix this?

Best,
Julian

Access to setCameraTransform

I have a naive question. I tried to run the crocoddyl examples from binaries (py-27 on bionic) starting

gepetto-gui

in one window and starting

 python -m crocoddyl.examples.bipedal_walk "display" "plot"

on another window and got the following problem:

File "/opt/openrobots/lib/python2.7/site-packages/crocoddyl/examples/bipedal_walk.py", line 53, in <module>
    display = crocoddyl.GepettoDisplay(talos_legs, 4, 4, cameraTF, frameNames=[rightFoot, leftFoot])
  File "/opt/openrobots/lib/python2.7/site-packages/crocoddyl/__init__.py", line 60, in __init__
    self.robot.viewer.gui.setCameraTransform(0, cameraTF)
  File "/opt/openrobots/lib/python2.7/site-packages/gepetto/corbaserver/graphical_interface_idl.py", line 618, in setCameraTransform
    return self._obj.invoke("setCameraTransform", _0_gepetto.corbaserver.GraphicalInterface._d_setCameraTransform, args)

It sounds more like a gepetto-viewer problem. I checked omniNames (it is working). I checked the IDL and it is coherent with the call to line 60:

boolean setCameraTransform(in WindowID wid, in Transform configuration) raises (Error);

Any help would be appreciated.

addSceneToWindows reset the camera focus

When re-adding the scene to the windows (typically) when the GVC client restarts), the camera view is reset to the home position. This behavior comes from Gepetto-Viewer, windows-manager.cpp:294, calling viewer_ptr->home() while home cannot be changed through the corba API.

Reseting to home automatically is not a nice behavior. I would suggest that this is removed from gepetto-viewer. Alternatively, we should add something in GVC API to prevent this behavior, or to enable the modification of the viewer home position.

This issue is related to #54 and #34

Tutorial material

I believe it's important to have a tutorial (maybe Jupyter) explaining how to use gepetto-viewer, create objects, etc.

Severe performance loss when switching from gepetto-viewer to gepetto-gui

We have recently switched to installing the official gepetto-viewer binaries and using gepetto-gui along side pinocchio v2.0.0-alpha.

After switching from gepetto-viewer to gepetto-gui, we have noticed a severe performance loss when running the same script which relies on pinocchio.RobotWrapper.display(), by at least one order of magnitude in terms of script execution time.

The slowdown was noticed even when we are loading the robot meshes (via pinocchio.RobotWrapper.loadDisplayModel()), where instead of having a quasi-instantaneous display of the robot, we can see the meshes appear progressively and the whole loading time taking more than one second.

We can provide more information if you give us pointers as to what to look for.

Simple server set up

This is what it takes to create a new Gepetto-Viewer window from python

def GepettoViewerServer(windowName="python-pinocchio", sceneName="world", loadModel=False):
    """
    Init gepetto-viewer by loading the gui and creating a window.
    """
    import gepetto.corbaserver
    try:
        viewer = gepetto.corbaserver.Client()
        gui = viewer.gui

        # Create window
        window_l = gui.getWindowList()
        if windowName not in window_l:
            gui.windowID = gui.createWindow(windowName)
        else:
            gui.windowID = gui.getWindowID(windowName)

        # Create scene if needed
        scene_l = gui.getSceneList()
        if sceneName not in scene_l:
            gui.createScene(sceneName)
            gui.addSceneToWindow(sceneName, gui.windowID)

        gui.sceneName = sceneName

        return gui

    except Exception:
        print("Error while starting the viewer client. ")
        print("Check whether gepetto-gui is properly started")

I have to copy this function quite often in my codes.

Questions:

  • would you agree that this is the "minimal" way of creating a new viewer (or connecting again to it if it already exists)?
  • if so, could we put this method somewhere in the Python API of Gepetto-Viewer corba, to simplify the use of the software?

C++ Equivalent

Hi, is there a C++ equivalent?

In client side, what is the ior string

corbaloc:iiop:: ?

Corba connection problems and segfault

I am using the latest package version of Gepetto-gui on u1604. I recently observed that the server has inconsistent behaviour depending on the network configuration.

If not network is available, the server does not want to start:
OmniORB: Warning: the local loop back interface (127.0.0.1)
is the only address available for this server.
terminate called after throwing an instance of 'CORBA::TRANSIENT'
Aborted (core dumped)

When on wireless, the server starts, but the first connection fails. After a long freeze of both server and client, the server crashes:
terminate called after throwing an instance of 'CORBA::TRANSIENT'
The client eventually manages to stay alive and finally comes back to a stable situation, of course without display capabilities.

Any clue?

Graphical interface

I have developed a GUI based on gepetto-viewer. Wouldn't it be interesting to put the GUI in this package ?

The interface provides an access to most functionalities through buttons, which is probably better for users that do not want to dig into the documentation.
The GUI can be extended with plugins (some are already developed for HPP).

The code is in https://github.com/jmirabel/hpp-gui

STL rendering

Hi,
I have a rendering problem using talos_data, it is really dark, without colors.
I am on Ubuntu 14.04
We tried this command :
$ find /opt/openrobots/share/talos_data/meshes -iname "*.stl" -exec bash -c 'meshlabserver -i ${0} -o /tmp/foo.dae; osgconv -O daeZUpAxis /tmp/foo.dae /tmp/foo.dae.osgb; sudo mv /tmp/foo.dae.osgb ${0}.osgb' {} \;
Colors are better but it seems orientation of each part has changed, even with -O daeZUpAxis option
Thank you

Unable to run gepetto-gui on Fedora

I'm trying to run gepetto-gui on Fedora 29, so far without luck. I installed the dependencies from the official Fedora repo - thus I run omniORB-4.2.2-9.fc29.x86_64 and openscenegraph 3.4.1 .

I got the latest master of gepetto-viewer and gepetto-viewer-corba to compile and install fine. I have no problem running the corba server and getting gepetto-gui to open a window ; however whenever I try to add a URDF, the code crashes with a terminate called after throwing an instance of 'gepetto::Error' This happens when I try to interface with the viewer using python, but also when I run the display-urdf example provided by gepetto-viewer-corba.

I know that the URDF and mesh I use are valid - I've already used them with gepetto-gui on another machine running Ubuntu.

The error in itself is not very helpful - I tried running it with debugger, but the backtrace doesn't say much either, appart that an exception was throw by the generic userException function of graphical-interfaceSK:


Thread 1 "display-urdf" received signal SIGABRT, Aborted.
0x00007ffff674c53f in raise () from /lib64/libc.so.6
(gdb) backtrace 
#0  0x00007ffff674c53f in raise () from /lib64/libc.so.6
#1  0x00007ffff6736895 in abort () from /lib64/libc.so.6
#2  0x00007ffff6b0be9b in ?? () from /lib64/libstdc++.so.6
#3  0x00007ffff6b122fc in ?? () from /lib64/libstdc++.so.6
#4  0x00007ffff6b12357 in std::terminate() () from /lib64/libstdc++.so.6
#5  0x00007ffff6b125b8 in __cxa_throw () from /lib64/libstdc++.so.6
#6  0x00007ffff70466a2 in _0RL_cd_44e2eb9440f9d4f7_d3000000::userException (this=0x7fffffffd260, s=..., iop_client=0x444e30, repoId=0x43f700 "IDL:gepetto/Error:1.0")
    at /home/matthieu/dev/build/gepetto-viewer-corba/src/gepetto/viewer/corba/graphical-interfaceSK.cc:3990
#7  0x00007ffff6e9fefe in omniRemoteIdentity::dispatch(omniCallDescriptor&) () from /lib64/libomniORB4.so.2
#8  0x00007ffff6e84e5e in omniObjRef::_invoke(omniCallDescriptor&, bool) () from /lib64/libomniORB4.so.2
#9  0x00007ffff70468b1 in gepetto::corbaserver::_objref_GraphicalInterface::addURDF (this=0x444c70, robotName=0x4030bc "scene-urdf/urdf", 
    urdfFilePath=0x7fffffffd824 "/home/matthieu/Documents/urdfTest/katana_driver/katana.urdf", meshDataRootDir=0x7fffffffd860 "/home/matthieu/Documents/urdfTest/katana_driver/")
    at /home/matthieu/dev/build/gepetto-viewer-corba/src/gepetto/viewer/corba/graphical-interfaceSK.cc:4034
#10 0x0000000000402386 in main (argc=3, argv=0x7fffffffd468) at /home/matthieu/dev/src/gepetto-viewer-corba/examples/display-urdf.cc:28

Any idea what the problem might be?

Missing name for the floor in gepettoimport.py

Dear all,

I noticed a problem in gepettoimport.py when we create scene with a floor from gepetto viewer.
If we add this floor, then the script generating the blender model call "makeEmpty(objName)" without any
argument.
Then the "gepettoimport.py" called from blender crashes of course.

Best
Max

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.