Caesar's Reference

Function Reference

WORK IN PROGRESS Not all functions have been added to this directory yet.

Caesar

appendvertbigdata!(cloudGraph::CloudGraphs.CloudGraph, cv::CloudGraphs.CloudVertex, description::Any, data::Array{UInt8,1})

Append big data element into current blob store and update associated global vertex information.

source
appendvertbigdata!(fgl::FactorGraph, vert::ExVertex, description::AbstractString, data::Array{UInt8,1})

Append big data element into current blob store and update associated global vertex information.

source
appendvertbigdata!(fg, sym, descr, data)

Append big data element into current blob store using parent appendvertbigdata!, but here specified by symbol of variable node in the FactorGraph. Note the default data layer api definition. User must define dlapi to refetching the vertex from the data layer. localapi avoids repeated network database fetches.

source
consoleaskuserfordb(; nparticles, drawdepth, clearslamindb, multisession, drawedges) -> Dict{AbstractString,Any}

Obtain database addresses and login credientials from STDIN, as well as a few case dependent options.

source
Caesar.db2jldFunction.
db2jld(cgl::CloudGraph, session::AbstractString, filename::AbstractString)

Fetch and save a FactorGraph session to a jld, using CloudGraph object and session definition.

source
db2jld(filename::AbstractString; addrdict::NothingUnion{Dict{AbstractString, AbstractString}}=nothing )

Fetch and save a FactorGraph session to a jld, using or asking STDIN for credentials in the addrdict field.

source
Caesar.executeQueryFunction.
executeQuery(connection::AS<:AbstractString, query::AS<:AbstractString)

Run Neo4j Cypher queries on the cloudGraph database, and return Tuple with the unparsed (results, loadresponse). Throws an error if the query fails.

source
fetchrobotdatafirstpose(cg::CloudGraph, session::AbstractString, robot::AbstractString, user::AbstractString)

Return dict of JSON parsed "robot_description" field as was inserted by counterpart insertrobotdatafirstpose! function. Used for storing general robot specific data in easily accessible manner.

source
Caesar.fetchsubgraph!Function.
fetchsubgraph!(fgl::FactorGraph, cvs::Array{CloudGraphs.CloudVertex,1}; numneighbors)

Fetch and insert list of CloudVertices into FactorGraph object, up to neighbor depth.

source
fetchsubgraph!(fgl, neoids; numneighbors)

Fetch and insert list of Neo4j IDs into FactorGraph object, up to neighbor depth.

source
findExistingMSConstraints(fgl::FactorGraph)

Return Dict{Symbol, Int} of vertex symbol to Neo4j node ID of MULTISESSION constraints in this fgl.sessionname.

source
getAllLandmarkNeoIDs(::Dict{Symbol, Dict{Symbol, Int}}, ::Symbol)

Return Vector{Int} of Neo4j vertex IDs relating to symbol, as listed in lm2others.

source
getBigDataElement(vertex::CloudGraphs.CloudVertex, description::AbstractString) -> Union{Nothing, BigDataElement}

Walk through vertex bigDataElements and return the last matching description.

source
getExVertexNeoIDs(conn::Neo4j.Connection; label, ready, backendset, session, robot, user, reqbackendset) -> Array{Tuple{Int64,Int64,Symbol},1}

Return array of tuples with ExVertex IDs and Neo4j IDs for vertices with label in session.

source
getLandmOtherSessNeoIDs{T <: AbstractString}(::CloudGraph, session::T="", robot::T="", user::T="", multisessions=Vector{T}())

Return dict of dict of Neo4j vertex IDs by session and landmark symbols.

source
getLocalSubGraphMultisession(cg::T<:AbstractString, lm2others::T<:AbstractString; session, robot, user, numneighbors)

Return subgraph copy of type FactorGraph contaning values from session in lm2others, and Vector{Symbol} of primary key symbols used for graph exstraction.

source
getPoseExVertexNeoIDs(conn::Neo4j.Connection; ready, backendset, session, reqbackendset)

Return array of tuples with ExVertex IDs and Neo4j IDs for all poses.

source
Caesar.getVertNeoIDs!Function.
getVertNeoIDs!(::CloudGraph, res::Dict{Symbol, Int}; session::AbstractString="NA", robot::AbstractString="NA", user::AbstractString="NA")

Insert into and return dict res with Neo4j IDs of ExVertex labels as stored per session in Neo4j database.

