Hi, thank you for sharing the code!
I can run your code on my own computer. But when I modify the initial value of the translation part to 0, that is Eigen::Vector3d trans(0.0, 0.0, 0.0); in the line 148 of src/pnpnl.cpp file, I met this following error:
buildSystem(): NaN within Jacobian for edge 0x56163c2901e0 for vertex 1
And when I use Google to find this error, they said this reason is that the wrong order of the function setVertex(). But the error I met has nothing to do with the function setVertex().