Comments (5)
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.
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.
Thank you very much, I don't have this problem any more.
from g2o.
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.
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)
- g2o issues with ROS2 humble . HOT 4
- LGPL3+ for csparse_extension: still up to date? HOT 1
- Cannot link g2o to ROS project, after building successfully from source and installing to default system paths HOT 2
- How to clear g2o optimizer after optimization to avoid memory leak HOT 3
- Inconsistent results for pnp solver HOT 1
- How can I delete or deactivate an edge during the optimization HOT 3
- How can I print a variable in the ComputeError() in the terminal? HOT 3
- Looks like bug in optimization_algorithm_levenberg.cpp HOT 1
- [error] [optimizable_graph.cpp:483] virtual bool HOT 1
- opt.edges().empty() Function g2o::HyperGraph::edges has no address, possibly due to compiler optimizations. HOT 1
- E: Unable to locate package libg2o-core-dev HOT 1
- Same codes but g2o files are not. HOT 6
- Please help me with the rosdep error. I installed libg2o. But still get this error. What should I do? HOT 2
- Problem related to freeglut library while setting G2O_USE_OPENGL off in CMAKE HOT 1
- Prerequisite reading materials and pathway to learning to use the g20 library HOT 4
- In computeEdgeSE3Gradient, why the jacobians of dte/dtj is related to Rj
- Need to specify at least OSX 10.15 with CMAKE_OSX_DEPLOYMENT_TARGET
- [build error] HOT 1
- [g2opy] Error when loading .g2o file using optimizer.load() function HOT 1
- Build error on ubuntu 20.04 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from g2o.