Skip to content

Commit 5b8e3da

Browse files
committed
keep solve, refac testDERelative
1 parent 50ce223 commit 5b8e3da

1 file changed

Lines changed: 20 additions & 7 deletions

File tree

IncrementalInference/test/testDERelative.jl

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,21 +46,26 @@ doautoinit!(fg, :x0)
4646

4747
prev = :x0
4848

49+
# chnl = Channel(100)
50+
4951
for i in 1:3
5052

5153
nextSym = Symbol("x$i")
5254

5355
# another point in the trajectory 5 seconds later
5456
addVariable!(fg, nextSym, Position{1}, timestamp=DateTime(2000,1,1,0,0,5*i))
5557
# build factor against manifold Manifolds.TranslationGroup(1)
56-
ode_fac = IIF.DERelative(fg, [prev; nextSym],
57-
Position{1},
58-
firstOrder!,
59-
tstForce,
60-
dt=0.05,
61-
problemType=ODEProblem )
58+
ode_fac = IIF.DERelative(
59+
fg, [prev; nextSym],
60+
Position{1},
61+
firstOrder!,
62+
tstForce,
63+
dt=0.05,
64+
problemType=ODEProblem,
65+
keepSolution = i == 1,
66+
)
6267
#
63-
addFactor!( fg, [prev;nextSym], ode_fac, graphinit=false )
68+
addFactor!( fg, [prev;nextSym], ode_fac, graphinit=false, keepCalcFactor = i == 1 )
6469
initVariable!(fg, nextSym, [0.1*randn(1) for _ in 1:100])
6570

6671
prev = nextSym
@@ -77,6 +82,10 @@ oder_ = DERelative( fg, [:x0; :x3],
7782
dt=0.05,
7883
problemType=ODEProblem )
7984

85+
86+
87+
##
88+
8089
oder_.forwardProblem.u0 .= [1.0]
8190
sl = DifferentialEquations.solve(oder_.forwardProblem)
8291

@@ -210,6 +219,10 @@ X2_,_ = propagateBelief(fg, :x2, :)
210219

211220
smtasks = Task[]
212221
tree = solveTree!(fg; smtasks, recordcliqs=ls(fg));
222+
223+
oder_.keepSolution
224+
225+
213226
hists = fetchCliqHistoryAll!(smtasks)
214227

215228
printCSMHistoryLogical(hists)

0 commit comments

Comments
 (0)