Skip to content

Commit d1abeb2

Browse files
authored
Merge pull request #193 from JuliaRobotics/enhancement/movingcomparefactortodfg
Adding factor data compare to DFG
2 parents f5e271f + 88c1226 commit d1abeb2

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

src/DistributedFactorGraphs.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,7 @@ export getSummary, getSummaryGraph
5858

5959
# Comparisons
6060
export
61+
compare,
6162
compareField,
6263
compareFields,
6364
compareAll,

src/services/DFGFactor.jl

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import Base: convert
1+
import Base: convert, ==
22

33
function convert(::Type{DFGFactorSummary}, f::DFGFactor)
44
return DFGFactorSummary(f.label, deepcopy(f.tags), f._internalId, deepcopy(f._variableOrderSymbols))
@@ -73,6 +73,19 @@ function unpackFactor(dfg::G, packedProps::Dict{String, Any}, iifModule)::DFGFac
7373
return factor
7474
end
7575

76+
# Compare FunctionNodeData
77+
function compare(a::GenericFunctionNodeData{T1,S},b::GenericFunctionNodeData{T2,S}) where {T1, T2, S}
78+
# TODO -- beef up this comparison to include the gwp
79+
TP = true
80+
TP = TP && a.fncargvID == b.fncargvID
81+
TP = TP && a.eliminated == b.eliminated
82+
TP = TP && a.potentialused == b.potentialused
83+
TP = TP && a.edgeIDs == b.edgeIDs
84+
TP = TP && a.frommodule == b.frommodule
85+
# TP = TP && typeof(a.fnc) == typeof(b.fnc)
86+
return TP
87+
end
88+
7689
"""
7790
$(SIGNATURES)
7891
Equality check for DFGFactor.

0 commit comments

Comments
 (0)