Skip to content

Commit

Permalink
Merge pull request #254 from JuliaRobotics/hotfix/1Q20/mmp2constr
Browse files Browse the repository at this point in the history
revert to proper mpp constructor
  • Loading branch information
dehann authored Mar 9, 2020
2 parents c12c43d + f8e2b76 commit 0424b5f
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/factors/MutablePose2Pose2.jl
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Specialized Pose2Pose2 factor type (Gaussian), which allows for rapid accumulati
mutable struct MutablePose2Pose2Gaussian <: IIF.FunctorPairwise
Zij::MvNormal
timestamp::DateTime
MutablePose2Pose2Gaussian(zdir=nothing;Zij::MvNormal=MvNormal(zeros(3),Matrix(Diagonal([0.01; 0.01; 0.001].^2))), timestamp::DateTime=now()) = new(zdir == nothing ? Zij : zdir, timestamp)
MutablePose2Pose2Gaussian(Zij::MvNormal=MvNormal(zeros(3),Matrix(Diagonal([0.01; 0.01; 0.001].^2))), timestamp::DateTime=now()) = new(Zij, timestamp)
end
function getSample(fct::MutablePose2Pose2Gaussian, N::Int=100)
return (rand(fct.Zij, N), )
Expand Down Expand Up @@ -56,7 +56,7 @@ mutable struct PackedMutablePose2Pose2Gaussian <: IIF.PackedInferenceType
PackedMutablePose2Pose2Gaussian(x::String, ts::Int=datetime2unix(now())*1e3 |> Int) = new(x, ts)
end
function convert(::Type{MutablePose2Pose2Gaussian}, d::PackedMutablePose2Pose2Gaussian)
return MutablePose2Pose2Gaussian(Zij=extractdistribution(d.datastr), timestamp=unix2datetime(d.timestamp*1e-3))
return MutablePose2Pose2Gaussian(extractdistribution(d.datastr), timestamp=unix2datetime(d.timestamp*1e-3))
end
function convert(::Type{PackedMutablePose2Pose2Gaussian}, d::MutablePose2Pose2Gaussian)
return PackedMutablePose2Pose2Gaussian(string(d.Zij), datetime2unix(d.timestamp)*1e3 |> Int)
Expand Down
2 changes: 1 addition & 1 deletion test/testDeadReckoningTether.jl
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ addFactor!(fg, [:x0; :l1], p2br )

addVariable!(fg, :deadreckon_x0, Pose2, solvable=0)

drec = MutablePose2Pose2Gaussian(Zij=MvNormal(zeros(3), Matrix{Float64}(LinearAlgebra.I, 3,3)))
drec = MutablePose2Pose2Gaussian(MvNormal(zeros(3), Matrix{Float64}(LinearAlgebra.I, 3,3)))

addFactor!(fg, [:x0; :deadreckon_x0], drec, solvable=0)

Expand Down
2 changes: 1 addition & 1 deletion test/testDeltaOdo.jl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ DX = extractDeltaOdo(XX, YY, TH)
## Test accumulation function from OdometryUtils.jl


mpp = MutablePose2Pose2Gaussian(Zij=MvNormal([XX[1];YY[1];TH[1]], 1e-3*Matrix(LinearAlgebra.I, 3,3)))
mpp = MutablePose2Pose2Gaussian(MvNormal([XX[1];YY[1];TH[1]], 1e-3*Matrix(LinearAlgebra.I, 3,3)))
dt = 1.0
nXYT = zeros(3,size(DX,2))
Qc = 1e-6*Matrix(LinearAlgebra.I, 3,3)
Expand Down

0 comments on commit 0424b5f

Please sign in to comment.