MATLAB 帮助中心
Import factor graph from g2o log file
Since R2022a
graph = importFactorGraph(filename)
graph = importFactorGraph(filename) imports a factor graph from the specified G2o file filename.
graph
filename
example
collapse all
Import factor graph from the huskyGazebo2DPG.g2o file.
huskyGazebo2DPG.g2o
fg = importFactorGraph("huskyGazebo2DPG.g2o")
fg = factorGraph with properties: NumNodes: 152 NumFactors: 357
Get the node type of the first pose node.
type = nodeType(fg,1)
type = "POSE_SE2"
Get all of the pose nodes of the same type.
poseIDs = nodeIDs(fg,NodeType=type)
poseIDs = 1×152 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
Fix the first node so it is an anchor during optimization and then optimize the factor graph with default solver options.
fixNode(fg,0); optimize(fg); poses = nodeState(fg,poseIDs);
Plot the poses of the factor graph as an SE(2) transformations.
poseTFs = se2(poses,"xytheta"); plotTransforms(poseTFs,FrameSize=0.5); xlabel("x(m)") ylabel("y(m)") title("Imported Factor Graph")
Name of the G2o log file to import a factor graph from, specified as a string scalar or character vector. The specified G2o log file must contain either only 'EDGE_SE2' and 'VERTEX_SE2' tokens, or only 'EDGE_SE3:QUAT' and 'VERTEX_SE3:QUAT' tokens.
'EDGE_SE2'
'VERTEX_SE2'
'EDGE_SE3:QUAT'
'VERTEX_SE3:QUAT'
factorGraph
Factor graph imported from the G2o file, returned as a factorGraph object.
Introduced in R2022a
factorGraphSolverOptions
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
选择网站
选择网站以获取翻译的可用内容,以及查看当地活动和优惠。根据您的位置,我们建议您选择:。
您也可以从以下列表中选择网站:
如何获得最佳网站性能
选择中国网站(中文或英文)以获得最佳网站性能。其他 MathWorks 国家/地区网站并未针对您所在位置的访问进行优化。
美洲
欧洲
亚太
联系您当地的办事处