source
Caesar.getfirstposeFunction.
getfirstpose(cg::CloudGraph, session::AbstractString, robot::AbstractString, user::AbstractString)

Return Tuple{Symbol, Int} of first pose symbol and Neo4j node ID.

source
Caesar.getnewvertdictFunction.
getnewvertdict(conn, session::AbstractString, robot::AbstractString, user::AbstractString)

Return a dictionary with frtend and mongo_keys json string information for :NEWDATA elements in Neo4j database.

source
Caesar.getprpt2kdeFunction.
getprp2kde(::CloudGraph, neoids::Vector{Int}; N::Int=100)

Return PriorPoint2DensityNH with N points based on beliefs of neoids, and equal share null hypothesis between length(neoids)+1 beliefs.

source
hasBigDataElement(vertex::CloudGraphs.CloudVertex, description::AbstractString) -> Bool

Return true if vertex has bigDataElements with matching description.

source
insertrobotdatafirstpose!(cg::CloudGraph, session::AbstractString, robot::AbstractString, user::AbstractString, robotdict::Dict)

Saves robotdict via JSON to first pose in a SESSION in the database. Used for storing general robot specific data in easily accessible manner. Can fetch later retrieve same dict with counterpart fetchrobotdatafirstpose function.

source
Caesar.removeNeo4jIDFunction.
removeNeo4jID(cg::CloudGraph, neoid=-1)

Remove node from Neo4j according to Neo4j Node ID. Big data elements that may be associated with this node are not removed.

source
resetentireremotesession(conn, session, robot, user)

match (n:session) remove n.backendset, n.ready, n.data, n.bigData, n.label, n.packedType, n.exVertexId, n.shape, n.width set n :NEWDATA return n

source
rmInstMultisessionPriors!(::CloudGraph; session<:AbstractString=, multisessions::Vector{<:AbstractString}= )
source
standardcloudgraphsetup(; addrdict, nparticles, drawdepth, drawedges, clearslamindb, multisession) -> Tuple{CloudGraphs.CloudGraph,Dict{AbstractString,Any}}

Connect to databases via network according to addrdict, or ask user for credentials and return active cloudGraph object, as well as addrdict.

source
updatenewverts!(fgl::FactorGraph; N::Int)

Convert vertices of session in Neo4j DB with Caesar.jl's required data elements in preparation for MM-iSAMCloudSolve process.

source
Caesar.whosNear2DFunction.
whosNear2D(cg::CloudGraphs.CloudGraph, session::AbstractString, robot::AbstractString, user::AbstractString; x, y, yaw, dist, angle)

Find vertices near the point specified and return dictionary of symbol to Neo4j ID pairs.

source
Caesar.whosNear3DFunction.
whosNear3D(cg::CloudGraphs.CloudGraph, session::AbstractString, robot::AbstractString, user::AbstractString; x, y, z, roll, pitch, yaw, dist, angle)

Find vertices near the point specified and return dictionary of symbol to Neo4j ID pairs.

source

RoME

RoME.getRangeKDEMax2DFunction.
getRangeKDEMax2D(fgl, vsym1, vsym2)

Calculate the cartesian distance between two vertices in the graph using their symbol name, and by maximum belief point.

getRangeKDEMax2D(cgl::CloudGraph, session::AbstractString, vsym1::Symbol, vsym2::Symbol)

Calculate the cartesian distange between two vertices in the graph, by session and symbol names, and by maximum belief point.

source
RoME.initFactorGraph!Function.
initFactorGraph!(fg; P0, init, N, lbl, ready, firstPoseType, labels)

Initialize a factor graph object as Pose2, Pose3, or neither and returns variable and factor symbols as array.

RoME.addOdoFG!Function.
addOdoFG!(fg, n, DX, cov; N, ready, labels)

Create a new variable node and insert odometry constraint factor between which will automatically increment latest pose symbol x<k+1> for new node new node and constraint factor are returned as a tuple.

addOdoFG!(fgl, odo; N, ready, labels)

Create a new variable node and insert odometry constraint factor between which will automatically increment latest pose symbol x<k+1> for new node new node and constraint factor are returned as a tuple.

IncrementalInference

addVariable!(fg, lbl, softtype; N, autoinit, ready, dontmargin, labels, api, uid, smalldata, checkduplicates)

Add a variable node lbl::Symbol to fg::FactorGraph, as softtype<:InferenceVariable.

Example

