Coder Social home page Coder Social logo

Comments (14)

jmirabel avatar jmirabel commented on September 4, 2024

It probably unrelated to the swapBuffers warning.

The Node ... does not exist makes me think the issue is in viewer.loadViewerModel. I guess the objects are created but not added to the scene.

Also, is there another visualizers that I can use to easily display the robot while programming in c++?

Not that I know of.

from gepetto-viewer.

florent-lamiraux avatar florent-lamiraux commented on September 4, 2024

Hello @MariaBana
Difficult to reproduce your issue. There are no include in your sample C++ code.
Can you embed your code in a minimal package with a CMakeLists.txt so that we can compile it ?
Did you install from binary packages or from source. If so which versions of pinocchio, gepetto-viewer and gepetto-viewer-corba do you use ?

Otherwise can you look in the Body Tree what are the objects present ?

from gepetto-viewer.

ZhengmaoHe avatar ZhengmaoHe commented on September 4, 2024

Hi @florent-lamiraux
Thanks to your generous help,

Can you embed your code in a minimal package with a CMakeLists.txt so that we can compile it ?

I have written a more concise code here(simply replacing the urdf path of https://github.com/stack-of-tasks/pinocchio-gepetto-viewer/blob/master/tests/ur5.cc)
learn-pinocchio.zip

Did you install from binary packages or from source. If so which versions of pinocchio, gepetto-viewer and gepetto-viewer-corba do you use ?

They are installed from source. The pinocchio I use is the pinocchio3-preview branch (because I need to use the closed chain manipulator), gepetto-viewer and gepetto-viewer-corba are the master branches.
Other than that, I installed libopenscenegraph-dev3.6.4 and libopenscenegraph160 3.6.4 from binary packages, and osg3.6.4 from source.

Otherwise can you look in the Body Tree what are the objects present ?

It seems that it does not load the body tree correctly, here is a screenshot of the window.
gepetto

from gepetto-viewer.

ZhengmaoHe avatar ZhengmaoHe commented on September 4, 2024

@jmirabel

I guess the objects are created but not added to the scene.

Thanks very much for the tip, could you give me more guidance to verify this guess? These lines of code are written like the official example, so it should be fine, right?

    pinocchio::gepetto::Viewer viewer (model, &visual_model, &collision_model);
    viewer.initViewer("pinocchio");
    viewer.loadViewerModel("ur5");
    viewer.addFrame(model.nframes-1);
    viewer.display(pinocchio::neutral(model));

from gepetto-viewer.

florent-lamiraux avatar florent-lamiraux commented on September 4, 2024

I am not so familiar with the bindings between pinocchio and gepetto-viewer. I cannot find which package installs
#include <pinocchio/gepetto/viewer.hpp>

from gepetto-viewer.

ZhengmaoHe avatar ZhengmaoHe commented on September 4, 2024

@florent-lamiraux It is pinocchio-gepetto-viewer: https://github.com/stack-of-tasks/pinocchio-gepetto-viewer, sorry I forgot to attach it.

from gepetto-viewer.

florent-lamiraux avatar florent-lamiraux commented on September 4, 2024

It seems to work on my computer

gepetto-gui

from gepetto-viewer.

florent-lamiraux avatar florent-lamiraux commented on September 4, 2024

Maybe you can try with another urdf model.

from gepetto-viewer.

jmirabel avatar jmirabel commented on September 4, 2024

Yes, the issue is that the meshes are not loaded. I suspect that the meshes cannot be found (though I'm surprised there is no error message. Check your ROS_PACKAGE_PATH.

from gepetto-viewer.

ZhengmaoHe avatar ZhengmaoHe commented on September 4, 2024

@jmirabel
I can't use pinocchio through ROS because I need pinocchio3-preview to use closed chain dynamics.
But I installed pinocchio2 to compare. I changed the name of the base.dae in the meshes file and the following error is output in pinocchio2

mao@mao:~/Desktop/myProject/learn-pinocchio/build$ ./learn-pinocchio 
terminate called after throwing an instance of 'std::invalid_argument'
  what():  Could not load resource /home/mao/Desktop/Third-Party/pinocchio/models/example-robot-data/robots/ur_description/meshes/ur5/visual/base.dae
Unable to open file "/home/mao/Desktop/Third-Party/pinocchio/models/example-robot-data/robots/ur_description/meshes/ur5/visual/base.dae".
Hint: the mesh directory may be wrong.
Aborted (core dumped)

This means it can find the meshes file. The same learn-pinocchio program in pinocchio3, on the other hand, runs normally, so I think there may be a problem with the read meshes step in pinocchio3?

However, pinocchio2 also does not display the robot properly (when loading meshes normally), and the gepetto-gui reports the same error as pinocchio3, as does the body tree.

from gepetto-viewer.

ZhengmaoHe avatar ZhengmaoHe commented on September 4, 2024

@florent-lamiraux
I tried several models provided in pinocchio and they all report the same error. And compared with pinocchio2 (see the my last reply for details), I think the problem may not be loading the model?

from gepetto-viewer.

jmirabel avatar jmirabel commented on September 4, 2024

I'm pretty sure the issue is unrelated. Either the paslth is wrong or the file got corrupted somehow. Check whether you can open the file with meshlab. Double check the path.

from gepetto-viewer.

ZhengmaoHe avatar ZhengmaoHe commented on September 4, 2024

@jmirabel
I made sure the path and files are OK, I have now installed the osg-dae plugin and successfully displayed the robot in pinocchio2, but the same program doesn't work in pinocchio3, still reporting the same error.
Screenshot from 2022-12-08 01-05-58

from gepetto-viewer.

florent-lamiraux avatar florent-lamiraux commented on September 4, 2024

Can you open an issue in pinocchio explaining that displaying models using pinocchio 2 + pinocchio-gepetto-viewer works but that pinocchio 3 + gepetto-viewer does not, refer to this issue and ask for what has changed ?

from gepetto-viewer.

Related Issues (20)

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.