Skip to content

Commit 4c04074

Browse files
authored
Merge pull request #1782 from JuliaRobotics/23Q4/hack/1781
workaround hack for #1781
2 parents d2963ac + 9d6c581 commit 4c04074

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

src/entities/CalcFactor.jl

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,4 +120,13 @@ _nvars(::CalcFactorResidual{FT, C, D, L, P, MEAS, N}) where {FT, C, D, L, P, MEA
120120
# _typeof_meas(::CalcFactorManopt{FT, C, D, L, MEAS, N}) where {FT, C, D, L, MEAS, N} = MEAS
121121
DFG.getDimension(::CalcFactorResidual{FT, C, D, L, P, MEAS, N}) where {FT, C, D, L, P, MEAS, N} = D
122122

123-
123+
# workaround for issue #1781
124+
import Base: getproperty
125+
function Base.getproperty(cf::CalcFactorResidual, f::Symbol)
126+
if f === :manifold
127+
# assumes constant propagation to avoid allocations in residual functions getManifold(factor)
128+
getManifold(cf.factor)
129+
else
130+
getfield(cf, f)
131+
end
132+
end

0 commit comments

Comments
 (0)