fg = initfg()
addVariable!(fg, :x0, Pose2)
addFactor!(fgl, Xi, usrfnc; multihypo, ready, api, labels, uid, autoinit, threadmodel)

Add factor with user defined type <: FunctorInferenceType to the factor graph object. Define whether the automatic initialization of variables should be performed. Use order sensitive multihypo keyword argument to define if any variables are related to data association uncertainty.

Test if all elements of the string is a number: Ex, "123" is true, "1_2" is false.

approxCliqMarginalUp!(fgl, treel, csym)
approxCliqMarginalUp!(fgl, treel, csym, onduplicate; N, dbg, iters, drawpdf, multiproc)

Approximate Chapman-Kolmogorov transit integral and return separator marginals as messages to pass up the Bayes (Junction) tree, along with additional clique operation values for debugging.

Notes

  • onduplicate=true by default internally uses deepcopy of factor graph and Bayes tree, and does not update the given objects. Set false to update fgl and treel during compute.
approxConv(fgl, fct, towards; api, N)

Draw samples from the approximate convolution of towards symbol using factor fct relative to the other variables. In addition the api can be adjusted to recover the data from elsewhere (likely to be replaced/removed in the future).

areCliqChildrenNeedDownMsg(children)

Return true if any of the children cliques have status :needdownmsg.

areCliqVariablesAllMarginalized(subfg, cliq)

Return true if all variables in clique are considered marginalized (and initialized).

batchSolve!(fgl; upsolve, downsolve, drawpdf, show, N, recursive, dbg, treeinit, limititers, skipcliqids, recordcliqs, returntasks)

Perform multimodal incremental smoothing and mapping (mm-iSAM) computations over given factor graph fgl::FactorGraph on the local computer. A pdf of the Bayes (Junction) tree will be generated in the working folder with drawpdf=true

blockCliqUntilChildrenHaveUpStatus(tree, prnt)

Block the thread until child cliques of prnt::Graphs.ExVertex have finished attempting upward initialization – i.e. have status result. Return ::Dict{Symbol} indicating whether next action that should be taken for each child clique.

Notes:

  • See status options at getCliqStatusUp(..).
  • Can be called multiple times
buildSubgraphFromLabels(fgl, syms)

Construct a new factor graph object as a subgraph of fgl::FactorGraph based on the variable labels syms::Vector{Symbols}.

buildTreeFromOrdering!(fgl, p; drawbayesnet)

Build Bayes/Junction/Elimination tree from a given variable ordering.

buildCliqSubgraphDown(fgl, treel, cliqsym)
buildCliqSubgraphDown(fgl, treel, cliqsym, varsym)

Build a new subgraph from fgl::FactorGraph containing all variables and factors associated with cliq. Additionally add the upward message prior factors as needed for belief propagation (inference).

Notes

  • cliqsym::Symbol defines the cliq where variable appears as a frontal variable.
  • varsym::Symbol defaults to the cliq frontal variable definition but can in case a separator variable is required instead.
buildCliqSubgraphUp(fgl, treel, cliqsym)
buildCliqSubgraphUp(fgl, treel, cliqsym, varsym)

Build a new subgraph from fgl::FactorGraph containing all variables and factors associated with cliq. Additionally add the upward message prior factors as needed for belief propagation (inference).

Notes

  • cliqsym::Symbol defines the cliq where variable appears as a frontal variable.
  • varsym::Symbol defaults to the cliq frontal variable definition but can in case a separator variable is required instead.
childCliqs(treel, cliq)

Return a vector of child cliques to cliq.

cliqGibbs(fg, cliq, vertid, inmsgs, N, dbg, manis)

Perform one step of the minibatch clique Gibbs operation for solving the Chapman-Kolmogov trasit integral – here involving separate approximate functional convolution and product operations.

cliqHistFilterTransitions(hist, nextfnc)

Return state machine transition steps from history such that the nextfnc::Function.

Related:

getCliqSolveHistory, printCliqHistorySummary, filterHistAllToArray, sandboxCliqResolveStep

Missing docstring.

Missing docstring for cliqInitSolveUp!. Check Documenter's build log for details.

compareAllVariables(fgA, fgB; show, api, skipsamples)

Compare all variables in both ::FactorGraphs A and B.

Notes

  • A and B should all the same variables and factors.

Related:

compareFactorGraphs, compareSimilarVariables, compareVariable, ls

compareFactorGraphs(fgA, fgB; api, 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}.

