DistributedFactorGraphs Functions
Abstract DFG
DistributedFactorGraphs._getDuplicatedEmptyDFG
— Method_getDuplicatedEmptyDFG(dfg)
Gets an empty and unique DFG derived from an existing DFG.
DistributedFactorGraphs.addFactor!
— MethodaddFactor!(dfg, factor)
Add a FactorCompute to a DFG.
DistributedFactorGraphs.addFactors!
— MethodaddFactors!(dfg, factors)
Add a Vector{FactorCompute} to a DFG.
DistributedFactorGraphs.addVariable!
— MethodaddVariable!(dfg, variable)
Add a VariableCompute to a DFG.
DistributedFactorGraphs.addVariables!
— MethodaddVariables!(dfg, variables)
Add a Vector{VariableCompute} to a DFG.
DistributedFactorGraphs.buildSubgraph
— MethodbuildSubgraph(, dfg, variableFactorLabels; ...)
buildSubgraph(
,
dfg,
variableFactorLabels,
distance;
solvable,
graphLabel,
sessionId,
kwargs...
)
Build a deep subgraph copy from the DFG given a list of variables and factors and an optional distance. Note: Orphaned factors (where the subgraph does not contain all the related variables) are not returned. Related:
Dev Notes
- Bulk vs node for node: a list of labels are compiled and the sugraph is copied in bulk.
DistributedFactorGraphs.copyGraph!
— FunctioncopyGraph!(destDFG, sourceDFG; ...)
copyGraph!(destDFG, sourceDFG, variableLabels; ...)
copyGraph!(
destDFG,
sourceDFG,
variableLabels,
factorLabels;
copyGraphMetadata,
overwriteDest,
deepcopyNodes,
verbose,
showprogress
)
Common function for copying nodes from one graph into another graph. This is overridden in specialized implementations for performance. Orphaned factors are not added, with a warning if verbose. Set overwriteDest
to overwrite existing variables and factors in the destination DFG. NOTE: copyGraphMetadata not supported yet. Related:
DistributedFactorGraphs.deepcopyGraph!
— FunctiondeepcopyGraph!(destDFG, sourceDFG; ...)
deepcopyGraph!(destDFG, sourceDFG, variableLabels; ...)
deepcopyGraph!(
destDFG,
sourceDFG,
variableLabels,
factorLabels;
kwargs...
)
Copy nodes from one graph into another graph by making deepcopies. see copyGraph!
for more detail. Related:
DistributedFactorGraphs.deepcopyGraph
— MethoddeepcopyGraph(, sourceDFG; ...)
deepcopyGraph(, sourceDFG, variableLabels; ...)
deepcopyGraph(
,
sourceDFG,
variableLabels,
factorLabels;
graphLabel,
sessionId,
kwargs...
)
Copy nodes from one graph into a new graph by making deepcopies. see copyGraph!
for more detail. Related:
DistributedFactorGraphs.deleteFactor!
— MethoddeleteFactor!(dfg, factor; suppressGetFactor)
Delete the referened FactorCompute from the DFG.
DistributedFactorGraphs.deleteFactor!
— MethoddeleteFactor!(dfg, label; suppressGetFactor)
Delete a FactorCompute from the DFG using its label.
DistributedFactorGraphs.deleteVariable!
— MethoddeleteVariable!(dfg, variable)
Delete a referenced VariableCompute from the DFG.
Notes
- Returns
Tuple{AbstractDFGVariable, Vector{<:AbstractDFGFactor}}
DistributedFactorGraphs.deleteVariable!
— MethoddeleteVariable!(dfg, label)
Delete a VariableCompute from the DFG using its label.
DistributedFactorGraphs.exists
— Methodexists(dfg, node)
True if the variable or factor exists in the graph.
DistributedFactorGraphs.findClosestTimestamp
— MethodfindClosestTimestamp(setA, setB)
Find and return the closest timestamp from two sets of Tuples. Also return the minimum delta-time (::Millisecond
) and how many elements match from the two sets are separated by the minimum delta-time.
DistributedFactorGraphs.findFactorsBetweenNaive
— FunctionfindFactorsBetweenNaive(dfg, from, to)
findFactorsBetweenNaive(dfg, from, to, assertSingles)
Relatively naive function counting linearly from-to
DevNotes
- Convert to using Graphs shortest path methods instead.
DistributedFactorGraphs.findShortestPathDijkstra
— FunctionSpeciallized function available to only GraphsDFG at this time.
Notes
- Has option for various types of filters (increases memory usage)
Example
using IncrementalInference
# canonical example graph as example
fg = generateGraph_Kaess()
@show path = findShortestPathDijkstra(fg, :x1, :x3)
@show isVariable.(fg, path)
@show isFactor.(fg, path)
DevNotes
- TODO expand to other AbstractDFG entities.
- TODO use of filter resource consumption can be improved.
Related
findFactorsBetweenNaive
, Graphs.dijkstra_shortest_paths
DistributedFactorGraphs.findVariableNearTimestamp
— FunctionfindVariableNearTimestamp(dfg, timest; ...)
findVariableNearTimestamp(
dfg,
timest,
regexFilter;
tags,
solvable,
warnDuplicate,
number
)
Find and return nearest variable labels per delta time. Function will filter on regexFilter
, tags
, and solvable
.
Notes
- Returns
Vector{Tuple{Vector{Symbol}, Millisecond}}
DevNotes:
- TODO
number
should allow returning more than one for k-nearest matches. - Future versions likely will require some optimization around the internal
getVariable
call.- Perhaps a dedicated/efficient
getVariableTimestamp
for all DFG flavors.
- Perhaps a dedicated/efficient
Related
ls, listVariables, findClosestTimestamp
DistributedFactorGraphs.getAddHistory
— MethodgetAddHistory(dfg)
DistributedFactorGraphs.getAdjacencyMatrixSymbols
— MethodgetAdjacencyMatrixSymbols(dfg; solvable)
Get a matrix indicating relationships between variables and factors. Rows are all factors, columns are all variables, and each cell contains either nothing or the symbol of the relating factor. The first row and first column are factor and variable headings respectively. Note:
- rather use getBiadjacencyMatrix
- Returns either of
::Matrix{Union{Nothing, Symbol}}
DistributedFactorGraphs.getAgent
— MethodgetAgent(dfg)
DistributedFactorGraphs.getAgentLabel
— MethodgetAgentLabel(dfg)
DistributedFactorGraphs.getAgentMetadata
— MethodgetAgentMetadata(dfg)
Get the metadata from the agent in the AbstractDFG.
DistributedFactorGraphs.getBiadjacencyMatrix
— MethodgetBiadjacencyMatrix(dfg; solvable)
Get a matrix indicating adjacency between variables and factors. Returned as a named tuple: B::SparseMatrixCSC{Int}, varLabels::Vector{Symbol) facLabels::Vector{Symbol). Rows are the factors, columns are the variables, with the corresponding labels in varLabels,facLabels.
Notes
- Returns
::NamedTuple{(:B, :varLabels, :facLabels), Tuple{SparseMatrixCSC, Vector{Symbol}, Vector{Symbol}}}
DistributedFactorGraphs.getDFGInfo
— MethodgetDFGInfo(dfg)
Convenience function to get all the metadata of a DFG
DistributedFactorGraphs.getDescription
— MethodgetDescription(dfg)
DistributedFactorGraphs.getFactor
— MethodgetFactor(dfg, label)
Get a FactorCompute from a DFG using its label.
DistributedFactorGraphs.getFactorOperationalMemoryType
— MethodgetFactorOperationalMemoryType(dummy)
Method must be overloaded by the user for Serialization to work. E.g. IncrementalInference uses CommonConvWrapper <: FactorOperationalMemory
.
DistributedFactorGraphs.getFactors
— MethodgetFactors(dfg; ...)
getFactors(dfg, regexFilter; tags, solvable)
List the DFGFactors in the DFG. Optionally specify a label regular expression to retrieves a subset of the factors.
DistributedFactorGraphs.getFactorsSkeleton
— FunctionGet the skeleton factors from a DFG as a Vector{FactorSkeleton}.
DistributedFactorGraphs.getGraph
— FunctionDistributedFactorGraphs.getGraphLabel
— MethodgetGraphLabel(dfg)
DistributedFactorGraphs.getGraphMetadata
— MethodgetGraphMetadata(dfg)
Get the metadata from the factorgraph in the AbstractDFG.
DistributedFactorGraphs.getId
— MethodgetId(node)
Get the id of the node.
DistributedFactorGraphs.getLabel
— MethodgetLabel(node)
Get the label of the node.
DistributedFactorGraphs.getMetadata
— MethodgetMetadata(node)
Get the metadata of the node.
DistributedFactorGraphs.getNeighborhood
— MethodgetNeighborhood(dfg, label, distance)
Build a list of all unique neighbors inside 'distance'
Notes
- Returns
Vector{Symbol}
Related:
DistributedFactorGraphs.getSolverParams
— MethodgetSolverParams(dfg)
DistributedFactorGraphs.getSummaryGraph
— MethodgetSummaryGraph(dfg)
Get a summary graph (first-class citizens of variables and factors) with the same structure as the original graph.
Notes
- this is a copy of the original.
- Returns
::GraphsDFG{NoSolverParams, VariableSummary, FactorSummary}
DistributedFactorGraphs.getTypeDFGFactors
— FunctionFunction to get the type of the factors in the DFG.
DistributedFactorGraphs.getTypeDFGVariables
— FunctionFunction to get the type of the variables in the DFG.
DistributedFactorGraphs.getVariable
— MethodgetVariable(dfg, label, solveKey)
Get a VariableCompute with a specific solver key. In memory types still return a reference, other types returns a variable with only solveKey.
DistributedFactorGraphs.getVariable
— MethodgetVariable(dfg, label)
Get a VariableCompute from a DFG using its label.
DistributedFactorGraphs.getVariableSkeleton
— FunctionGet a VariableSkeleton from a DFG.
DistributedFactorGraphs.getVariableSummary
— FunctionGet a VariableSummary from a DFG.
DistributedFactorGraphs.getVariables
— MethodgetVariables(dfg; ...)
getVariables(dfg, regexFilter; tags, solvable, detail)
List the DFGVariables in the DFG. Optionally specify a label regular expression to retrieves a subset of the variables. Tags is a list of any tags that a node must have (at least one match).
DistributedFactorGraphs.getVariablesSkeleton
— FunctionGet the variables from a DFG as a Vector{VariableSkeleton}.
DistributedFactorGraphs.getVariablesSummary
— FunctionGet the variables from a DFG as a Vector{VariableSummary}.
DistributedFactorGraphs.hasTags
— MethodhasTags(dfg, sym, tags; matchAll)
Determine if the variable or factor neighbors have the tags:;Vector{Symbol}
, and matchAll::Bool
.
DistributedFactorGraphs.hasTagsNeighbors
— MethodhasTagsNeighbors(dfg, sym, tags; matchAll)
Determine if the variable or factor neighbors have the tags:;Vector{Symbol}
, and matchAll::Bool
.
DistributedFactorGraphs.isConnected
— MethodisConnected(dfg)
Checks if the graph is fully connected, returns true if so.
DistributedFactorGraphs.isFactor
— MethodisFactor(dfg, sym)
Return whether sym::Symbol
represents a factor vertex in the graph DFG. Checks whether it both exists in the graph and is a factor. (If you rather want a quicker for type, just do node isa FactorCompute)
DistributedFactorGraphs.isPathFactorsHomogeneous
— MethodisPathFactorsHomogeneous(dfg, from, to)
Return (::Bool,::Vector{TypeName}) of types between two nodes in the factor graph
DevNotes
- Only works on LigthDFG at the moment.
Related
DistributedFactorGraphs.isVariable
— MethodisVariable(dfg, sym)
Return whether sym::Symbol
represents a variable vertex in the graph DFG. Checks whether it both exists in the graph and is a variable. (If you rather want a quick for type, just do node isa VariableCompute)
DistributedFactorGraphs.listFactors
— FunctionlistFactors(dfg; ...)
listFactors(dfg, regexFilter; tags, solvable)
Get a list of the labels of the DFGFactors in the DFG. Optionally specify a label regular expression to retrieves a subset of the factors.
DistributedFactorGraphs.listNeighbors
— MethodlistNeighbors(dfg, label; solvable)
Retrieve a list of labels of the immediate neighbors around a given variable or factor specified by its label.
DistributedFactorGraphs.listSolveKeys
— FunctionlistSolveKeys(variable::VariableCompute) -> Set{Symbol}
listSolveKeys(
variable::VariableCompute,
filterSolveKeys::Union{Nothing, Regex}
) -> Set{Symbol}
listSolveKeys(
variable::VariableCompute,
filterSolveKeys::Union{Nothing, Regex},
skeys
) -> Any
List all the solvekeys used amongst all variables in the distributed factor graph object.
Related
DistributedFactorGraphs.listVariables
— FunctionlistVariables(dfg; ...)
listVariables(dfg, regexFilter; tags, solvable)
Get a list of labels of the DFGVariables in the graph. Optionally specify a label regular expression to retrieves a subset of the variables. Tags is a list of any tags that a node must have (at least one match).
Notes
- Returns
::Vector{Symbol}
Example
listVariables(dfg, r"l", tags=[:APRILTAG;])
See also: ls
DistributedFactorGraphs.ls
— Methodls(dfg; ...)
ls(dfg, regexFilter; tags, solvable)
List the DFGVariables in the DFG. Optionally specify a label regular expression to retrieves a subset of the variables. Tags is a list of any tags that a node must have (at least one match).
Notes:
- Returns
Vector{Symbol}
DistributedFactorGraphs.ls
— Methodls(dfg; ...)
ls(dfg, node; solvable)
Retrieve a list of labels of the immediate neighbors around a given variable or factor.
DistributedFactorGraphs.ls2
— Methodls2(dfg, label)
Helper to return neighbors at distance 2 around a given node.
DistributedFactorGraphs.lsTypes
— MethodlsTypes(dfg)
Return Vector{Symbol}
of all unique variable types in factor graph.
DistributedFactorGraphs.lsTypesDict
— MethodlsTypesDict(dfg)
Return ::Dict{Symbol, Vector{Symbol}}
of all unique variable types with labels in a factor graph.
DistributedFactorGraphs.lsWho
— MethodlsWho(dfg, type)
Gives back all factor labels that fit the bill: lsWho(dfg, :Pose3)
Notes
- Returns
Vector{Symbol}
Dev Notes
- Cloud versions will benefit from less data transfer
ls(dfg::C, ::T) where {C <: CloudDFG, T <: ..}
Related
ls, lsf, lsfPriors
DistributedFactorGraphs.lsf
— Methodlsf(dfg; ...)
lsf(dfg, regexFilter; tags, solvable)
List the DFGFactors in the DFG. Optionally specify a label regular expression to retrieves a subset of the factors.
Notes
- Return
Vector{Symbol}
DistributedFactorGraphs.lsf
— Methodlsf(dfg; ...)
lsf(dfg, _)
Lists the factors of a specific type in the factor graph. Example, list all the Point2Point2 factors in the factor graph dfg
: lsfWho(dfg, :Point2Point2)
Notes
- Return
Vector{Symbol}
DistributedFactorGraphs.lsfPriors
— MethodlsfPriors(dfg)
Return vector of prior factor symbol labels in factor graph dfg
.
Notes:
- Returns
Vector{Symbol}
DistributedFactorGraphs.lsfTypes
— MethodlsfTypes(dfg)
Return Vector{Symbol}
of all unique factor types in factor graph.
DistributedFactorGraphs.lsfTypesDict
— MethodlsfTypesDict(dfg)
Return ::Dict{Symbol, Vector{Symbol}}
of all unique factors types with labels in a factor graph.
DistributedFactorGraphs.mergeGraph!
— FunctionmergeGraph!(destDFG, sourceDFG; ...)
mergeGraph!(destDFG, sourceDFG, variableLabels; ...)
mergeGraph!(
destDFG,
sourceDFG,
variableLabels,
factorLabels;
...
)
mergeGraph!(
destDFG,
sourceDFG,
variableLabels,
factorLabels,
distance;
solvable,
kwargs...
)
Merger sourceDFG to destDFG given an optional list of variables and factors and distance. Notes:
- Nodes already in the destination graph are updated from sourceDFG.
- Orphaned factors (where the subgraph does not contain all the related variables) are not included.
Related:
DistributedFactorGraphs.mergeGraphVariableData!
— MethodmergeGraphVariableData!(destDFG, sourceDFG, varSyms)
Common function to update all solver data and estimates from one graph to another. This should be used to push local solve data back into a cloud graph, for example.
Notes
- Returns
::Nothing
DistributedFactorGraphs.mergeVariableData!
— MethodmergeVariableData!(dfg, sourceVariable)
Merges and updates solver and estimate data for a variable (variable can be from another graph). Note: Makes a copy of the estimates and solver data so that there is no coupling between graphs.
DistributedFactorGraphs.rebuildFactorMetadata!
— FunctionrebuildFactorMetadata!(dfg, factor)
rebuildFactorMetadata!(dfg, factor, neighbors)
Method must be overloaded by the user for Serialization to work.
DistributedFactorGraphs.setAgentMetadata!
— MethodsetAgentMetadata!(dfg, data)
Set the metadata of the agent in the AbstractDFG.
DistributedFactorGraphs.setDescription!
— MethodsetDescription!(dfg, description)
DistributedFactorGraphs.setGraphMetadata!
— MethodsetGraphMetadata!(dfg, data)
Set the metadata of the factorgraph in the AbstractDFG.
DistributedFactorGraphs.setMetadata!
— MethodsetMetadata!(node, metadata)
Set the metadata of the node.
DistributedFactorGraphs.toDot
— MethodtoDot(dfg)
Produces a dot-format of the graph for visualization.
Notes
- Returns
::String
DistributedFactorGraphs.toDotFile
— FunctiontoDotFile(dfg)
toDotFile(dfg, fileName)
Produces a dot file of the graph for visualization. Download XDot to see the data
Note
- Default location "/tmp/dfg.dot" – MIGHT BE REMOVED
- Can be viewed with the
xdot
system application. - Based on graphviz.org
DistributedFactorGraphs.updateFactor!
— MethodupdateFactor!(dfg, factor)
Update a complete FactorCompute in the DFG.
DistributedFactorGraphs.updateVariable!
— MethodupdateVariable!(dfg, variable)
Update a complete VariableCompute in the DFG.
Common Accessors
Common Accessors to both variable and factor nodes
DistributedFactorGraphs.emptyTags!
— MethodemptyTags!(dfg, sym)
Empty all tags from the node (empty)
DistributedFactorGraphs.getLabel
— MethodgetLabel(v)
Return the label for a DFGNode.
DistributedFactorGraphs.getSolvable
— MethodgetSolvable(dfg, sym)
Get 'solvable' parameter for either a variable or factor.
DistributedFactorGraphs.getSolvable
— MethodgetSolvable(var)
Variables or factors may or may not be 'solvable', depending on a user definition. Useful for ensuring atomic transactions.
Related:
- isSolveInProgress
DistributedFactorGraphs.getSolveInProgress
— FunctiongetSolveInProgress(var)
getSolveInProgress(var, solveKey)
Which variables or factors are currently being used by an active solver. Useful for ensuring atomic transactions.
DevNotes:
- Will be renamed to
data.solveinprogress
which will be in VND, not DFGNode – see DFG #201
Related
isSolvable
DistributedFactorGraphs.getTags
— MethodgetTags(v)
Return the tags for a DFGNode.
DistributedFactorGraphs.getTimestamp
— MethodgetTimestamp(v)
Get the timestamp of a DFGNode.
DistributedFactorGraphs.isSolvable
— MethodisSolvable(node)
Variables or factors may or may not be 'solvable', depending on a user definition. returns true if getSolvable
> 0 Related:
getSolvable
(@ref)
DistributedFactorGraphs.listTags
— MethodlistTags(dfg, sym)
Return the tags for a variable or factor.
DistributedFactorGraphs.mergeTags!
— MethodmergeTags!(dfg, sym, tags)
Merge add tags to a variable or factor (union)
DistributedFactorGraphs.removeTags!
— MethodremoveTags!(dfg, sym, tags)
Remove the tags from the node (setdiff)
DistributedFactorGraphs.setSolvable!
— MethodsetSolvable!(dfg, sym, solvable)
Set the solvable
parameter for either a variable or factor.
DistributedFactorGraphs.setSolvable!
— MethodsetSolvable!(node, solvable)
Set the solvable
parameter for either a variable or factor.
DistributedFactorGraphs.setTags!
— MethodsetTags!(f, tags)
Set the tags for a DFGNode.
DistributedFactorGraphs.setTimestamp!
— MethodsetTimestamp!(dfg, lbl, ts)
Set the timestamp of a Variable/Factor object in a factor graph. Note: Since timestamp
is not mutable setTimestamp!
calls updateVariable!
internally. See also setTimestamp
DFG Variable Accessors CRUD and SET opperations
DistributedFactorGraphs.addMetadata!
— MethodaddMetadata!(dfg, label, pair)
Add a Metadata pair key=>value
for variable label
in dfg
DistributedFactorGraphs.addPPE!
— FunctionaddPPE!(dfg, sourceVariable)
addPPE!(dfg, sourceVariable, ppekey)
Add a new PPE entry from a deepcopy of the source variable PPE. NOTE: Copies the PPE.
DistributedFactorGraphs.addPPE!
— MethodaddPPE!(dfg, variablekey, ppe)
Add variable PPE, errors if it already exists.
DistributedFactorGraphs.addVariableSolverData!
— FunctionaddVariableSolverData!(dfg, sourceVariable)
addVariableSolverData!(dfg, sourceVariable, solveKey)
Add a new solver data entry from a deepcopy of the source variable solver data. NOTE: Copies the solver data.
DistributedFactorGraphs.addVariableSolverData!
— MethodaddVariableSolverData!(dfg, variablekey, vnd)
Add variable solver data, errors if it already exists.
DistributedFactorGraphs.cloneSolveKey!
— MethodcloneSolveKey!(
dest_dfg,
dest,
src_dfg,
src;
solvable,
labels,
verbose
)
Duplicate a solveKey
` into a destination from a source.
Notes
- Can copy between graphs, or to different solveKeys within one graph.
DistributedFactorGraphs.deleteMetadata!
— MethoddeleteMetadata!(dfg, label, key)
Delete a Metadata entry at key
for variable label
in dfg
DistributedFactorGraphs.deletePPE!
— FunctiondeletePPE!(dfg, sourceVariable)
deletePPE!(dfg, sourceVariable, ppekey)
Delete PPE data, returns the deleted element.
DistributedFactorGraphs.deletePPE!
— FunctiondeletePPE!(dfg, variablekey)
deletePPE!(dfg, variablekey, ppekey)
Delete PPE data, returns the deleted element.
DistributedFactorGraphs.deleteVariableSolverData!
— FunctiondeleteVariableSolverData!(dfg, sourceVariable)
deleteVariableSolverData!(dfg, sourceVariable, solveKey)
Delete variable solver data, returns the deleted element.
DistributedFactorGraphs.deleteVariableSolverData!
— FunctiondeleteVariableSolverData!(dfg, variablekey)
deleteVariableSolverData!(dfg, variablekey, solveKey)
Delete variable solver data, returns the deleted element.
DistributedFactorGraphs.emptyMetadata!
— MethodemptyMetadata!(dfg, label)
Empty all Metadata from variable label
in dfg
DistributedFactorGraphs.getCoordinates
— MethodgetCoordinates(, p)
getCoordinates(, p, basis)
Default reduction of a variable point value (a group element) into coordinates as Vector
. Override if defaults are not correct.
DevNotes
- TODO Likely remove as part of serialization updates, see #590
- Used in transition period for Serialization. This function will likely be changed or deprecated entirely.
Related
DistributedFactorGraphs.getDimension
— FunctionInterface function to return the variableType
dimension of an InferenceVariable, extend this function for all Types<:InferenceVariable.
DistributedFactorGraphs.getLastUpdatedTimestamp
— MethodgetLastUpdatedTimestamp(est)
DistributedFactorGraphs.getManifold
— MethodgetManifold(_)
Interface function to return the <:ManifoldsBase.AbstractManifold
object of variableType<:InferenceVariable
.
DistributedFactorGraphs.getMetadata
— MethodgetMetadata(dfg, label, key)
Get the Metadata entry at key
for variable label
in dfg
DistributedFactorGraphs.getPPE
— FunctiongetPPE(vari)
getPPE(vari, solveKey)
Get the parametric point estimate (PPE) for a variable in the factor graph.
Notes
- Defaults on keywords
solveKey
andmethod
Related
getMeanPPE, getMaxPPE, getKDEMean, getKDEFit, getPPEs, getVariablePPEs
DistributedFactorGraphs.getPPE
— FunctiongetPPE(v)
getPPE(v, ppekey)
Get the parametric point estimate (PPE) for a variable in the factor graph for a given solve key.
Notes
- Defaults on keywords
solveKey
andmethod
Related getPPEMean
, getPPEMax
, updatePPE!
, mean(BeliefType)
DistributedFactorGraphs.getPPEDict
— MethodgetPPEDict(v)
Get the PPE dictionary for a variable. Recommended to use CRUD operations instead, getPPE
, addPPE!
, updatePPE!
, deletePPE!
.
DistributedFactorGraphs.getPPEMax
— MethodgetPPEMax(est)
DistributedFactorGraphs.getPPEMean
— MethodgetPPEMean(est)
DistributedFactorGraphs.getPPESuggested
— MethodgetPPESuggested(est)
DistributedFactorGraphs.getPPEs
— FunctionGet all the parametric point estimate (PPE) for a variable in the factor graph.
DistributedFactorGraphs.getPoint
— MethodgetPoint(, v)
getPoint(, v, basis)
Default escalzation from coordinates to a group representation point. Override if defaults are not correct. E.g. coords -> se(2) -> SE(2).
DevNotes
- TODO Likely remove as part of serialization updates, see #590
- Used in transition period for Serialization. This function will likely be changed or deprecated entirely.
Related
DistributedFactorGraphs.getPointIdentity
— FunctionInterface function to return the user provided identity point for this InferenceVariable manifold, extend this function for all Types<:InferenceVariable.
Notes
- Used in transition period for Serialization. This function will likely be changed or deprecated entirely.
DistributedFactorGraphs.getPointType
— FunctionInterface function to return the manifold point type of an InferenceVariable, extend this function for all Types<:InferenceVariable.
DistributedFactorGraphs.getSolvedCount
— MethodgetSolvedCount(v)
Get the number of times a variable has been inferred – i.e. solvedCount
.
Related
isSolved, setSolvedCount!
DistributedFactorGraphs.getSolverData
— FunctiongetSolverData(v)
getSolverData(v, key)
Retrieve solver data structure stored in a variable.
DistributedFactorGraphs.getSolverDataDict
— MethodgetSolverDataDict(v)
Get solver data dictionary for a variable. Advised to use graph CRUD operations instead.
DistributedFactorGraphs.getVariablePPE
— MethodgetVariablePPE(::VariableCompute)
getVariablePPE(::VariableNodeData)
Get the Parametric Point Estimate of the given variable.
DistributedFactorGraphs.getVariablePPEDict
— MethodgetVariablePPEDict(vari)
Return full dictionary of PPEs in a variable, recommended to rather use CRUD: getPPE
,
DistributedFactorGraphs.getVariableSolverData
— FunctiongetVariableSolverData(dfg, variablekey)
getVariableSolverData(dfg, variablekey, solvekey)
Get variable solverdata for a given solve key.
DistributedFactorGraphs.getVariableType
— MethodgetVariableType(_)
Variable nodes variableType
information holding a variety of meta data associated with the type of variable stored in that node of the factor graph.
Notes
- API Quirk in that this function returns and instance of
::T
not a::Type{<:InferenceVariable}
.
DevWork
- TODO, see IncrementalInference.jl 1228
Related
getVariableType
DistributedFactorGraphs.getVariableTypeName
— MethodgetVariableTypeName(v)
Retrieve the soft type name symbol for a VariableSummary. ie :Point2, Pose2, etc.
DistributedFactorGraphs.isInitialized
— FunctionisInitialized(var)
isInitialized(var, key)
Returns state of variable data .initialized
flag.
Notes:
- used by both factor graph variable and Bayes tree clique logic.
DistributedFactorGraphs.isMarginalized
— FunctionisMarginalized(vert)
isMarginalized(vert, solveKey)
Return ::Bool
on whether this variable has been marginalized.
Notes:
- VariableNodeData default
solveKey=:default
DistributedFactorGraphs.isSolved
— MethodisSolved(v)
Boolean on whether the variable has been solved.
Related
getSolved, setSolved!
DistributedFactorGraphs.listMetadata
— MethodlistMetadata(dfg, label)
List all Metadata keys for a variable label
in dfg
DistributedFactorGraphs.listPPEs
— MethodlistPPEs(dfg, variablekey)
List all the PPE data keys in the variable.
DistributedFactorGraphs.listVariableSolverData
— MethodlistVariableSolverData(dfg, variablekey)
List all the solver data keys in the variable.
DistributedFactorGraphs.mergePPEs!
— MethodmergePPEs!(destVariable, sourceVariable)
Merges and updates solver and estimate data for a variable (variable can be from another graph). Note: Makes a copy of the estimates and solver data so that there is no coupling between graphs.
DistributedFactorGraphs.mergeVariableSolverData!
— MethodmergeVariableSolverData!(destVariable, sourceVariable)
Merges and updates solver and estimate data for a variable (variable can be from another graph). If the same key is present in another collection, the value for that key will be the value it has in the last collection listed (updated). Note: Makes a copy of the estimates and solver data so that there is no coupling between graphs.
DistributedFactorGraphs.setMarginalized!
— MethodsetMarginalized!(vnd, val)
Mark a variable as marginalized true
or false
.
DistributedFactorGraphs.setSolvedCount!
— MethodsetSolvedCount!(v, val)
Update/set the solveCount
value.
Related
getSolved, isSolved
DistributedFactorGraphs.setSolverData!
— FunctionsetSolverData!(v, data)
setSolverData!(v, data, key)
Set solver data structure stored in a variable.
DistributedFactorGraphs.setTimestamp
— MethodsetTimestamp(v, ts; verbose)
Set the timestamp of a VariableCompute object returning a new VariableCompute. Note: Since the timestamp
field is not mutable setTimestamp
returns a new variable with the updated timestamp (note the absence of !
). Use updateVariable!
on the returened variable to update it in the factor graph if needed. Alternatively use setTimestamp!
. See issue #315.
DistributedFactorGraphs.updateMetadata!
— MethodupdateMetadata!(dfg, label, pair; warn_if_absent)
Update a Metadata pair key=>value
for variable label
in dfg
DistributedFactorGraphs.updatePPE!
— FunctionupdatePPE!(dfg, sourceVariables; ...)
updatePPE!(dfg, sourceVariables, ppekey; warn_if_absent)
Update PPE data if it exists, otherwise add it.
DistributedFactorGraphs.updatePPE!
— FunctionupdatePPE!(dfg, sourceVariable; ...)
updatePPE!(dfg, sourceVariable, ppekey; warn_if_absent)
Update PPE data if it exists, otherwise add it. NOTE: Copies the PPE data.
DistributedFactorGraphs.updatePPE!
— MethodupdatePPE!(dfg, variablekey, ppe; warn_if_absent)
Update PPE data if it exists, otherwise add it – one call per key::Symbol=:default
.
Notes
- uses
ppe.solveKey
as solveKey.
DistributedFactorGraphs.updateVariableSolverData!
— FunctionupdateVariableSolverData!(dfg, variablekey, vnd; ...)
updateVariableSolverData!(
dfg,
variablekey,
vnd,
useCopy;
...
)
updateVariableSolverData!(
dfg,
variablekey,
vnd,
useCopy,
fields;
warn_if_absent
)
Update variable solver data if it exists, otherwise add it.
Notes:
useCopy=true
to copy solver data and keep separate memory.- Use
fields
to updated only a few VND.fields while adhering touseCopy
.
Related
mergeVariableSolverData!
DistributedFactorGraphs.@defVariable
— Macro@defVariable StructName manifolds<:ManifoldsBase.AbstractManifold
A macro to create a new variable with name StructName
and manifolds. Note that the manifolds
is an object and must be a subtype of ManifoldsBase.AbstractManifold
. See documentation in Manifolds.jl on making your own.
Example:
DFG.@defVariable Pose2 SpecialEuclidean(2) ArrayPartition([0;0.0],[1 0; 0 1.0])
DFG Factor Accessors CRUD and SET opperations
DistributedFactorGraphs._getPriorType
— Method_getPriorType(_type)
If you know a variable is ::Type{<:Pose2}
but want to find its default prior ::Type{<:PriorPose2}
.
Assumptions
- The prior type will be defined in the same module as the variable type.
- Not exported per default, but can be used with knowledge of the caveats.
Example
using RoME
@assert RoME.PriorPose2 == DFG._getPriorType(Pose2)
DistributedFactorGraphs.getFactorFunction
— MethodgetFactorFunction(fcd)
Return reference to the user factor in <:AbstractDFG
identified by ::Symbol
.
DistributedFactorGraphs.getFactorType
— MethodgetFactorType(data)
Return user factor type from factor graph identified by label ::Symbol
.
Notes
- Replaces older
getfnctype
.
DistributedFactorGraphs.getSolverData
— MethodgetSolverData(f)
Retrieve solver data structure stored in a factor.
DistributedFactorGraphs.getVariableOrder
— MethodgetVariableOrder(fct)
Get the variable ordering for this factor. Should be equivalent to listNeighbors unless something was deleted in the graph.
DistributedFactorGraphs.isPrior
— MethodisPrior(dfg, fc)
Return ::Bool
on whether given factor fc::Symbol
is a prior in factor graph dfg
.
Printing
DistributedFactorGraphs.printFactor
— MethodprintFactor(dfg, sym; kwargs...)
Display and return to console the user factor identified by tag name.
DistributedFactorGraphs.printVariable
— MethodprintVariable(dfg, sym; kwargs...)
Display the content of VariableNodeData
to console for a given factor graph and variable tag::Symbol
.
Dev Notes
- TODO split as two show macros between AMP and DFG
Compare Utilities
DistributedFactorGraphs.compareAll
— MethodcompareAll(Al, Bl; show, skip)
Recursively compare the all fields of T that are not in skip
for objects Al
and Bl
.
TODO > add to func_ref.md
DistributedFactorGraphs.compareAllVariables
— MethodcompareAllVariables(fgA, fgB; skip, show, skipsamples)
Compare all variables in both ::FactorGraph
s A and B.
Notes
- A and B should all the same variables and factors.
Related:
compareFactorGraphs
, compareSimilarVariables
, compareVariable
, ls
DistributedFactorGraphs.compareFactor
— MethodcompareFactor(A, B; show, skip, skipsamples, skipcompute)
Compare that all fields are the same in a ::FactorGraph
factor.
DevNotes
- TODO
getSolverData(A).fnc.varValsAll / varidx
are only defined downstream, so should should this function not be in IIF?
DistributedFactorGraphs.compareFactorGraphs
— MethodcompareFactorGraphs(
fgA,
fgB;
skipsamples,
skipcompute,
skip,
show
)
Compare and return if two factor graph objects are the same, by comparing similar variables and factors.
Notes:
- Default items to skip with
skipsamples
,skipcompute
. - User defined fields to skip can be specified with
skip::Vector{Symbol}
. - To enable debug messages for viewing which fields are not the same:
- https://stackoverflow.com/questions/53548681/how-to-enable-debugging-messages-in-juno-julia-editor
Related:
compareSimilarVariables
, compareSimilarFactors
, compareAllVariables
, ls
.
DistributedFactorGraphs.compareFields
— MethodcompareFields(Al, Bl; show, skip)
Compare the all fields of T that are not in skip
for objects Al
and Bl
and returns ::Bool
.
TODO > add to func_ref.md
DistributedFactorGraphs.compareSimilarFactors
— MethodcompareSimilarFactors(
fgA,
fgB;
skipsamples,
skipcompute,
skip,
show
)
Compare similar factors between ::FactorGraph
s A and B.
Related:
compareFactorGraphs
, compareSimilarVariables
, compareAllVariables
, ls
.
DistributedFactorGraphs.compareSimilarVariables
— MethodcompareSimilarVariables(fgA, fgB; skip, show, skipsamples)
Compare similar labels between ::FactorGraph
s A and B.
Notes
- At least one variable label should exist in both A and B.
Related:
compareFactorGraphs
, compareAllVariables
, compareSimilarFactors
, compareVariable
, ls
.
DistributedFactorGraphs.compareVariable
— MethodcompareVariable(A, B; skip, show, skipsamples)
Compare that all fields are the same in a ::FactorGraph
variable.
Common Functions
DistributedFactorGraphs.getVariableLabelNumber
— FunctiongetVariableLabelNumber(vs)
getVariableLabelNumber(vs, prefix)
Small utility to return ::Int
, e.g. 0
from getVariableLabelNumber(:x0)
Examples
getVariableLabelNumber(:l10) # 10
getVariableLabelNumber(:x1) # 1
getVariableLabelNumber(:x1_10, "x1_") # 10
DevNotes
- make prefix Regex based for longer – i.e.
:apriltag578
,:lm1_4
DistributedFactorGraphs.isValidLabel
— MethodisValidLabel(id)
Returns true if the label is valid for node.
DistributedFactorGraphs.solveGraph!
— FunctionDefault non-parametric graph solution.
DistributedFactorGraphs.solveGraphParametric!
— FunctionStandard parametric graph solution (Experimental).
DistributedFactorGraphs.sortDFG
— MethodsortDFG(vars; by, kwargs...)
Convenience wrapper for Base.sort
. Sort variable (factor) lists in a meaningful way (by timestamp
, label
, etc), for example [:april;:x1_3;:x1_6;]
Defaults to sorting by timestamp for variables and factors and using natural_lt
for Symbols. See Base.sort for more detail.
Notes
- Not fool proof, but does better than native sort.
Example
sortDFG(ls(dfg))
sortDFG(ls(dfg), by=getLabel, lt=natural_lt)
Related
ls, lsf
Serialization
DistributedFactorGraphs.getTypeFromSerializationModule
— MethodgetTypeFromSerializationModule(_typeString)
Get a type from the serialization module.