From 26b0fbdb5e1cd612d2164d7466026ce40884227e Mon Sep 17 00:00:00 2001 From: Johannes Terblanche Date: Thu, 3 Jul 2025 19:49:48 +0200 Subject: [PATCH] Rename IIF abstract types --- NEWS.md | 8 ++++ src/Deprecated.jl | 26 +++++++++- src/DistributedFactorGraphs.jl | 4 +- src/entities/DFGFactor.jl | 18 ++----- src/entities/DFGVariable.jl | 14 +++--- src/services/AbstractDFG.jl | 6 +-- src/services/CompareUtils.jl | 4 +- src/services/DFGFactor.jl | 28 +++++------ src/services/DFGVariable.jl | 87 +++++++++++++++++++++++++--------- src/services/Serialization.jl | 6 +-- test/plottingTest.jl | 2 +- test/testBlocks.jl | 14 +++--- 12 files changed, 139 insertions(+), 78 deletions(-) diff --git a/NEWS.md b/NEWS.md index ceb3c955..7eae746d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,6 +1,14 @@ Listing news on any major breaking changes in DFG. For regular changes, see integrated Github.com project milestones for DFG. # v0.28 - Reading or deserialzing of factor graphs created prior to v0.25 are no longer suppoted with the complete removal of User/Robot/Session +- Deprecated AbstractRelativeMinimize and AbstractManifoldsMinimize + +#TODO pending: +- AbstractPrior -> AbstractPriorObservation/PriorObservation +- AbstractRelative -> RelativeObservation/RelativeObservation +- InferenceType -> AbstractPackedFactorObservation +- InferenceVariable -> [Abstract]VariableStateType/AbstractVarstateType +- PackedSamplableBelief -> [Abstract]PackedBelief # v0.27 - `delete` returns number of nodes deleted and no longer the object that was deleted. diff --git a/src/Deprecated.jl b/src/Deprecated.jl index 9029b8f0..5e94a7c8 100644 --- a/src/Deprecated.jl +++ b/src/Deprecated.jl @@ -1,3 +1,25 @@ +## ================================================================================ +## Deprecated in v0.28 +##================================================================================= +export AbstractRelativeMinimize, + AbstractManifoldMinimize, + AbstractPrior, + AbstractRelative, + InferenceVariable, + InferenceType, + PackedSamplableBelief + +const AbstractPrior = PriorObservation +const AbstractRelative = RelativeObservation + +abstract type AbstractRelativeMinimize <: RelativeObservation end +abstract type AbstractManifoldMinimize <: RelativeObservation end + +const InferenceVariable = VariableStateType{Any} +const InferenceType = AbstractPackedFactorObservation + +const PackedSamplableBelief = PackedBelief + ## ================================================================================ ## Deprecated in v0.27 ##================================================================================= @@ -430,7 +452,7 @@ function getFactorOperationalMemoryType(dfg::AbstractDFG) return getFactorOperationalMemoryType(getSolverParams(dfg)) end -function typeModuleName(variableType::InferenceVariable) +function typeModuleName(variableType::VariableStateType) Base.depwarn("typeModuleName is obsolete", :typeModuleName) io = IOBuffer() ioc = IOContext(io, :module => DistributedFactorGraphs) @@ -438,7 +460,7 @@ function typeModuleName(variableType::InferenceVariable) return String(take!(io)) end -typeModuleName(varT::Type{<:InferenceVariable}) = typeModuleName(varT()) +typeModuleName(varT::Type{<:VariableStateType}) = typeModuleName(varT()) ## ================================================================================ ## Deprecated in v0.25 diff --git a/src/DistributedFactorGraphs.jl b/src/DistributedFactorGraphs.jl index f90a1a73..160b5221 100644 --- a/src/DistributedFactorGraphs.jl +++ b/src/DistributedFactorGraphs.jl @@ -171,7 +171,7 @@ export listTags, mergeTags!, removeTags!, emptyTags! # Variable ##------------------------------------------------------------------------------ # Abstract Variable Data -export InferenceVariable +export VariableStateType # accessors export getSolverDataDict, setSolverData! @@ -257,7 +257,7 @@ export @format_str # exported from FileIO ##------------------------------------------------------------------------------ # Factor Data export AbstractFactorObservation, AbstractPackedFactorObservation -export AbstractPrior, AbstractRelative, AbstractRelativeMinimize, AbstractManifoldMinimize +export PriorObservation, RelativeObservation export FactorSolverCache # accessors diff --git a/src/entities/DFGFactor.jl b/src/entities/DFGFactor.jl index 009d8bc3..cfd2da48 100644 --- a/src/entities/DFGFactor.jl +++ b/src/entities/DFGFactor.jl @@ -5,11 +5,9 @@ abstract type AbstractPackedFactorObservation end abstract type AbstractFactorObservation end -abstract type AbstractPrior <: AbstractFactorObservation end -abstract type AbstractRelative <: AbstractFactorObservation end -abstract type AbstractRelativeMinimize <: AbstractRelative end -abstract type AbstractManifoldMinimize <: AbstractRelative end - +abstract type PriorObservation <: AbstractFactorObservation end +abstract type RelativeObservation <: AbstractFactorObservation end +abstract type PackedObservation <: AbstractFactorObservation end # NOTE DF, Convolution is IIF idea, but DFG should know about "FactorSolverCache" # DF, IIF.CommonConvWrapper <: FactorSolverCache # # NOTE was `<: Function` as unnecessary @@ -129,16 +127,6 @@ end FactorDFG(f::FactorDFG) = f -# TODO consolidate to just one type -""" -$(TYPEDEF) -Abstract parent type for all InferenceTypes, which are the -observation functions inside of factors. -""" -abstract type InferenceType <: AbstractPackedFactorObservation end - -#TODO deprecate InferenceType in favor of AbstractPackedFactorObservation v0.26 - # Packed Factor constructor function assembleFactorName(xisyms::Union{Vector{String}, Vector{Symbol}}) return Symbol(xisyms..., "_f", randstring(4)) diff --git a/src/entities/DFGVariable.jl b/src/entities/DFGVariable.jl index eb0ba645..37405a60 100644 --- a/src/entities/DFGVariable.jl +++ b/src/entities/DFGVariable.jl @@ -2,7 +2,7 @@ ## Abstract Types ##============================================================================== -abstract type InferenceVariable end +abstract type VariableStateType{N} end ##============================================================================== ## VariableState @@ -19,7 +19,7 @@ N: Manifold dimension. Fields: $(TYPEDFIELDS) """ -Base.@kwdef mutable struct VariableState{T <: InferenceVariable, P, N} +Base.@kwdef mutable struct VariableState{T <: VariableStateType, P, N} """ Globally unique identifier. """ @@ -82,10 +82,10 @@ end ##------------------------------------------------------------------------------ ## Constructors -function VariableState{T}(; kwargs...) where {T <: InferenceVariable} +function VariableState{T}(; kwargs...) where {T <: VariableStateType} return VariableState{T, getPointType(T), getDimension(T)}(; kwargs...) end -function VariableState(variableType::InferenceVariable; kwargs...) +function VariableState(variableType::VariableStateType; kwargs...) return VariableState{typeof(variableType)}(; kwargs...) end @@ -283,7 +283,7 @@ Complete variable structure for a DistributedFactorGraph variable. Fields: $(TYPEDFIELDS) """ -Base.@kwdef struct VariableCompute{T <: InferenceVariable, P, N} <: AbstractDFGVariable +Base.@kwdef struct VariableCompute{T <: VariableStateType, P, N} <: AbstractDFGVariable """The ID for the variable""" id::Union{UUID, Nothing} = nothing """Variable label, e.g. :x1. @@ -325,7 +325,7 @@ The default VariableCompute constructor. """ function VariableCompute( label::Symbol, - T::Type{<:InferenceVariable}; + T::Type{<:VariableStateType}; timestamp::ZonedDateTime = now(localzone()), solvable::Union{Int, Base.RefValue{Int}} = Ref(1), kwargs..., @@ -337,7 +337,7 @@ function VariableCompute( return VariableCompute{T, P, N}(; label, timestamp, solvable, kwargs...) end -function VariableCompute(label::Symbol, variableType::InferenceVariable; kwargs...) +function VariableCompute(label::Symbol, variableType::VariableStateType; kwargs...) return VariableCompute(label, typeof(variableType); kwargs...) end diff --git a/src/services/AbstractDFG.jl b/src/services/AbstractDFG.jl index 6270e82d..8f6d9468 100644 --- a/src/services/AbstractDFG.jl +++ b/src/services/AbstractDFG.jl @@ -601,7 +601,7 @@ end # to be consolidated, see #612 function listVariables( dfg::AbstractDFG, - typeFilter::Type{<:InferenceVariable}; + typeFilter::Type{<:VariableStateType}; tags::Vector{Symbol} = Symbol[], solvable::Int = 0, ) @@ -667,7 +667,7 @@ end function listSolveKeys( dfg::AbstractDFG, - filterVariables::Union{Type{<:InferenceVariable}, Regex, Nothing} = nothing; + filterVariables::Union{Type{<:VariableStateType}, Regex, Nothing} = nothing; filterSolveKeys::Union{Regex, Nothing} = nothing, tags::Vector{Symbol} = Symbol[], solvable::Int = 0, @@ -747,7 +747,7 @@ end ## list by types ##-------------- -function ls(dfg::G, ::Type{T}) where {G <: AbstractDFG, T <: InferenceVariable} +function ls(dfg::G, ::Type{T}) where {G <: AbstractDFG, T <: VariableStateType} xx = getVariables(dfg) mask = getVariableType.(xx) .|> typeof .== T vxx = view(xx, mask) diff --git a/src/services/CompareUtils.jl b/src/services/CompareUtils.jl index 62ad8349..276aa132 100644 --- a/src/services/CompareUtils.jl +++ b/src/services/CompareUtils.jl @@ -6,11 +6,11 @@ import Base.== # Reference https://github.com/JuliaLang/julia/issues/4648 #= -For now abstract `InferenceVariable`s are considered equal if they are the same type, dims, and manifolds (abels are deprecated) +For now abstract `VariableStateType`s are considered equal if they are the same type, dims, and manifolds (abels are deprecated) If your implentation has aditional properties such as `DynPose2` with `ut::Int64` (microsecond time) or support different manifolds implement compare if needed. =# -# ==(a::InferenceVariable,b::InferenceVariable) = typeof(a) == typeof(b) && a.dims == b.dims && a.manifolds == b.manifolds +# ==(a::VariableStateType,b::VariableStateType) = typeof(a) == typeof(b) && a.dims == b.dims && a.manifolds == b.manifolds ==(a::FactorSolverCache, b::FactorSolverCache) = typeof(a) == typeof(b) diff --git a/src/services/DFGFactor.jl b/src/services/DFGFactor.jl index 1d5abd51..f23ea2b6 100644 --- a/src/services/DFGFactor.jl +++ b/src/services/DFGFactor.jl @@ -102,31 +102,31 @@ using RoME @assert RoME.PriorPose2 == DFG._getPriorType(Pose2) ``` """ -function _getPriorType(_type::Type{<:InferenceVariable}) +function _getPriorType(_type::Type{<:VariableStateType}) return getfield(_type.name.module, Symbol(:Prior, _type.name.name)) end ##============================================================================== ## Default Factors Function Macro ##============================================================================== -export PackedSamplableBelief +export PackedBelief function pack end function unpack end function packDistribution end function unpackDistribution end -abstract type PackedSamplableBelief end -StructTypes.StructType(::Type{<:PackedSamplableBelief}) = StructTypes.UnorderedStruct() +abstract type PackedBelief end +StructTypes.StructType(::Type{<:PackedBelief}) = StructTypes.UnorderedStruct() #TODO remove, rather use StructTypes.jl properly -function Base.convert(::Type{<:PackedSamplableBelief}, nt::Union{NamedTuple, JSON3.Object}) +function Base.convert(::Type{<:PackedBelief}, nt::Union{NamedTuple, JSON3.Object}) distrType = getTypeFromSerializationModule(nt._type) return distrType(; nt...) end """ - @defFactorType StructName factortype<:AbstractFactorObservation manifolds<:AbstractManifold + @defObservationType StructName factortype<:AbstractFactorObservation manifolds<:AbstractManifold A macro to create a new factor function with name `StructName` and manifold. Note that the `manifold` is an object and *must* be a subtype of `ManifoldsBase.AbstractManifold`. @@ -134,19 +134,19 @@ See documentation in [Manifolds.jl on making your own](https://juliamanifolds.gi Example: ``` -DFG.@defFactorType Pose2Pose2 AbstractManifoldMinimize SpecialEuclidean(2) +DFG.@defObservationType Pose2Pose2 RelativeObservation SpecialEuclidean(2) ``` """ -macro defFactorType(structname, factortype, manifold) +macro defObservationType(structname, factortype, manifold) packedstructname = Symbol("Packed", structname) return esc( quote # user manifold must be a <:Manifold - @assert ($manifold isa AbstractManifold) "@defFactorType manifold (" * + @assert ($manifold isa AbstractManifold) "@defObservationType manifold (" * string($manifold) * ") is not an `AbstractManifold`" - @assert ($factortype <: AbstractFactorObservation) "@defFactorType factortype (" * + @assert ($factortype <: AbstractFactorObservation) "@defObservationType factortype (" * string($factortype) * ") is not an `AbstractFactorObservation`" @@ -154,9 +154,9 @@ macro defFactorType(structname, factortype, manifold) Z::T end - #TODO should this be $packedstructname{T <: PackedSamplableBelief} + #TODO should this be $packedstructname{T <: PackedBelief} Base.@__doc__ struct $packedstructname <: AbstractPackedFactorObservation - Z::PackedSamplableBelief + Z::PackedBelief end # $structname(; Z) = $structname(Z) @@ -275,11 +275,11 @@ function isPrior(dfg::AbstractDFG, fc::Symbol) return isPrior(getFactorType(fco)) end -function isPrior(::AbstractPrior) +function isPrior(::PriorObservation) return true end -function isPrior(::AbstractRelative) +function isPrior(::RelativeObservation) return false end diff --git a/src/services/DFGVariable.jl b/src/services/DFGVariable.jl index 7a1fe9f5..639c7a5d 100644 --- a/src/services/DFGVariable.jl +++ b/src/services/DFGVariable.jl @@ -45,7 +45,7 @@ getLastUpdatedTimestamp(est::AbstractPointParametricEst) = est.lastUpdatedTimest 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}`. +- API Quirk in that this function returns and instance of `::T` not a `::Type{<:VariableStateType}`. DevWork - TODO, see IncrementalInference.jl 1228 @@ -65,12 +65,12 @@ getVariableType(::VariableState{T}) where {T} = T() getVariableType(dfg::AbstractDFG, lbl::Symbol) = getVariableType(getVariable(dfg, lbl)) ##------------------------------------------------------------------------------ -## InferenceVariable +## VariableStateType ##------------------------------------------------------------------------------ # """ # $SIGNATURES -# Interface function to return the `variableType` manifolds of an InferenceVariable, extend this function for all Types<:InferenceVariable. +# Interface function to return the `variableType` manifolds of an VariableStateType, extend this function for all Types<:VariableStateType. # """ # function getManifolds end @@ -78,21 +78,27 @@ getVariableType(dfg::AbstractDFG, lbl::Symbol) = getVariableType(getVariable(dfg # getManifolds(::T) where {T <: ManifoldsBase.AbstractManifold} = getManifolds(T) """ - @defVariable StructName manifolds<:ManifoldsBase.AbstractManifold + @defVarstateType StructName manifold point_identity -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](https://juliamanifolds.github.io/Manifolds.jl/stable/examples/manifold.html). +A macro to create a new variable type with name `StructName` associated with a given manifold and identity point. + +- `StructName` is the name of the new variable type, which will be defined as a subtype of `VariableStateType`. +- `manifold` is an object that must be a subtype of `ManifoldsBase.AbstractManifold`. +- `point_identity` is the identity point on the manifold, used as a reference for operations. + +This macro is useful for defining variable types that are not parameterized by dimension, and for associating them with a specific manifold and identity point. + +See the [Manifolds.jl documentation on creating your own manifolds](https://juliamanifolds.github.io/Manifolds.jl/stable/examples/manifold.html) for more information. Example: ``` DFG.@defVariable Pose2 SpecialEuclidean(2) ArrayPartition([0;0.0],[1 0; 0 1.0]) ``` """ -macro defVariable(structname, manifold, point_identity) +macro defVarstateType(structname, manifold, point_identity) return esc( quote - Base.@__doc__ struct $structname <: InferenceVariable end + Base.@__doc__ struct $structname <: VariableStateType{Any} end # user manifold must be a <:Manifold @assert ($manifold isa AbstractManifold) "@defVariable of " * @@ -110,50 +116,87 @@ macro defVariable(structname, manifold, point_identity) ) end +macro defVariable(args...) + return esc(:(DFG.@defVarstateType $(args...))) +end + +""" + @defVarstateTypeN StructName manifold point_identity + +A macro to create a new variable type with name `StructName` that is parameterized by `N` and associated with a given manifold and identity point. + +- `StructName` is the name of the new variable type, which will be defined as a subtype of `VariableStateType{N}`. +- `manifold` is an object that must be a subtype of `ManifoldsBase.AbstractManifold`. +- `point_identity` is the identity point on the manifold, used as a reference for operations. + +This macro is useful for defining variable types that are parameterized by dimension or other type parameters (e.g., `Pose{N}`), and for associating them with a specific manifold and identity point. + +See the [Manifolds.jl documentation on creating your own manifolds](https://juliamanifolds.github.io/Manifolds.jl/stable/examples/manifold.html) for more information. + +Example: +``` +DFG.@defVarstateTypeN Pose{N} SpecialEuclidean(N) ArrayPartition(zeros(SVector{N, Float64}), SMatrix{N, N, Float64}(I)) +``` +""" +macro defVarstateTypeN(structname, manifold, point_identity) + return esc( + quote + Base.@__doc__ struct $structname <: VariableStateType{N} end + + DFG.getManifold(::Type{$structname}) where {N} = $manifold + + DFG.getPointType(::Type{$structname}) where {N} = typeof($point_identity) + + DFG.getPointIdentity(::Type{$structname}) where {N} = $point_identity + end, + ) +end + function Base.convert( ::Type{<:AbstractManifold}, ::Union{<:T, Type{<:T}}, -) where {T <: InferenceVariable} +) where {T <: VariableStateType} return getManifold(T) end """ $SIGNATURES -Interface function to return the `<:ManifoldsBase.AbstractManifold` object of `variableType<:InferenceVariable`. +Interface function to return the `<:ManifoldsBase.AbstractManifold` object of `variableType<:VariableStateType`. """ -getManifold(::T) where {T <: InferenceVariable} = getManifold(T) +getManifold(::T) where {T <: VariableStateType} = getManifold(T) getManifold(vari::VariableCompute) = getVariableType(vari) |> getManifold -# covers both <:InferenceVariable and <:AbstractFactorObservation +getManifold(state::VariableState) = getVariableType(state) |> getManifold +# covers both <:VariableStateType and <:AbstractFactorObservation getManifold(dfg::AbstractDFG, lbl::Symbol) = getManifold(dfg[lbl]) """ $SIGNATURES -Interface function to return the `variableType` dimension of an InferenceVariable, extend this function for all Types<:InferenceVariable. +Interface function to return the `variableType` dimension of an VariableStateType, extend this function for all Types<:VariableStateType. """ function getDimension end -getDimension(::Type{T}) where {T <: InferenceVariable} = manifold_dimension(getManifold(T)) -getDimension(::T) where {T <: InferenceVariable} = manifold_dimension(getManifold(T)) +getDimension(::Type{T}) where {T <: VariableStateType} = manifold_dimension(getManifold(T)) +getDimension(::T) where {T <: VariableStateType} = manifold_dimension(getManifold(T)) getDimension(M::ManifoldsBase.AbstractManifold) = manifold_dimension(M) getDimension(p::Distributions.Distribution) = length(p) getDimension(var::VariableCompute) = getDimension(getVariableType(var)) """ $SIGNATURES -Interface function to return the manifold point type of an InferenceVariable, extend this function for all Types<:InferenceVariable. +Interface function to return the manifold point type of an VariableStateType, extend this function for all Types<:VariableStateType. """ function getPointType end -getPointType(::T) where {T <: InferenceVariable} = getPointType(T) +getPointType(::T) where {T <: VariableStateType} = getPointType(T) """ $SIGNATURES -Interface function to return the user provided identity point for this InferenceVariable manifold, extend this function for all Types<:InferenceVariable. +Interface function to return the user provided identity point for this VariableStateType manifold, extend this function for all Types<:VariableStateType. Notes - Used in transition period for Serialization. This function will likely be changed or deprecated entirely. """ function getPointIdentity end -getPointIdentity(::T) where {T <: InferenceVariable} = getPointIdentity(T) +getPointIdentity(::T) where {T <: VariableStateType} = getPointIdentity(T) """ $SIGNATURES @@ -173,7 +216,7 @@ function getPoint( ::Type{T}, v::AbstractVector, basis = ManifoldsBase.DefaultOrthogonalBasis(), -) where {T <: InferenceVariable} +) where {T <: VariableStateType} M = getManifold(T) p0 = getPointIdentity(T) X = ManifoldsBase.get_vector(M, p0, v, basis) @@ -197,7 +240,7 @@ function getCoordinates( ::Type{T}, p, basis = ManifoldsBase.DefaultOrthogonalBasis(), -) where {T <: InferenceVariable} +) where {T <: VariableStateType} M = getManifold(T) p0 = getPointIdentity(T) X = ManifoldsBase.log(M, p0, p) diff --git a/src/services/Serialization.jl b/src/services/Serialization.jl index 3cf3723c..4716b4ba 100644 --- a/src/services/Serialization.jl +++ b/src/services/Serialization.jl @@ -28,7 +28,7 @@ function _versionCheck(node::Union{<:VariableDFG, <:FactorDFG}) end end -function stringVariableType(varT::InferenceVariable) +function stringVariableType(varT::VariableStateType) T = typeof(varT) #FIXME maybe don't use .parameters Tparams = T.parameters @@ -123,7 +123,7 @@ function getTypeFromSerializationModule(_typeString::AbstractString) end # returns a PackedVariableState -function packVariableState(d::VariableState{T}) where {T <: InferenceVariable} +function packVariableState(d::VariableState{T}) where {T <: VariableStateType} @debug "Dispatching conversion variable -> packed variable for type $(string(getVariableType(d)))" castval = if 0 < length(d.val) precast = getCoordinates.(T, d.val) @@ -170,7 +170,7 @@ function unpackVariableState(d::PackedVariableState) ststring = string(split(d.variableType, "(")[1]) T = parseVariableType(ststring) isnothing(T) && error( - "The variable doesn't seem to have a variableType. It needs to set up with an InferenceVariable from IIF. This will happen if you use DFG to add serialized variables directly and try use them. Please use IncrementalInference.addVariable().", + "The variable doesn't seem to have a variableType. It needs to set up with an VariableStateType from IIF. This will happen if you use DFG to add serialized variables directly and try use them. Please use IncrementalInference.addVariable().", ) r3 = d.dimval diff --git a/test/plottingTest.jl b/test/plottingTest.jl index 220f9c06..72a5430e 100644 --- a/test/plottingTest.jl +++ b/test/plottingTest.jl @@ -6,7 +6,7 @@ using Manifolds ## -# struct TestInferenceVariable1 <: InferenceVariable end +# struct TestInferenceVariable1 <: VariableStateType end @defVariable TestInferenceVariable1 Euclidean(1) [0.0;] # Now make a complex graph for connectivity tests diff --git a/test/testBlocks.jl b/test/testBlocks.jl index 7a3696a9..971633af 100644 --- a/test/testBlocks.jl +++ b/test/testBlocks.jl @@ -8,8 +8,8 @@ using DistributedFactorGraphs: LabelExistsError, LabelNotFoundError import Base: convert # import DistributedFactorGraphs: getData, addData!, updateData!, deleteData! -# Test InferenceVariable Types -# struct TestVariableType1 <: InferenceVariable +# Test VariableStateType Types +# struct TestVariableType1 <: VariableStateType # dims::Int # manifolds::Tuple{Symbol} # TestVariableType1() = new(1,(:Euclid,)) @@ -21,7 +21,7 @@ Base.convert(::Type{<:Tuple}, ::typeof(Euclidean(2))) = (:Euclid, :Euclid) @defVariable TestVariableType1 Euclidean(1) [0.0;] @defVariable TestVariableType2 Euclidean(2) [0; 0.0] -# struct TestVariableType2 <: InferenceVariable +# struct TestVariableType2 <: VariableStateType # dims::Int # manifolds::Tuple{Symbol, Symbol} # TestVariableType2() = new(2,(:Euclid,:Circular,)) @@ -30,9 +30,9 @@ Base.convert(::Type{<:Tuple}, ::typeof(Euclidean(2))) = (:Euclid, :Euclid) struct TestFunctorInferenceType1 <: AbstractRelative end struct TestFunctorInferenceType2 <: AbstractRelative end -struct TestAbstractPrior <: AbstractPrior end +struct TestAbstractPrior <: PriorObservation end # struct TestAbstractRelativeFactor <: AbstractRelativeRoots end -struct TestAbstractRelativeFactorMinimize <: AbstractRelativeMinimize end +struct TestAbstractRelativeFactorMinimize <: RelativeObservation end Base.@kwdef struct PackedTestFunctorInferenceType1 <: AbstractPackedFactorObservation s::String = "" @@ -129,8 +129,8 @@ end # T = testDFGAPI #test Specific definitions -# struct TestInferenceVariable1 <: InferenceVariable end -# struct TestInferenceVariable2 <: InferenceVariable end +# struct TestInferenceVariable1 <: VariableStateType end +# struct TestInferenceVariable2 <: VariableStateType end # struct TestFunctorInferenceType1 <: AbstractFactorObservation end # NOTE see note in AbstractDFG.jl setSolverParams!