Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 12 additions & 4 deletions cpp_ms_glmb_ukf/src/run_filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -404,13 +404,21 @@ class MSGLMB {
if (update_hypcmp_tmp(ivec, 0) < 0) { // check death target in only one sensor
off_vec.push_back(ivec);
stemp += avqs(tindices(ivec));
} else if (update_hypcmp_tmp(ivec, 0) == 0) {
not_off_vec.push_back(ivec);
stemp += avps(tindices(ivec));
} else { // >0
} else {
not_off_vec.push_back(ivec);
stemp += avps(tindices(ivec));
}
}
// Restore from Gibbs indices to measurement indices
for (int s = 0; s < mModel.N_sensors; s++) {
for (int i : not_off_vec) {
if (update_hypcmp_tmp(i, s) > 0) {
update_hypcmp_tmp(i, s) = mindices[s](update_hypcmp_tmp(i, s));
}
}
}

for (int ivec = 0; ivec < update_hypcmp_tmp.rows(); ivec++) {
for (int s = 0; s < update_hypcmp_tmp.cols(); s++) {
int mIndex = update_hypcmp_tmp(ivec, s); // measurement index
if (mIndex > 0) {
Expand Down
5 changes: 5 additions & 0 deletions ms_glmb_ukf/run_filter.py
Original file line number Diff line number Diff line change
Expand Up @@ -343,6 +343,11 @@ def msjointpredictupdate(self, model, filter, meas, k):
for hidx in range(len(uasses)):
update_hypcmp_tmp = uasses[hidx]
off_idx = update_hypcmp_tmp[:, 0] < 0

# Restore from Gibbs indices to measurement indices
for s in range(model.N_sensors):
update_hypcmp_tmp[~off_idx, s] = mindices[s][update_hypcmp_tmp[~off_idx, s]]

aug_idx = np.column_stack((tindices, update_hypcmp_tmp)) # [tindices, 1 + update_hypcmp_tmp]
mis_idx = update_hypcmp_tmp == 0
det_idx = update_hypcmp_tmp > 0
Expand Down