Skip to content

Commit

Permalink
fix(dynamic_avoidance): fix bug of emplacing existing object (autowar…
Browse files Browse the repository at this point in the history
…efoundation#4384)

Signed-off-by: Takayuki Murooka <[email protected]>
  • Loading branch information
takayuki5168 authored Jul 25, 2023
1 parent 36fecf2 commit dfd0ee7
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -198,7 +198,11 @@ class DynamicAvoidanceModule : public SceneModuleInterface
}
void update(const std::string & uuid, const double new_variable)
{
variable_.emplace(uuid, new_variable);
if (variable_.count(uuid) != 0) {
variable_.at(uuid) = new_variable;
} else {
variable_.emplace(uuid, new_variable);
}
}

std::unordered_map<std::string, double> variable_;
Expand Down

0 comments on commit dfd0ee7

Please sign in to comment.