Skip to content

Commit 0b0fd15

Browse files
committed
fixes, wip
1 parent 74ec687 commit 0b0fd15

File tree

3 files changed

+22
-10
lines changed

3 files changed

+22
-10
lines changed

examples/marine/asv/rex/RExFeed_Bag.jl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ rostypegen()
4646
# No using needed because we're specifying by full name.
4747
# using .sensor_msgs.msg
4848
# using .seagrant_msgs.msg
49-
49+
5050
## Load Caesar mmisam stuff
5151
using Caesar
5252
using RoME
@@ -246,7 +246,7 @@ function main(;iters::Integer=50)
246246

247247
init_node("rex_feed")
248248
# find the bagfile
249-
bagfile = joinpath(ENV["HOME"],"data","Marine","lidar_radar.bag")
249+
bagfile = joinpath(ENV["HOME"],"data","Marine","basin_radar.bag") # lidar_radar.bag
250250
bagSubscriber = RosbagSubscriber(bagfile)
251251

252252
# Initialization
@@ -296,7 +296,9 @@ end
296296
##
297297

298298

299-
main(iters=300) # 275
299+
main(iters=100)
300+
301+
# 275
300302

301303

302304
## after the graph is saved it can be loaded and the datastores retrieved

examples/marine/asv/rex/dev/ScatterSensitivityAnalysis.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ Caesar.plotScatterAlign(sap_, bw=0.001)
1818
##
1919

2020
# snt_ = deepcopy(snt)
21-
snt = overlayScatterMutate(sap_; offsetTrans=[-20.0;+100], sample_count=200, bw=1e-4, user_coords=[0;-50;0.]) #, user_coords=snt_.best_coords)
21+
snt = overlayScatterMutate(sap_; user_offset=[-20.0;+100; pi/4], sample_count=200, bw=1e-4, user_coords=[0;-50;0.]) #, user_coords=snt_.best_coords)
2222
plotScatterAlign(snt)
2323

2424

@@ -27,10 +27,10 @@ plotScatterAlign(snt)
2727
## sensitivity sweep on bw
2828

2929

30-
SNT_08 = [[overlayScatterMutate(sap_; offsetTrans=[-20.0;+100], sample_count=150, bw) for i in 1:100] for bw in exp10.(-6:1:-1)];
30+
SNT_10 = [[overlayScatterMutate(sap_; user_offset=[-20.0;+20;pi/4], sample_count=100, bw) for i in 1:200] for bw in exp10.(-6:1:-1)];
3131

32-
mkdir("/tmp/caesar/rex/SNT_08")
33-
@save "/tmp/caesar/rex/SNT_08/SNT_08.jld2" SNT_08
32+
mkdir("/tmp/caesar/rex/SNT_10")
33+
@save "/tmp/caesar/rex/SNT_10/SNT_10.jld2" SNT_10
3434

3535
## histogram sensitivities
3636

src/images/ScatterAlignPose2.jl

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -133,10 +133,10 @@ Notes:
133133
- `tf` is a Manifolds.jl type `::ProductRepr` (or newer `::ArrayPartition`) to represent a `SpecialEuclidean(2)` manifold point.
134134
"""
135135
function overlayScatter(sap::ScatterAlignPose2,
136-
trans::AbstractVector{<:Real}=SA[0;0.0],
136+
trans::AbstractVector{<:Real}=[0;0.0],
137137
rot::Real=0.0;
138138
user_coords = [trans; rot],
139-
offsetTrans::AbstractVector{<:Real}=SA[0;0.0],
139+
offsetTrans::AbstractVector{<:Real}=[0;0.0],
140140
user_offset = [offsetTrans;0.0],
141141
score=Ref(0.0),
142142
sample_count::Integer=sap.sample_count,
@@ -158,8 +158,18 @@ function overlayScatter(sap::ScatterAlignPose2,
158158
# not efficient, but okay for here
159159
pTq(xyr=user_coords) = exp(M, e0, hat(M, e0, xyr))
160160

161+
161162
R0 = e0.parts[2]
162-
_pts2_ = map(pt->ProductRepr(pt, R0), pts2_)
163+
_pts2_nt = map(pt->ProductRepr(pt, R0), pts2_)
164+
165+
# add user_offset
166+
uo = exp(M, e0, hat(M, e0, user_offset))
167+
_pts2_ = map(pt->Manifolds.compose(M, uo, pt), _pts2_nt)
168+
for (i,pt) in enumerate(_pts2_)
169+
pt.parts[2] .= R0
170+
# overwrite original for updated return values
171+
pts2_[i] .= pt.parts[1]
172+
end
163173

164174
# take p as reference identity
165175
pts2T_ = map(pt->Manifolds.compose(M, pTq(), pt).parts[1], _pts2_)

0 commit comments

Comments
 (0)