Working with Factors#

Factors represent the interaction between particular variables. Factors define the algebra structure between variables via probabilistic measurement models as captured measurement or data cues. For example, a distance travelled measurement between two pose variables. Relative factors between variables are probabilistic models that capture the likelihood interactions between variables. Priors factors (i.e. unary to one variable) represent absolute information to be introduced about that variable, for example a GPS measurement; more on how to introduce distrust of such priors later.

List or Get Factors#

All factors in a graph can be listed via:

flbls = listFactors(fgclient)
# flbls = await listFactorsAsync(fgclient)
# ["x0f_8ebc", ...]

Note the factor labels are autogenerated based on the variables and a random sequence. For example a prior factor might have the label x0f_8ebc, while factor between three variables might be x7x49l4f_654t.

A specific factor can be retrieved using the label: ```python f = getFactor(fgclient, ‘x7942x7943f_c2c6’) # f = await getFactorAsync(fgclient, ‘x7942x7943f_c2c6’)

# <Factor(label=x7942x7943f_c2c6,variables=[‘x7942’, ‘x7943’])>

The Factor object consists of the following

Parameters:
  • label (str) –

  • fnctype (str) –

  • _variableOrderSymbols (List[str]) –

  • data (str) –

  • metadata (str) –

  • tags (List[str]) –

  • timestamp (datetime) –

  • nstime (str) –

  • solvable (str) –

  • _version (str) –

  • id (UUID) –

-->

SDK Supported Factors#

The list of currently supported factors in the SDK are:

  • Prior, for 1D Euclidean only.

  • LinearRelative, for Euclidean only.

  • Point2Point2Range

  • PriorPoint2

  • PriorPose2

  • Pose2Pose2

  • ScatterAlignPose2

  • Pose2AprilTag4Corners

  • Pose2Point2BearingRange

  • PriorPose3

  • Pose3Pose3

Tip

Many more factor types are already supported by the solver, see additional docs here. Reach out to NavAbility for help or support in bringing more variable types to eh SDK sooner, or for help in building more factor types that may not yet exist in either libraries.