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.
Web サイトの選択
Web サイトを選択すると、翻訳されたコンテンツにアクセスし、地域のイベントやサービスを確認できます。現在の位置情報に基づき、次のサイトの選択を推奨します:
また、以下のリストから Web サイトを選択することもできます。
最適なサイトパフォーマンスの取得方法
中国のサイト (中国語または英語) を選択することで、最適なサイトパフォーマンスが得られます。その他の国の MathWorks のサイトは、お客様の地域からのアクセスが最適化されていません。
南北アメリカ
ヨーロッパ
アジア太平洋地域
最寄りの営業オフィスへのお問い合わせ