From b0179bba74623b1ae4b32858b63090af7177fdfa Mon Sep 17 00:00:00 2001 From: smix8 <52464204+smix8@users.noreply.github.com> Date: Mon, 13 Nov 2023 21:32:22 +0100 Subject: [PATCH] Fix NavigationObstacle height Fixes NavigationObstacle height. (cherry picked from commit 3f26191d167f6d5f767811d0042ceb4716bb3fec) --- modules/navigation/nav_map.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/modules/navigation/nav_map.cpp b/modules/navigation/nav_map.cpp index f447b5f1687..3ff9127fc29 100644 --- a/modules/navigation/nav_map.cpp +++ b/modules/navigation/nav_map.cpp @@ -1116,6 +1116,7 @@ void NavMap::_update_rvo_obstacles_tree_2d() { rvo_2d_vertices.reserve(_obstacle_vertices.size()); uint32_t _obstacle_avoidance_layers = obstacle->get_avoidance_layers(); + real_t _obstacle_height = obstacle->get_height(); for (const Vector3 &_obstacle_vertex : _obstacle_vertices) { rvo_2d_vertices.push_back(RVO2D::Vector2(_obstacle_vertex.x + _obstacle_position.x, _obstacle_vertex.z + _obstacle_position.z)); @@ -1126,6 +1127,7 @@ void NavMap::_update_rvo_obstacles_tree_2d() { for (size_t i = 0; i < rvo_2d_vertices.size(); i++) { RVO2D::Obstacle2D *rvo_2d_obstacle = new RVO2D::Obstacle2D(); rvo_2d_obstacle->point_ = rvo_2d_vertices[i]; + rvo_2d_obstacle->height_ = _obstacle_height; rvo_2d_obstacle->elevation_ = _obstacle_position.y; rvo_2d_obstacle->avoidance_layers_ = _obstacle_avoidance_layers;