From ac1b26c7c51e71e5d98a18fb4ad779de1b572a5f Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Tue, 14 Mar 2023 04:20:57 +0100 Subject: Fix agents with disabled avoidance getting added to avoidance simulation Fixes that agents with disabled avoidance were getting added to avoidance simulation. (cherry picked from commit 64ce93cee9eba8b700b236f22199ee2ffd755444) --- modules/navigation/nav_map.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'modules') diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index b1674c8fc5..4dcdbd6446 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -894,9 +894,9 @@ void NavMap::sync() { if (agents_dirty) { // cannot use LocalVector here as RVO library expects std::vector to build KdTree std::vector raw_agents; - raw_agents.reserve(agents.size()); - for (NavAgent *agent : agents) { - raw_agents.push_back(agent->get_agent()); + raw_agents.reserve(controlled_agents.size()); + for (NavAgent *controlled_agent : controlled_agents) { + raw_agents.push_back(controlled_agent->get_agent()); } rvo.buildAgentTree(raw_agents); } -- cgit v1.2.3