Related:

compareSimilarVariables, compareSimilarFactors, compareAllVariables, ls.

compareSimilarFactors(fgA, fgB; api, skipsamples, skipcompute, show)

Compare similar factors between ::FactorGraphs A and B.

Related:

compareFactorGraphs, compareSimilarVariables, compareAllVariables, ls.

compareSimilarVariables(fgA, fgB; show, api, skipsamples)

Compare similar labels between ::FactorGraphs A and B.

Notes

  • At least one variable label should exist in both A and B.

Related:

compareFactorGraphs, compareAllVariables, compareSimilarFactors, compareVariable, ls.

compareSubsetFactorGraph(fgS, fgA; api)

Determine if and compare fgS::FactorGraph is a subset with similar content to fgA.

Notes

  • fgSfgA.

Related:

compareFactorGraphs, compareSimilarVariables, compareSimilarFactors, ls.

compareVariable(A, B; show, skipsamples)

Compare that all fields are the same in a ::FactorGraph variable.

convert2packedfunctionnode(fgl, fsym)
convert2packedfunctionnode(fgl, fsym, api)

Encode complicated function node type to related 'Packed<type>' format assuming a user supplied convert function .

cycleInitByVarOrder!(subfg, varorder)

Cycle through var order and initialize variables as possible in subfg::FactorGraph. Return true if something was updated.

Notes:

  • assumed subfg is a subgraph containing only the factors that can be used.
    • including the required up or down messages
  • intended for both up and down initialization operations.
decodefg(fgs; api)

Unpack PackedFunctionNodeData formats back to regular FunctonNodeData.

deleteFactor!(fgl, fsym)

Delete factor and its edges.

deleteVariable!(fgl, vsym; andfactors)

Delete variables, and also the factors+edges if andfactors=true (default).

doautoinit!(fgl, xi; api, singles, N)

EXPERIMENTAL: initialize target variable xi based on connceted factors in the factor graph fgl. Possibly called from addFactor!, or doCliqAutoInitUp!.

Development Notes:

Target factor is first (singletons) or second (dim 2 pairwise) variable vertex in xi.

  • TODO use DFG properly with local operations and DB update at end.
  • TODO get faster version of isInitialized for database version.
doCliqAutoInitUp!(subfg, tree, cliq; up_solve_if_able, multiprocess)

Perform cliq initalization calculation based on current state of the tree and factor graph, using upward message passing logic.

NOTE WORK IN PROGRESS

Notes

  • Return either of (:initialized, :upsolved, :needdownmsg, :badinit)
  • must use factors in cliq only, ensured by using subgraph – TODO general case.
doCliqUpSolve!(subfg, tree, cliq)

Update subfg::FactorGraph according to internal computations for a full upsolve.

Missing docstring.

Missing docstring for downGibbsCliqueDensity. Check Documenter's build log for details.

Pass NBPMessages back down the tree – pre order tree traversal.

drawCliqSubgraphUp(fgl, treel, frontalSym; show, filepath, engine, viewerapp)

Construct and draw the subgraph associated with clique frontalSym::Symbol.

Notes

  • See writeGraphPdf for details on keyword options.

Related

writeGraphPdf, buildCliqSubgraphUp, buildSubgraphFromLabels, spyCliqMat, drawTree

dwnMsg(cliq)

Return the last down message stored in cliq of Bayes (Junction) tree.

encodefg(fgl; api)

Make a full memory copy of the graph and encode all composite function node types – assuming that convert methods for 'Packed<type>' formats exist. The same converters are used for database persistence with CloudGraphs.jl.

fifoFreeze!(fgl)

Freeze nodes that are older than the quasi fixed-lag length defined by fg.qfl, according to fg.fifo ordering.

Future:

  • Allow different freezing strategies beyond fifo.
filterHistAllToArray(tree, frontals, nextfnc)

Return state machine transition steps from all cliq histories with transition nextfnc::Function.

Related:

getCliqSolveHistory, printCliqHistorySummary, cliqHistFilterTransitions, sandboxCliqResolveStep

findRelatedFromPotential(fg, idfct, vertid, N)
findRelatedFromPotential(fg, idfct, vertid, N, dbg; api)

Compute proposal belief on vertid through idfct representing some constraint in factor graph. Always full dimension variable node – partial constraints will only influence subset of variable dimensions. The remaining dimensions will keep pre-existing variable values.

