Closed pattacini closed 6 years ago
It looks very nice. I'll see how to extend it to superquadric and how to make it transparent.
Since VTK
would introduce a further dependency (see the dependency hell problem :wink:), we could enable/disable its use via cmake options and then deal with this choice accordingly in the code.
OpenGL is also a viable solution indeed.
Ok, thank you very much for this material!
maybe you can use the vtk implementation of superquadrics http://www.vtk.org/doc/nightly/html/classvtkSuperquadric.html
@nrj127 thanks for pointing out.
@giuliavezzani actually therein it's said that:
vtkSuperquadric computes the implicit function and function gradient for a superquadric
If VTK really provides the gradient we need, that would be nice!
@nrj127 thank you very much for the suggestion. @pattacini it seems a very useful upgrade for our repo!
@giuliavezzani now that we have some free time it might be worth reconsidering getting accustomed to VTK as a tool, in general.
VTK is definitely the way to go. Look at this VTK viewer that displays point clouds along with their representation based on simple quadrics.
The code implementing the viewer makes use of Ipopt with analytical Jacobian.
cc @fbottarel @claudiofantacci
Great work @pattacini 🎉 Just a note from my side. I've been working on a PC visualization tool based on PCLVisualizer that itself relies on VTK. It's an experimental work on a private repository which includes an AR and a mesh visualization tool as well (it's something that I have been used for my research so far).
As soon as #robotology/yarp/1597 is merged we will also have a compatibility layer from/to YARP to/from PCL pointclouds which may be worth exploiting!
Maybe at a certain point we could discuss which one is preferable and implement everything in a single amazing 👓 tool!
@claudiofantacci mine is just a demonstrator and, in no way, it claims to be a sort of "official" viewer 😉
My feeling is that VTK kind of outclasses PCL in terms of what can be easily shown; think of isosurfaces, marching cubes and the like.
@pattacini, that's very cool! We could absolutely use it for superquadric visualization. @claudiofantacci, we could discuss together about the best tool to use for this kind of applications.
My feeling is that VTK kind of outclasses PCL in terms of what can be easily shown; think of isosurfaces, marching cubes and the like.
Yes! The point to discuss are indeed the limitations on the PCL side. I reckon that VTK is much much (much much and did I say much?) better than PCL visualizer.
Displaying superquadrics in VTK is doable as expected 😉
The code is available in https://github.com/pattacini/find-superquadric.
Aside from the viewer, that code implements the analytical Jacobian which we could now readily compare against the solution based on finite differences, even though the former works with a subset of rotations (i.e. only one angle around the z-axis). This is to keep things simple to start with and also to see whether we don't lose too much in terms of the representation of generic objects lying on a table.
@fbottarel has a version which incorporates the viewer only so that we can use it to display superquadrics at will.
We should really consider using
VTK
to display the superquadric. Look at this code snippet to show an implicit function.