Skip to content

Commit c360a66

Browse files
authored
Fix testDERelative timestamp (#1898)
Co-authored-by: Johannes Terblanche <Affie@users.noreply.github.com>
1 parent 823b618 commit c360a66

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

IncrementalInference/test/testDERelative.jl

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ using IncrementalInference
77
using Dates
88
using Statistics
99
using TensorCast
10+
using DistributedFactorGraphs: @tz_str
1011

1112
## plotting functions
1213

@@ -38,7 +39,7 @@ tstForce(t) = 0
3839
fg = initfg()
3940
# the starting points and "0 seconds"
4041
# `accurate_time = trunc(getDatetime(var), Second) + (1e-9*getNstime(var) % 1)`
41-
addVariable!(fg, :x0, Position{1}, timestamp=DateTime(2000,1,1,0,0,0))
42+
addVariable!(fg, :x0, Position{1}, timestamp=DFG.Timestamp(DateTime(2000,1,1,0,0,0), tz"UTC"))
4243
# pin with a simple prior
4344
addFactor!(fg, [:x0], Prior(Normal(1,0.01)))
4445

@@ -51,7 +52,7 @@ for i in 1:3
5152
nextSym = Symbol("x$i")
5253

5354
# another point in the trajectory 5 seconds later
54-
addVariable!(fg, nextSym, Position{1}, timestamp=DateTime(2000,1,1,0,0,5*i))
55+
addVariable!(fg, nextSym, Position{1}, timestamp=DFG.Timestamp(DateTime(2000,1,1,0,0,5*i), tz"UTC"))
5556
# build factor against manifold Manifolds.TranslationGroup(1)
5657
ode_fac = IIF.DERelative(
5758
fg, [prev; nextSym],
@@ -311,7 +312,7 @@ tstForce(t) = 0
311312
fg = initfg()
312313

313314
# the starting points and "0 seconds"
314-
addVariable!(fg, :x0, Position{2}, timestamp=DateTime(2000,1,1,0,0,0))
315+
addVariable!(fg, :x0, Position{2}, timestamp=DFG.Timestamp(DateTime(2000,1,1,0,0,0), tz"UTC"))
315316
# pin with a simple prior
316317
addFactor!(fg, [:x0], Prior(MvNormal([1;0],0.01*diagm(ones(2)))))
317318

@@ -326,7 +327,7 @@ for i in 1:7
326327
nextSym = Symbol("x$i")
327328

328329
# another point in the trajectory 5 seconds later
329-
addVariable!(fg, nextSym, Position{2}, timestamp=DateTime(2000,1,1,0,0,DT*i))
330+
addVariable!(fg, nextSym, Position{2}, timestamp=DFG.Timestamp(DateTime(2000,1,1,0,0,DT*i), tz"UTC"))
330331
oder = DERelative( fg, [prev; nextSym],
331332
Position{2},
332333
dampedOscillator!,
@@ -508,7 +509,7 @@ tstForce(t) = 0
508509
fg = initfg()
509510

510511
# the starting points and "0 seconds"
511-
addVariable!(fg, :x0, Position{2}, timestamp=DateTime(2000,1,1,0,0,0))
512+
addVariable!(fg, :x0, Position{2}, timestamp=DFG.Timestamp(DateTime(2000,1,1,0,0,0), tz"UTC"))
512513
# pin with a simple prior
513514
addFactor!(fg, [:x0], Prior(MvNormal([1;0],0.01*diagm(ones(2)))))
514515
doautoinit!(fg, :x0)
@@ -534,7 +535,7 @@ for i in 1:7
534535
nextSym = Symbol("x$i")
535536

536537
# another point in the trajectory 5 seconds later
537-
addVariable!(fg, nextSym, Position{2}, timestamp=DateTime(2000,1,1,0,0,DT*i))
538+
addVariable!(fg, nextSym, Position{2}, timestamp=DFG.Timestamp(DateTime(2000,1,1,0,0,DT*i), tz"UTC"))
538539
oder = DERelative( fg, [prev; nextSym; :ωβ],
539540
Position{2},
540541
dampedOscillatorParametrized!,

0 commit comments

Comments
 (0)