Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int M = config_.resample_rate * samples.size(), N = samples.size();
- if(config_.resample_strategy == MWEAKEST) {
- auto cmp = [](SamplePtr a, SamplePtr b) { return a->weight() < b->weight(); };
- sort( samples.begin(), samples.end(), cmp);
- for(int i = 0, k = N - 1; i < std::min(M, N/2); i++, k--) {
- samples[i] = std::make_shared<Sample> ( *samples[k] );
- normal ( samples[i], *samples[i], config_.sigma_static_position*dt, config_.sigma_static_orientation*dt );
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement