Skip to content

Commit

Permalink
Fix NavigationObstacle height
Browse files Browse the repository at this point in the history
Fixes NavigationObstacle height.
  • Loading branch information
smix8 committed Nov 13, 2023
1 parent 5945768 commit 3f26191
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions modules/navigation/nav_map.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,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));
Expand All @@ -1135,6 +1136,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;
Expand Down

0 comments on commit 3f26191

Please sign in to comment.