DistributedFactorGraphs Types

DistributedFactorGraphs Module

DistributedFactorGraphs.DistributedFactorGraphsModule

DistributedFactorGraphs.jl provides a flexible factor graph API for use in the Caesar.jl ecosystem.

The package supplies:

  • A standardized API for interacting with factor graphs
  • Implementations of the API for in-memory and database-driven operation
  • Visualization extensions to validate the underlying graph
source

Types

Abstract DFG

Summary DFG

DFG Variable Nodes

DistributedFactorGraphs.StateType
mutable struct State{T<:AbstractStateType, P, N}

Data container for solver-specific data.


T: Variable type, such as Position1, or RoME.Pose2, etc. P: Variable point type, the type of the manifold point. N: Manifold dimension. Fields:

  • label::Symbol: Identifier associated with this State object.
  • val::Vector: Vector of on-manifold points used to represent a ManifoldKernelDensity (or parametric) belief.
  • bw::Matrix{Float64}: Common kernel bandwith parameter used with ManifoldKernelDensity, see field covar for the parametric covariance.
  • covar::Array{StaticArraysCore.SMatrix{N, N, Float64}, 1} where N: Parametric (Gaussian) covariance.

  • separator::Vector{Symbol}

  • initialized::Bool: False if initial numerical values are not yet available or stored values are not ready for further processing yet.

  • observability::Vector{Float64}: Stores the amount information (per measurement dimension) captured in each coordinate dimension.
  • marginalized::Bool: Should this state be treated as marginalized in inference computations.
  • solves::Int64: How many times has a solver updated this state estimate.
  • statetype::Symbol
source
DistributedFactorGraphs.VariableDFGType
struct VariableDFG{T<:AbstractStateType, P, N} <: AbstractGraphVariable

Complete variable structure for a DistributedFactorGraph variable.


Fields:

  • label::Symbol: Variable label, e.g. :x1. Accessor: getLabel

  • timestamp::TimesDates.TimeDateZone: Variable timestamp. Accessors: getTimestamp

  • tags::Set{Symbol}: Variable tags, e.g [:POSE, :VARIABLE, and :LANDMARK]. Accessors: listTags, mergeTags!, and deleteTags!

  • states::OrderedCollections.OrderedDict{Symbol, State{T, P, N}} where {T<:AbstractStateType, P, N}: Dictionary of state data. May be a subset of all solutions if a solver label was specified in the get call. Accessors: addState!, mergeState!, and deleteState!

  • bloblets::OrderedCollections.LittleDict{Symbol, Bloblet, KS, VS} where {KS<:Union{Tuple{Vararg{Symbol}}, AbstractVector{Symbol}}, VS<:Union{Tuple{Vararg{Bloblet}}, AbstractVector{Bloblet}}}: Dictionary of small data associated with this variable. Accessors: getBloblet, addBloblet!

  • blobentries::OrderedCollections.OrderedDict{Symbol, Blobentry}: Dictionary of large data associated with this variable. Accessors: addBlobentry!, getBlobentry, mergeBlobentry!, and deleteBlobentry!

  • solvable::Base.RefValue{Int64}: Solvable flag for the variable. Accessors: getSolvable, setSolvable!

  • statetype::Symbol

  • _autotype::Nothing

source
DistributedFactorGraphs.VariableSummaryType
struct VariableSummary <: AbstractGraphVariable

Summary variable structure for a DistributedFactorGraph variable.


Fields:

  • label::Symbol: Variable label, e.g. :x1. Accessor: getLabel

  • timestamp::TimesDates.TimeDateZone: Variable timestamp. Accessors: getTimestamp

  • tags::Set{Symbol}: Variable tags, e.g [:POSE, :VARIABLE, and :LANDMARK]. Accessors: listTags, mergeTags!, and deleteTags!

  • statetype::Symbol: Symbol for the state type for the underlying variable.

  • blobentries::OrderedCollections.OrderedDict{Symbol, Blobentry}: Dictionary of large data associated with this variable. Accessors: addBlobentry!, getBlobentry, mergeBlobentry!, and deleteBlobentry!

source

DFG Factor Nodes

