Main Content

nodeType

Get node type of node in factor graph

Since R2022a

Description

Factor Graph

type = nodeType(fg,nodeID) returns the type of the node with the specified node ID in the factor graph.

example

Multi-Node Factors (e.g. factorTwoPoseSE3)

type = nodeType(factor,nodeID) returns the type of the node with the specified node ID that the specified factor connects to.

Use this syntax for these factors:

example

Single-Node Factors (e.g. factorPoseSE3Prior)

type = nodeType(factor) returns the type of the node that the specified factor connects to.

Use this syntax for these factors:

example

Examples

collapse all

Create factor graph, and generate node IDs one factorPoseSE2AndPointXY factor. Then create the factorPoseSE2AndPointXY factor and add the factor to the factor graph.

fg = factorGraph;
ids = generateNodeID(fg,1,"factorPoseSE2AndPointXY")
ids = 1×2

     0     1

f = factorPoseSE2AndPointXY(ids);
addFactor(fg,f);

Get the types of node 0 and node 1.

nodeType(fg,0)
ans = 
"POSE_SE2"
nodeType(fg,1)
ans = 
"POINT_XY"

Generate node IDs to create one factorPoseSE2AndPointXY factor and then create the factorPoseSE2AndPointXY factor.

f = factorPoseSE2AndPointXY([0 1]);

Get the types of node 0 and node 1.

nodeType(f,0)
ans = 
"POSE_SE2"
nodeType(f,1)
ans = 
"POINT_XY"

Create a SE(3) prior pose factor that connects to node ID 1.

f = factorPoseSE3Prior(1);

Get the type of the node that the factor connects to.

nodeType(f)
ans = 
"POSE_SE3"

Input Arguments

collapse all

Factor graph, specified as a factorGraph object.

ID of node to check, specified as a nonnegative integer.

Output Arguments

collapse all

Type of the node, returned as one of these node types:

  • "POSE_SE2" — Pose in SE(2) state space

  • "POSE_SE3" — Pose in SE(3) state space

  • "POSE_SE3_SCALE" — Pose scale in SE(3) state space

  • "TRANSFORM_SE3" — Sensor transform in SE(3) state space

  • "POINT_XY" — 2-D point

  • "POINT_XYZ" — 3-D point

  • "IMU_BIAS" — IMU gyroscope and accelerometer bias

  • "VEL3" — 3-D velocity

Extended Capabilities

expand all

Version History

Introduced in R2022a

expand all