Add landmark point node to pose graph
adds a landmark point node, based on the input position
measurement that connects to the last pose node in the pose
graph. To add pose measurement nodes, see the
also specifies the information matrix as part of the edge constraint, which
represents the uncertainty of the landmark measurement.
adds a new landmark point node and connects it to the pose node specified by
creates an edge by specifying a point measurement between existing nodes, specified
pointNodeID. If the node
pair already exists, the function appends the new measurement.
Add Landmark Point Node to Pose Graph
Create a 2-D pose graph object.
pg = poseGraph;
Add relative poses to the pose graph.
addRelativePose(pg,[1 1 pi/2]); addRelativePose(pg,[2 2 pi/3]);
Add a landmark point node to the last pose node in the pose graph.
addPointLandmark(pg,[1 1]); show(pg);
List all poses in the pose graph.
ans = 4×3 0 0 0 1.0000 1.0000 1.5708 -1.0000 3.0000 2.6180 -2.3660 2.6340 NaN
poseGraph — Pose graph
poseGraph object |
Pose graph, specified as a
measurement — Relative position of landmark point
two-element vector of form
[x y] | three-element vector of form
[x y z]
Relative position of the landmark point, specified as one of the following:
poseGraph (2-D), the pose is a two-element vector of form of
[x y], which defines an
xy-position for the landmark.
poseGraph3D, the pose is a three-element vector of the form
[x y z], which defines an
xyz-position for the landmark.
infoMat — Information matrix for landmark
three-element vector | six-element vector
Information matrix for the landmark, specified as a three-element or six-element vector.
Each vector is the compact form of the upper triangle of the square
information matrix. An information matrix represents the uncertainty of the
measurement. The matrix is calculated as the inverse of the covariance. If
the measurement is an
[x y] vector, the covariance matrix
is a 2-by-2 matrix of pairwise covariance calculations. Typically, the
uncertainty is determined by the sensor model.
poseGraph (2-D), each information matrix is a three-element
vector. The default is
[1 1 0].
poseGraph3D, each information matrix is a six-element vector.
The default is
[1 0 0 1 0 1].
poseNodeID — Pose node to attach from
Pose node to attach from, specified as a positive integer. This integer
corresponds to the node ID of a pose node in
When specified without the
addPointLandmark creates a new landmark point node
and adds an edge between the new node and the
pointNodeID — Landmark point node to attach to
Landmark point node to attach to, specified as a positive integer. This integer corresponds to the ID of a landmark node in the pose graph. See the LandmarkNodeIDs property of the pose graph.
nodePair — Edge node pair in pose graph
Edge node pair in the pose graph, returned as a two-element vector that lists the IDs of the two nodes that the edge connects. Multiple edges may exist between the same pair of nodes.
edgeID — ID of added edge
ID of added edge, returned as a positive integer.
C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.
Use this syntax when constructing
poseGraph3D objects for code generation:
poseGraph('MaxNumEdges',maxEdges,'MaxNumNodes',maxNodes) specifies an
upper bound on the number of edges and nodes allowed in the pose graph when
generating code. This limit is only required when generating code.
Introduced in R2021a