DistributedFactorGraphs.FactorDFGType
struct FactorDFG{T<:AbstractObservation, N} <: AbstractGraphFactor

Complete factor structure for a DistributedFactorGraph factor.

Fields:

  • label::Symbol: Factor label, e.g. :x1f1. Accessor: getLabel

  • tags::Set{Symbol}: Factor tags, e.g [:FACTOR]. Accessors: listTags, mergeTags!, and deleteTags!

  • variableorder::NTuple{N, Symbol} where N: Ordered list of the neighbor variables. Accessors: getVariableOrder

  • timestamp::TimesDates.TimeDateZone: Variable timestamp. Accessors: getTimestamp

  • solvable::Base.RefValue{Int64}: Solvable flag for the factor. Accessors: getSolvable, setSolvable!

  • bloblets::OrderedCollections.LittleDict{Symbol, Bloblet, KS, VS} where {KS<:Union{Tuple{Vararg{Symbol}}, AbstractVector{Symbol}}, VS<:Union{Tuple{Vararg{Bloblet}}, AbstractVector{Bloblet}}}: Dictionary of small data associated with this variable. Accessors: getBloblet, addBloblet!

  • observation::AbstractObservation: Observation function or measurement for this factor. Accessors: getObservation(@ref)

  • hyper::DistributedFactorGraphs.Recipehyper: Hyperparameters associated with this factor.

  • state::DistributedFactorGraphs.Recipestate: Describes the current state of the factor. Persisted in serialization.

  • solvercache::Base.RefValue{<:AbstractFactorCache}: Temporary, non-persistent memory used internally by the solver for intermediate numerical computations and buffers. solvercache is lazily allocated and only used during factor operations; it is not serialized or retained after solving. Accessors: getCache, setCache!

  • blobentries::OrderedCollections.OrderedDict{Symbol, Blobentry}: Blobentries associated with this factor.

  • _autotype::Nothing: Internal: used for automatic type metadata generation.

source
DistributedFactorGraphs.FactorSummaryType
struct FactorSummary <: AbstractGraphFactor

Read-only summary factor structure for a DistributedFactorGraph factor.


Fields:

  • label::Symbol: Factor label, e.g. :x1f1. Accessor: getLabel

  • tags::Set{Symbol}: Factor tags, e.g [:FACTOR]. Accessors: listTags, mergeTags!, and deleteTags!

  • variableorder::Tuple{Vararg{Symbol}}: Ordered list of the neighbor variables. Accessors: getVariableOrder

  • timestamp::TimesDates.TimeDateZone: Variable timestamp. Accessors: getTimestamp

source

Error Types

DFG Plots [GraphMakie.jl]

DistributedFactorGraphs.plotDFGFunction

Plots the structure of the factor graph. GraphMakie must be imported before DistributedFactorGraphs for these functions to be available. Returns the plot context.

E.g.

using GraphMakie
using DistributedFactorGraphs
# ... Make graph...
plotDFG(fg)

More information at GraphMakie.jl

source

Drivers

GraphsDFGs

FileDFG

DistributedFactorGraphs.loadDFG!Method
loadDFG!(dfgLoadInto, file)

Load a DFG from a saved folder.

Example

using DistributedFactorGraphs, IncrementalInference
# Create a DFG - can make one directly, e.g. GraphsDFG{NoSolverParams}() or use IIF:
dfg = initfg()
# Load the graph
loadDFG!(dfg, "/tmp/savedgraph.tar.gz")
# Use the DFG as you do normally.
ls(dfg)

See also: loadDFG, saveDFG

source
DistributedFactorGraphs.saveDFGMethod
saveDFG(folder, dfg)

Save a DFG to a folder. Will create/overwrite folder if it exists.

DevNotes:

  • TODO remove compress kwarg.

Example

using DistributedFactorGraphs, IncrementalInference
# Create a DFG - can make one directly, e.g. GraphsDFG{NoSolverParams}() or use IIF:
dfg = initfg()
# ... Add stuff to graph using either IIF or DFG:
v1 = addVariable!(dfg, :a, ContinuousScalar, tags = [:POSE], solvable=0)
# Now save it:
saveDFG(dfg, "/tmp/saveDFG.tar.gz")
source