Skip to content

Commit

Permalink
Fix double comparison
Browse files Browse the repository at this point in the history
  • Loading branch information
Victor Lopez committed Aug 20, 2019
1 parent a9a3089 commit f9bbfe7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/ddynamic_reconfigure.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ bool confCompare(const ParamType &a, const ParamType &b)
return (a.name == b.name) && (a.value == b.value);
}

template <>
bool confCompare(const dynamic_reconfigure::DoubleParameter &a, const dynamic_reconfigure::DoubleParameter &b)
{
return (a.name == b.name) && (std::fabs(a.value - b.value) < std::numeric_limits<double>::epsilon());
}

void DDynamicReconfigure::updatePublishedInformation()
{
dynamic_reconfigure::Config config_msg = generateConfig();
Expand Down

0 comments on commit f9bbfe7

Please sign in to comment.