Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3.12.3 #40

Open
delipl opened this issue Sep 12, 2024 · 1 comment
Open

Python 3.12.3 #40

delipl opened this issue Sep 12, 2024 · 1 comment

Comments

@delipl
Copy link

delipl commented Sep 12, 2024

Could you release the package for Python 3.12.3?

@sinaenjuni
Copy link

sinaenjuni commented Nov 7, 2024

You can use the g2o library in the Python 3.12 version.

  1. git clone https://github.com/miquelmassot/g2o-python
  2. cd g2o-python/g2o
  3. git clone https://github.com/RainerKuemmerle/g2o.git
  4. git checkout pymem
  5. cd ..
  6. pip install -v .
    end.

image

If you are using the pose optimization feature, it is recommended to modify it from line 91 of the file 'g2o/python/types/SBA/py_types_6_dof_expamp.cpp' because you can't use the fx, fy, cx, cy, Xw member variables.

  py::class_<EdgeSE3ProjectXYZOnlyPose,
             BaseUnaryEdge<2, Vector2, VertexSE3Expmap>,
             std::shared_ptr<EdgeSE3ProjectXYZOnlyPose>>(
      m, "EdgeSE3ProjectXYZOnlyPose")
      .def(py::init<>())
      .def("compute_error", &EdgeSE3ProjectXYZOnlyPose::computeError)
      .def("is_depth_positive", &EdgeSE3ProjectXYZOnlyPose::isDepthPositive)
      .def("linearize_oplus", &EdgeSE3ProjectXYZOnlyPose::linearizeOplus)
      .def("cam_project", &EdgeSE3ProjectXYZOnlyPose::cam_project)
      .def_readwrite("fx", &EdgeSE3ProjectXYZOnlyPose::fx)
      .def_readwrite("fy", &EdgeSE3ProjectXYZOnlyPose::fy)
      .def_readwrite("cx", &EdgeSE3ProjectXYZOnlyPose::cx)
      .def_readwrite("cy", &EdgeSE3ProjectXYZOnlyPose::cy)
      .def_readwrite("Xw", &EdgeSE3ProjectXYZOnlyPose::Xw);
  // Projection using focal_length in x and y directions stereo
  py::class_<EdgeStereoSE3ProjectXYZ,
             BaseBinaryEdge<3, Vector3, VertexPointXYZ, VertexSE3Expmap>,
             std::shared_ptr<EdgeStereoSE3ProjectXYZ>>(
      m, "EdgeStereoSE3ProjectXYZ")
      .def(py::init<>())
      .def("compute_error", &EdgeStereoSE3ProjectXYZ::computeError)
      .def("is_depth_positive", &EdgeStereoSE3ProjectXYZ::isDepthPositive)
      .def("linearize_oplus", &EdgeStereoSE3ProjectXYZ::linearizeOplus)
      .def("cam_project", &EdgeStereoSE3ProjectXYZ::cam_project)
      .def_readwrite("fx", &EdgeStereoSE3ProjectXYZ::fx)
      .def_readwrite("fy", &EdgeStereoSE3ProjectXYZ::fy)
      .def_readwrite("cx", &EdgeStereoSE3ProjectXYZ::cx)
      .def_readwrite("cy", &EdgeStereoSE3ProjectXYZ::cy)
      .def_readwrite("bf", &EdgeStereoSE3ProjectXYZ::bf);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants