robotology / find-superquadric

Fit a partial point cloud with a superquadric
BSD 3-Clause "New" or "Revised" License
19 stars 4 forks source link
fitting ipopt optimization point-cloud superquadrics vtk

Fit a partial point cloud with a superquadric

Gitpod

Solve an optimization problem to find out the best superquadric that fits a given partial point cloud.

Note

The superquadric is parametrized in terms of its center, shape, the principal axes, and a rotation angle around the z-axis, in order to account for objects that are supposed to be lying on a table parallel to the x-y plane (to keep things simple 😉).

:warning: If the input point cloud does not guarantee that the above assumptions hold, it will need to be first transformed through a convenient rototraslation.

The equation of the superquadric is the following:

$\left( \left| \frac{x-c_x}{s_x} \right|^\frac{2}{\epsilon_2} + \left| \frac{y-c_y}{s_y} \right|^\frac{2}{\epsilon_2} \right)^\frac{\epsilon_2}{\epsilon_1} + \left| \frac{z-c_z}{s_z} \right|^\frac{2}{\epsilon_1} = 1$

Dependencies

Command-line options

Real-time mode

If no --file option is passed through the command line, the module will open up a port called /find-superquadric/points:rpc to which the point cloud can be sent as a yarp::sig::PointCloud<yarp::sig::DataXYZRGBA> object. Then, the module will reply with the superquadric parameters:

center-x center-y center-z angle size-x size-y size-z epsilon-1 epsilon-2

The angle around the z-axis is returned in degrees, whereas center-* and size-* are expressed in the same length units of the input point cloud.

Example

$ find-superquadric --remove-outliers "(0.01 10)" --random-sample 0.2 --file ./data/cylinder

Output

output

👨🏻‍💻 Maintainers

This repository is maintained by:

@pattacini