Giter Club home page Giter Club logo

Comments (5)

RainerKuemmerle avatar RainerKuemmerle commented on August 16, 2024

This edge is using parameters along with the cache functionality. I guess our documentation about that is really bad. You need to do something like this:

  // do this once after you created the optimizer
  // add the camera parameters, caches are automatically resolved in the addEdge calls
  g2o::ParameterSE3Offset* cameraOffset = new g2o::ParameterSE3Offset;
  cameraOffset->setId(0);
  _optimizer->addParameter(cameraOffset);

Then before adding the edge, specify the parameter by setParameterId() (see below, example from my code, therefore strange variable names):

    g2o::EdgeSE3PointXYZ* refEdge = new g2o::EdgeSE3PointXYZ;
    refEdge->vertices()[0] = refCamera;
    refEdge->vertices()[1] = point;
    refEdge->setMeasurement(match.refKeypoint->xyz().cast<double>());
    cvutils::informationMatrixForPointXYZ(informationForFeatures, match.refKeypoint->xyz(), camera.fx(), camera.baseline());
    refEdge->setInformation(informationForFeatures);
    refEdge->setParameterId(0, 0);
    optimizer.addEdge(refEdge));

Hope this helps.

from g2o.

maikelo avatar maikelo commented on August 16, 2024

Thanks for your answer, I will try it now. By the way, where I can get
a better documentation?
thanks again
Maikel

El 19/02/2014 10:23 AM, Rainer Kümmerle escribió:

This edge is using parameters along with the cache functionality. I
guess our documentation about that is really bad. You need to do
something like this:

// do this once after you created the optimizer
// add the camera parameters, caches are automatically resolved in the addEdge calls
g2o::ParameterSE3Offset* cameraOffset = new g2o::ParameterSE3Offset;
cameraOffset->setId(0);
_optimizer->addParameter(cameraOffset);

Then before adding the edge, specify the parameter by setParameterId()
(see below, example from my code, therefore strange variable names):

g2o::EdgeSE3PointXYZ* refEdge = new g2o::EdgeSE3PointXYZ;
refEdge->vertices()[0] = refCamera;
refEdge->vertices()[1] = point;
refEdge->setMeasurement(match.refKeypoint->xyz().cast());
cvutils::informationMatrixForPointXYZ(informationForFeatures, match.refKeypoint->xyz(), camera.fx(), camera.baseline());
refEdge->setInformation(informationForFeatures);
refEdge->setParameterId(0, 0);
optimizer.addEdge(refEdge));

Hope this helps.


Reply to this email directly or view it on GitHub
#34 (comment).


Este mensaje no contiene virus ni malware porque la protección de avast! Antivirus está activa.
http://www.avast.com

from g2o.

maikelo avatar maikelo commented on August 16, 2024

Thank you very much, I don't have this problem any more.

from g2o.

dvdesc avatar dvdesc commented on August 16, 2024

Hi Maikel,

Can you please send me the .g2o file that your fixed code have generated?
I'm trying to understand how to create the .g2o file to use in g2o_viewer, but I'm having problems with the EDGE_SE3_TRACKXYZ type.

I'm starting to use g2o, so it would be really great if you could help me.

Thanks,
David

from g2o.

lzyplayer avatar lzyplayer commented on August 16, 2024
setParameterId

Hi Maikel,

Can you please send me the .g2o file that your fixed code have generated? I'm trying to understand how to create the .g2o file to use in g2o_viewer, but I'm having problems with the EDGE_SE3_TRACKXYZ type.

I'm starting to use g2o, so it would be really great if you could help me.

Thanks, David

It will be something like

PARAMS_SE3OFFSET 0 0 0 0 0 0 0 1 
VERTEX_SE3:QUAT 1 0.104345 -0.14683 0.0259318 -0.0147856 -0.0130104 -0.0153391 0.999688 
VERTEX_SE3:QUAT 2 0.0958852 -0.151532 0.0290417 -0.013642 -0.0117871 -0.0165527 0.9997 
....
VERTEX_TRACKXYZ 6 0.218348 0.615178 5.04324 
VERTEX_TRACKXYZ 7 0.189336 0.329615 4.98097 
...
EDGE_SE3_TRACKXYZ 1 6 0 1.80483 -1.14227 2.20213 1 0 0 1 0 1 
EDGE_SE3_TRACKXYZ 1 7 0 1.80483 -1.14227 2.20213 1 0 0 1 0 1 
EDGE_SE3_TRACKXYZ 2 7 0 1.80728 -0.850002 2.26974 1 0 0 1 0 1 

from g2o.

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.