fmcmc!(fgl, cliq, fmsgs, IDs, N, MCMCIter)
fmcmc!(fgl, cliq, fmsgs, IDs, N, MCMCIter, dbg)
fmcmc!(fgl, cliq, fmsgs, IDs, N, MCMCIter, dbg, api)

Iterate successive approximations of clique marginal beliefs by means of the stipulated proposal convolutions and products of the functional objects for tree clique cliq.

getCliq(bt, frt)

Return the Graphs.ExVertex node object that represents a clique in the Bayes (Junction) tree, as defined by one of the frontal variables frt::Symbol.

getCliqChildMsgsUp(fg_, treel, cliq, ?)

Get and return upward belief messages as stored in child cliques from treel::BayesTree.

Notes

  • Use last parameter to select the return format.
getCliqMsgsDown(cliql)

Return the last down message stored in cliq of Bayes (Junction) tree.

getCliqMsgsUp(cliql)

Return the last up message stored in cliq of Bayes (Junction) tree.

getCliqParentMsgDown(treel, cliq)

Get the latest down message from the parent node (without calculating anything).

Notes

  • Different from down initialization messages that do calculate new values – see prepCliqInitMsgsDown!.
  • Basically converts function getDwnMsgs from Dict{Symbol,BallTreeDensity} to Dict{Symbol,Vector{BallTreeDensity}}.
getCliqSolveHistory(cliq)

Return clique state machine history from tree if it was solved with recordcliqs.

Notes

  • Cliques are identified by front variable ::Symbol which are always unique across the cliques.
getCurrentWorkspaceFactors()

Return all factors currently registered in the workspace.

getCurrentWorkspaceVariables()

Return all variables currently registered in the workspace.

Missing docstring.

Missing docstring for getCliq. Check Documenter's build log for details.

getCliqOrderUpSolve(treel)
getCliqOrderUpSolve(treel, startcliq)

Return clique pointers for the given order in which they will be solved (sequentially).

getCliqAllVarIds(cliq)

Get all cliq variable ids::Int.

getCliqAllVarSyms(fgl, cliq)

Get all cliq variable labels as ::Symbol.

getCliqAssocMat(cliq)

Return boolean matrix of factor by variable (row by column) associations within clique, corresponds to order presented by getCliqFactorIds and getCliqAllVarIds.

Missing docstring.

Missing docstring for getCliqChildMsgsUp. Check Documenter's build log for details.

getCliqFrontalVarIds(cliq)

Get the frontal variable IDs ::Int for a given clique in a Bayes (Junction) tree.

getCliqInitVarOrderUp(cliq)

Return the most likely ordering for initializing factor (assuming up solve sequence).

Notes:

  • sorts id for increasing number of connected factors.
getCliqMat(cliq; showmsg)

Return boolean matrix of factor variable associations for a clique, optionally including (showmsg::Bool=true) the upward message singletons. Variable order corresponds to getCliqAllVarIds.

Missing docstring.

Missing docstring for getCliqOrderUpSolve. Check Documenter's build log for details.

getCliqSeparatorVarIds(cliq)

Get cliq separator (a.k.a. conditional) variable ids::Int.

getCliqStatusUp(cliq)

Return ::Symbol status a particular clique is in, with specific regard to solution or numerical initialization status:

  • :needdownmsg
  • :upsolved
  • :downsolved
  • :initialized
  • :marginalized
  • :null

Notes:

  • :null represents the first uninitialized state of a cliq.
getCliqVarIdsPriors(cliq)
getCliqVarIdsPriors(cliq, allids)
getCliqVarIdsPriors(cliq, allids, partials)

Get variable ids::Int with prior factors associated with this cliq.

Notes:

  • does not include any singleton messages from upward or downward message passing.
getCliqVars(subfg, cliq)

Return array of all variable vertices in a clique.

getCliqVarSingletons(cliq)
getCliqVarSingletons(cliq, allids)
getCliqVarSingletons(cliq, allids, partials)

Get cliq variable IDs with singleton factors – i.e. both in clique priors and up messages.

getData(v)

Retrieve data structure stored in a node.

getFactor(fvert)

Return reference to the user factor in ::FactorGraph identified by ::Symbol.

getKDE(v)

Get KernelDensityEstimate kde estimate stored in variable node.

getManifolds(vert)

Return the manifolds on which variable sym::Symbol is defined.

getMaxVertId(fgl)

Return the current maximum vertex ID number in the factor graph fragment fgl.

