Skip to content

Commit

Permalink
feat: Small cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Rayman committed Nov 11, 2021
1 parent 9d3decd commit 978b50c
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions ruvu_mcl/src/particle_filter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

#include "./particle_filter.hpp"

#include "algorithm"
#include <algorithm>
#include <string>

#include "ros/console.h"
#include "string"
#include "tf2/utils.h"

constexpr auto name = "particle_filter";

void ParticleFilter::normalize_weights()
{
double total_weight = 0;
Expand All @@ -26,7 +29,8 @@ void ParticleFilter::normalize_weights(double total_weight)
// total_weight could be 0 due to very strange data input. We should print an error and
// continue. If total_weight is negative or NaN, there is a bigger problem.
assert(total_weight == 0);
ROS_ERROR(
ROS_ERROR_NAMED(
name,
"Total weight of particles is 0. This probably means there is a bug in one of the sensor "
"models or they are configured incorrectly. Resetting particles to uniform weight "
"distribution");
Expand Down

0 comments on commit 978b50c

Please sign in to comment.