getParent(treel, afrontal)

Return cliq's parent clique.

getSofttype(vnd)

Variable nodes softtype information holding a variety of meta data associated with the type of variable stored in that node of the factor graph.

getTreeAllFrontalSyms(fgl, tree)

Return one symbol (a frontal variable) from each clique in the ::BayesTree.

Notes

  • Frontal variables only occur once in a clique per tree, therefore is a unique identifier.

Related:

whichCliq, printCliqHistorySummary

getTreeCliqSolveOrderUp(treel)
getTreeCliqSolveOrderUp(treel, startcliq)

Return clique pointers for the given order in which they will be solved (sequentially).

getVal(vnd)

Convenience function to get point values sampled i.i.d from marginal of lbl variable in the current factor graph.

getVal(vA)

Fetch the variable marginal sample points without the KDE bandwidth parameter. Use getVertKDE to retrieve the full KDE object.

getVariable(fgl, lbl)
getVariable(fgl, lbl, api)

Return reference to a variable in ::FactorGraph identified by ::Symbol.

getVertKDE(v)

Get KernelDensityEstimate kde estimate stored in variable node.

getUpMsgs(btl, sym)

Return the last up message stored in cliq of Bayes (Junction) tree.

getDwnMsgs(btl, sym)

Return the last down message stored in cliq of Bayes (Junction) tree.

hasOrphans(fg)

Return ::Bool on whether fg::FactorGraph has orphaned nodes or graph fragments.

inferOverTree!(fgl, bt; N, upsolve, downsolve, dbg, drawpdf, treeinit, limititers, skipcliqids, recordcliqs)

Perform up and down message passing (multi-process) algorithm for full sum-product solution of all continuous marginal beliefs.

inferOverTreeR!(fgl, bt; N, dbg, drawpdf, treeinit)

Perform up and down message passing (single process, recursive) algorithm for full sum-product solution of all continuous marginal beliefs.

Initialize an empty ::FactorGraph object while initializing sessionname, robotname, and cloudgraph.

initInferTreeUp!(fgl, treel; drawtree, N, limititers, skipcliqids, recordcliqs)

Perform tree based initialization of all variables not yet initialized in factor graph.

Missing docstring.

Missing docstring for initOnTree!. Check Documenter's build log for details.

isCliqMarginalizedFromVars(subfg, cliq)

Return ::Bool on whether all variables in this cliq are marginalzed.

isCliqReadyInferenceUp(fgl, tree, cliq)

Determine if this cliq has been fully initialized and child cliques have completed their full upward inference.

isFactor(fgl, sym)

Return whether sym::Symbol represents a factor vertex in the graph.

isInitialized(vert)

Returns state of vertex data .initialized flag.

Notes:

  • used by both factor graph variable and Bayes tree clique logic.
isMarginalized(vert)

Return ::Bool on whether this variable has been marginalized.

isTreeSolved(treel; skipinitialized)

Return true or false depending on whether the tree has been fully initialized/solved/marginalized.

isPartial(fcf)

Return ::Bool on whether factor fct<:FunctorInferenceType is a partial constraint.

isVariable(fgl, sym)

Return whether sym::Symbol represents a variable vertex in the graph.

landmarks(fgl, vsym)

Return Vector{Symbol} of landmarks attached to vertex vsym in fgl::FactorGraph.

loadjld(; file)

Opposite of savejld(fg, gt=gt, file="tempfg.jl") to load data from file. This function uses the unpacking converters for converting all PackedInferenceType to FunctorInferenceType.

localProduct(fgl, sym; N, dbg, api)

Using factor graph object fg, project belief through connected factors (convolution with conditional) to variable sym followed by a approximate functional product.

Return: product belief, full proposals, partial dimension proposals, labels

ls(cgl::CloudGraphs.CloudGraph, session::AbstractString, robot::AbstractString, user::AbstractString; sym, neoid, exvid) -> Dict{Symbol,Tuple{Int64,Int64,Array{Symbol,1}}}

List neighbors to node in cgl::CloudGraph by returning Dict{Sym}=(exvid, neoid, Symbol[labels]), and can take any of the three as input node identifier. Not specifying an identifier will result in all Variable nodes being returned.

source
ls(fgl, lbl; api, ring)

Return all elements ls(fg) as tuples, or nodes connected to the a specific element, eg. `ls(fg, :x1)

ls(fgl, lbls; api, ring)

Experimental union of elements version of ls(::FactorGraph, ::Symbol). Not mean't to replace broadcasting ls.(fg, [:x1;:x2])

ls(fgl; key1, key2)

List the nodes in a factor graph.

Examples

ls(fg)
lsf(fgl, lbl; api)

List factors in a factor graph.

Examples

lsf(fg, :x1)
lsf(fgl, lbl)

List factors in a factor graph.

Examples

lsf(fg)
lsRear(fgl)
lsRear(fgl, n)

Return array of all variable nodes connected to the last n many poses (:x*).

Example:

# Shallow copy the tail end of poses from a factor graph `fg1`
vars = lsRear(fg1, 5)
fg1_r5 = subgraphFromVerts(fg1, vars)
manualinit!(fgl, vert, pX)

Workaround function when first-version (factor graph based) auto initialization fails. Usually occurs when using factors that have high connectivity to multiple variables.

parentCliq(treel, cliq)

Return cliq's parent clique.

packFromLocalPotentials!(fgl, dens, wfac, cliq, vertid, N)
packFromLocalPotentials!(fgl, dens, wfac, cliq, vertid, N, dbg)

Add all potentials associated with this clique and vertid to dens.

prepBatchTree!(fg; ordering, drawpdf, show, filepath, viewerapp, imgs, drawbayesnet)

Build Bayes/Junction/Elimination tree.

Notes

  • Default to free qr factorization for variable elimination order.
prepCliqInitMsgsDown!(fgl, tree, cliq)

Initialization downward message passing is different from regular inference since it is possible that none of the child cliq variables have been initialized.

Notes

  • init msgs from child upward passes are individually stored in this cliq.
  • fresh product of overlapping beliefs are calculated on each function call.
Missing docstring.

Missing docstring for prepCliqInitMsgsUp!. Check Documenter's build log for details.

printCliqHistorySummary(hist)

Print a short summary of state machine history for a clique solve.

Related:

getTreeAllFrontalSyms, getCliqSolveHistory, animateCliqStateMachines

printgraphmax(fgl)

Print the maximum point values form all variables approximate marginals in the factor graph. The full marginal can be recovered for example X0 = getVertKDE(fg, :x0).

productpartials!(pGM, dummy, partials, manis)

Multiply different dimensions from partial constraints individually.

prodmultiplefullpartials(dens, partials, Ndims, N, manis)

Multiply various full and partial dimension constraints.

Multiply a single full and several partial dimension constraints.

resetBuildTreeFromOrder!(fgl, p)

Reset factor graph and build a new tree from the provided variable ordering p.

resetData!(vdata)

Partial reset of basic data fields in ::VariableNodeData of ::FunctionNode structures.

resetTreeCliquesForUpSolve!(treel)

Reset the Bayes (Junction) tree so that a new upsolve can be performed.

Notes

  • Will change previous clique status from :downsolved to :initialized only.
  • Sets the color of tree clique to lightgreen.
Missing docstring.

Missing docstring for sandboxStateMachineStep. Check Documenter's build log for details.

sandboxCliqResolveStep(tree, frontal, step)

Repeat a solver state machine step without changing history or primary values.

printCliqHistorySummary, getCliqSolveHistory, cliqHistFilterTransitions

savejld(fgl; file, groundtruth)

Save mostly complete Factor Graph type by converting complicated FunctionNodeData types to 'Packed' types using user supplied converters. Ground truth can also be saved and recovered by the associated loadjld(file="tempfg.jld2") method.

Notes:

  • Must use .jld2 since Julia 1.0 (previous version was deprecated).
setCliqAsMarginalized!(cliq, status)

Set the marginalized status of a clique.

setCliqStatus!(cliq, status)

Set up initialization or solve status of this cliq.

setDwnMsg!(cliql, msgs)

Set the downward passing message for Bayes (Junction) tree clique cliql.

setfreeze!(fgl, sym)

Set variable(s) sym of factor graph to be marginalized – i.e. not be updated by inference computation.

setTreeCliquesMarginalized!(fgl, tree)

Set all Bayes (Junction) tree cliques that have all marginalized and initialized variables.

setValKDE!(v, val)
setValKDE!(v, val, setinit)
setValKDE!(v, val, setinit, partialinit)

Set the point centers and bandwidth parameters of a variable node, also set isInitialized=true if setinit::Bool=true (as per default).

Notes

  • initialized is used for initial solve of factor graph where variables are not yet initialized.
  • partialinit is used to identify if the initialized was only partial.
setUpMsg!(cliql, msgs)

Set the upward passing message for Bayes (Junction) tree clique cliql.

showVariable(fgl, vsym; api)

Display the content of VariableNodeData to console for a given factor graph and variable tag::Symbol.

solveCliqWithStateMachine!(fg, tree, frontal; iters, recordhistory, verbose)

Standalone state machine solution for a single clique.

Related:

initInferTreeUp!

Missing docstring.

Missing docstring for subgraphFromVerts. Check Documenter's build log for details.

transferUpdateSubGraph!(dest, src)
transferUpdateSubGraph!(dest, src, syms; srcapi, destapi)

Transfer contents of src::FactorGraph variables syms::Vector{Symbol} to dest::FactorGraph.

Notes

  • Approximately like dest = src, for all syms
treeProductDwn(fg, tree, cliq, sym; N, dbg)

Calculate a fresh–-single step–-approximation to the variable sym in clique cliq as though during the downward message passing. The full inference algorithm may repeatedly calculate successive apprimxations to the variable based on the structure of variables, factors, and incoming messages to this clique. Which clique to be used is defined by frontal variable symbols (cliq in this case) – see whichCliq(...) for more details. The sym symbol indicates which symbol of this clique to be calculated. Note that the sym variable must appear in the clique where cliq is a frontal variable.

treeProductUp(fg, tree, cliq, sym; N, dbg)

Calculate a fresh (single step) approximation to the variable sym in clique cliq as though during the upward message passing. The full inference algorithm may repeatedly calculate successive apprimxations to the variables based on the structure of the clique, factors, and incoming messages. Which clique to be used is defined by frontal variable symbols (cliq in this case) – see whichCliq(...) for more details. The sym symbol indicates which symbol of this clique to be calculated. Note that the sym variable must appear in the clique where cliq is a frontal variable.

unfreezeVariablesAll!(fgl)

Free all variables from marginalization.

Related

unmarginalizeVariablesAll!

unmarginalizeVariablesAll!(fgl)

Free all variables from marginalization.

updateFGBT!(fg, bt, cliqID, ddt; dbg, fillcolor)

Update cliq cliqID in Bayes (Juction) tree bt according to contents of ddt – intended use is to update main clique after a downward belief propagation computation has been completed per clique.

updateFGBT!(fg, cliq, urt; dbg, fillcolor, api)

Update cliq cliqID in Bayes (Juction) tree bt according to contents of urt – intended use is to update main clique after a upward belief propagation computation has been completed per clique.

updateTreeCliquesAsMarginalizedFromVars!(fgl, tree)

Run through entire tree and set cliques as marginalized if all clique variables are marginalized.

Notes:

  • TODO can be made fully parallel, consider converting for use with @threads for.
upGibbsCliqueDensity(inp)
upGibbsCliqueDensity(inp, N)
upGibbsCliqueDensity(inp, N, dbg)
upGibbsCliqueDensity(inp, N, dbg, iters)

Perform computations required for the upward message passing during belief propation on the Bayes (Junction) tree. This function is usually called as via remote_call for multiprocess dispatch.

Example

inp = ExploreTreeType(fg,tree,cliq,parent,childmsgs)
urt = upGibbsCliqueDensity(inp)
  • fg factor graph,
  • tree Bayes tree,
  • cliq which cliq to perform the computation on,
  • parent the parent clique to where the upward message will be sent,
  • childmsgs is for any incoming messages from child cliques.
upMsg(cliq)

Return the last up message stored in cliq of Bayes (Junction) tree.

wipeBuildNewTree!(fg; ordering, drawpdf, show, filepath, viewerapp, imgs)

Build a completely new Bayes (Junction) tree, after first wiping clean all temporary state in fg from a possibly pre-existing tree.

Related:

buildTreeFromOrdering!

writeGraphPdf(fgl; viewerapp, filepath, engine, show)

Export a dot and pdf file drawn by Graphviz showing the factor graph.

Related

drawCliqSubgraphUp, drawTree

resetVariableAllInitializations!(fgl)

Reset initialization flag on all variables in ::FactorGraphs.

Notes

  • Numerical values remain, but inference will overwrite since init flags are now false.
showFactor(fgl, fsym; api)

Display and return to console the user factor identified by tag name.

Missing docstring.

Missing docstring for showVariable. Check Documenter's build log for details.