From 3d0ed111061ec167615a4d3a2459ac5b6f612d26 Mon Sep 17 00:00:00 2001 From: Bilal Kahraman Date: Fri, 23 Aug 2024 15:20:49 +0300 Subject: [PATCH 1/4] Remove sfml and add sdl3 as submodule --- .gitmodules | 3 + CMakeLists.txt | 13 +-- docker/Dockerfile | 4 - docker/entrypoint.sh | 2 +- docker/run.sh | 9 +- main.cpp | 2 +- third-party/SDL | 1 + tools/CMakeLists.txt | 21 ++-- tools/include/visualizer.h | 41 ++++---- tools/src/visualizer.cpp | 200 ++++++++++++++++++++++--------------- 10 files changed, 175 insertions(+), 121 deletions(-) create mode 160000 third-party/SDL diff --git a/.gitmodules b/.gitmodules index 267d821..e26c0e6 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,6 @@ [submodule "third-party/yaml-cpp"] path = third-party/yaml-cpp url = https://github.com/jbeder/yaml-cpp.git +[submodule "third-party/SDL"] + path = third-party/SDL + url = https://github.com/libsdl-org/SDL.git diff --git a/CMakeLists.txt b/CMakeLists.txt index 000393d..a67f79a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -3,7 +3,6 @@ project(PathFind) set(CMAKE_CXX_STANDARD 17) add_definitions("-Wall" "-g") -find_package(SFML COMPONENTS window graphics system) find_package(Git QUIET) set(DATA_DIR ${PROJECT_SOURCE_DIR}/maps) @@ -32,23 +31,25 @@ if(NOT EXISTS "${PROJECT_SOURCE_DIR}/third-party/yaml-cpp/CMakeLists.txt") endif() +add_subdirectory(${PROJECT_SOURCE_DIR}/third-party/yaml-cpp) +add_subdirectory(${PROJECT_SOURCE_DIR}/third-party/SDL) +add_subdirectory(${PROJECT_SOURCE_DIR}/planning) +add_subdirectory(${PROJECT_SOURCE_DIR}/tools) + include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/third-party/yaml-cpp/include + ${PROJECT_SOURCE_DIR}/third-party/SDL/include ) link_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${PROJECT_SOURCE_DIR} ${PROJECT_SOURCE_DIR}/third-party/yaml-cpp/include + ${PROJECT_SOURCE_DIR}/third-party/SDL/include ) - -add_subdirectory(${PROJECT_SOURCE_DIR}/third-party/yaml-cpp) -add_subdirectory(${PROJECT_SOURCE_DIR}/planning) -add_subdirectory(${PROJECT_SOURCE_DIR}/tools) - # enable test enable_testing() add_subdirectory(${PROJECT_SOURCE_DIR}/test) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8e4d110..4c4df5e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,9 +1,6 @@ FROM ubuntu:22.04 -ENV DEBIAN_FRONTEND=noninteractive -ENV LANG C.UTF-8 -ENV LC_ALL C.UTF-8 RUN apt-get update && \ apt-get upgrade -y && \ @@ -13,7 +10,6 @@ RUN apt-get update && \ vim \ nano \ cmake \ - libsfml-dev \ build-essential \ software-properties-common && \ rm -rf /var/lib/apt/lists/* diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index d84a24e..2369431 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,4 +1,4 @@ #!/bin/bash cd path-planning/build -ctest -C --verbose \ No newline at end of file +./main \ No newline at end of file diff --git a/docker/run.sh b/docker/run.sh index 9f2e7ad..718db92 100755 --- a/docker/run.sh +++ b/docker/run.sh @@ -30,10 +30,15 @@ then fi else printf "${RED}---CREATING DOCKER CONTAINER---\n${NC}" - docker run \ + xhost +local:root &> /dev/null + docker run -it \ --rm \ - --net=host \ --privileged \ + --net=host \ + --gpus all \ + --env=NVIDIA_VISIBLE_DEVICES=all \ + --env=NVIDIA_DRIVER_CAPABILITIES=all \ + --env=DISPLAY \ $VOLUMES \ --name="${CONTAINER_NAME}" \ $IMAGE_NAME diff --git a/main.cpp b/main.cpp index 2f2548c..d5a6e7e 100644 --- a/main.cpp +++ b/main.cpp @@ -68,7 +68,7 @@ int main(int argc, char **argv) // Visualize start and goal nodes visualizer->SetStartAndGoal(start_node, goal_node); - while (true) + while (visualizer->IsRunning()) { visualizer->SetGetLogFunction( std::bind(&planning::IPlanningWithLogging::GetLog, planner)); diff --git a/third-party/SDL b/third-party/SDL new file mode 160000 index 0000000..8bcfdb0 --- /dev/null +++ b/third-party/SDL @@ -0,0 +1 @@ +Subproject commit 8bcfdb0c925a11a8f4b47ab589e5c37458337787 diff --git a/tools/CMakeLists.txt b/tools/CMakeLists.txt index 16d963a..f59cf94 100644 --- a/tools/CMakeLists.txt +++ b/tools/CMakeLists.txt @@ -4,32 +4,33 @@ include_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR} + ${PROJECT_SOURCE_DIR}/third-party/SDL/include + ) link_directories( ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/include ${PROJECT_SOURCE_DIR} + ${PROJECT_SOURCE_DIR}/third-party/SDL/include ) -set( - VISUALIZER_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/src/visualizer.cpp - ${COMMON_PLANNING_FILES} -) add_library( visualizer - SHARED - ${VISUALIZER_SOURCES} + STATIC + src/visualizer.cpp +) + +target_include_directories(visualizer PUBLIC + ${CMAKE_CURRENT_SOURCE_DIR} + ${CMAKE_CURRENT_SOURCE_DIR}/include ) target_link_libraries( visualizer PUBLIC - sfml-system - sfml-graphics - sfml-window common_tree_base + SDL3::SDL3 ) diff --git a/tools/include/visualizer.h b/tools/include/visualizer.h index 31baa5c..6759368 100644 --- a/tools/include/visualizer.h +++ b/tools/include/visualizer.h @@ -12,11 +12,10 @@ #ifndef TOOLS_INCLUDE_VISUALIZER_H_ #define TOOLS_INCLUDE_VISUALIZER_H_ +#include "SDL3/SDL.h" #include "planning/include/data_types.h" #include "planning/include/i_planning.h" #include "planning/tree_base/include/common_tree_base.h" -#include -#include #include #include #include @@ -29,15 +28,15 @@ namespace tools using pair_size_t = std::pair; using pair_double = std::pair; -inline std::unordered_map GetColorMap() +inline std::unordered_map GetColorMap() { - std::unordered_map colors_; - colors_.insert({planning::NodeState::kFree, sf::Color::White}); - colors_.insert({planning::NodeState::kVisited, sf::Color::Blue}); - colors_.insert({planning::NodeState::kOccupied, sf::Color::Black}); - colors_.insert({planning::NodeState::kStart, sf::Color::Green}); - colors_.insert({planning::NodeState::kGoal, sf::Color::Yellow}); - colors_.insert({planning::NodeState::kPath, sf::Color::Red}); + std::unordered_map colors_; + colors_.insert({planning::NodeState::kFree, SDL_Color{255, 255, 255, 255}}); + colors_.insert({planning::NodeState::kVisited, SDL_Color{0, 0, 255, 255}}); + colors_.insert({planning::NodeState::kOccupied, SDL_Color{0, 0, 0, 255}}); + colors_.insert({planning::NodeState::kStart, SDL_Color{0, 255, 0, 255}}); + colors_.insert({planning::NodeState::kGoal, SDL_Color{255, 0, 0, 255}}); + colors_.insert({planning::NodeState::kPath, SDL_Color{255, 0, 0, 255}}); return colors_; } @@ -47,12 +46,11 @@ class Visualizer public: Visualizer(std::shared_ptr map, pair_double size_coeff, double kDelay, std::string window_name, std::string planner_name); - ~Visualizer() { window_.close(); } - + ~Visualizer() = default; void SetStartAndGoal(const planning::Node &start_node, const planning::Node &goal_node); - void MapToTexture(); + void RenderMap(); void VizGridLog(); void VizTreeLog(); @@ -63,6 +61,11 @@ class Visualizer } void Run(); + bool IsRunning() { return is_running_; } + void CheckEvent(); + void ClearScreen(); + void DrawLine(planning::Node start, planning::Node end); + void DrawFilledRectangle(planning::Node start, planning::Node end); private: std::shared_ptr map; @@ -70,15 +73,17 @@ class Visualizer double kDelay_; std::string window_name_; std::string planner_name_; + SDL_bool loopShouldStop = SDL_FALSE; + bool is_running_ = true; - std::unordered_map colors_; - sf::RenderWindow window_; - sf::RenderTexture render_texture_; + std::unordered_map colors_; + SDL_Window *win = NULL; + SDL_Renderer *renderer = NULL; std::function viz_function_; std::function get_log_function_; - sf::CircleShape start_node_; - sf::CircleShape goal_node_; + planning::Node start_node_; + planning::Node goal_node_; std::thread window_thread_; }; diff --git a/tools/src/visualizer.cpp b/tools/src/visualizer.cpp index b60bd4a..e407e31 100644 --- a/tools/src/visualizer.cpp +++ b/tools/src/visualizer.cpp @@ -10,9 +10,14 @@ */ #include "tools/include/visualizer.h" +#include "SDL3/SDL_error.h" +#include "SDL3/SDL_events.h" +#include "SDL3/SDL_init.h" +#include "SDL3/SDL_rect.h" +#include "SDL3/SDL_render.h" +#include "SDL3/SDL_video.h" #include "planning/include/data_types.h" -#include "planning/tree_base/include/common_tree_base.h" -#include +#include #include #include @@ -26,10 +31,6 @@ Visualizer::Visualizer(std::shared_ptr map, window_name_(window_name), planner_name_(planner_name) { colors_ = GetColorMap(); - window_.create(sf::VideoMode(map->GetHeight() * size_coeff_.first, - map->GetWidth() * size_coeff_.second), - window_name_); - MapToTexture(); if (planner_name_ == "astar" || planner_name_ == "bfs" || planner_name_ == "dfs") @@ -44,44 +45,36 @@ Visualizer::Visualizer(std::shared_ptr map, { throw std::runtime_error("Unknown planner name"); } - - window_thread_ = std::thread(&Visualizer::Run, this); + is_running_ = true; + window_thread_ = std::thread([this]() { Run(); }); window_thread_.detach(); }; void Visualizer::SetStartAndGoal(const planning::Node &start_node, const planning::Node &goal_node) { - start_node_.setRadius(size_coeff_.first * 2); - start_node_.setFillColor(colors_.at(planning::NodeState::kStart)); - start_node_.setPosition(start_node.y_ * size_coeff_.second, - start_node.x_ * size_coeff_.first); - - goal_node_.setRadius(size_coeff_.first * 2); - goal_node_.setFillColor(colors_.at(planning::NodeState::kGoal)); - goal_node_.setPosition(goal_node.y_ * size_coeff_.second, - goal_node.x_ * size_coeff_.first); + start_node_ = start_node; + goal_node_ = goal_node; } -void Visualizer::MapToTexture() +void Visualizer::RenderMap() { - render_texture_.create(map->GetHeight() * size_coeff_.first, - map->GetWidth() * size_coeff_.second); - render_texture_.clear(); - for (auto i = 0u; i < map->GetHeight(); i++) + + for (auto i = 0u; i < map->GetWidth(); i++) { - for (auto j = 0u; j < map->GetWidth(); j++) + for (auto j = 0u; j < map->GetHeight(); j++) { - sf::RectangleShape rectangle; - rectangle.setSize( - sf::Vector2f(size_coeff_.second, size_coeff_.first)); - rectangle.setPosition(j * size_coeff_.second, i * size_coeff_.first); + auto key = map->GetNodeState(planning::Node(i, j)); - rectangle.setFillColor(colors_.at(key)); - render_texture_.draw(rectangle); + auto color = colors_.at(key); + SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a); + + DrawFilledRectangle( + {int(size_coeff_.first * j), int(i * size_coeff_.second)}, + {int(size_coeff_.first * (j + 1)), + int(size_coeff_.second * (i + 1))}); } } - render_texture_.display(); } void Visualizer::VizGridLog() @@ -91,30 +84,34 @@ void Visualizer::VizGridLog() return; } auto log = get_log_function_(); - sf::RectangleShape cell_{}; - cell_.setSize(sf::Vector2f(size_coeff_.second, size_coeff_.first)); - for (auto &node_parent : log.first) + auto color = colors_.at(planning::NodeState::kVisited); + SDL_FRect *points = new SDL_FRect[log.first.size()]; + for (int i = 0; i < log.first.size(); i++) { - if (node_parent == nullptr) - { - continue; - } - cell_.setPosition(node_parent->node.y_ * size_coeff_.second, - node_parent->node.x_ * size_coeff_.first); - cell_.setFillColor(colors_.at(planning::NodeState::kVisited)); - window_.draw(cell_); + points[i].x = log.first[i]->node.y_ * size_coeff_.second; + points[i].y = log.first[i]->node.x_ * size_coeff_.first; + points[i].w = size_coeff_.second; + points[i].h = size_coeff_.first; } + SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a); + SDL_RenderFillRects(renderer, points, log.first.size()); + delete[] points; if (log.second != nullptr) { auto path{planning::ReconstructPath(log.second)}; - for (auto &node : path) + SDL_FRect *points2 = new SDL_FRect[path.size()]; + + for (int i = 0; i < path.size(); i++) { - cell_.setPosition(node.y_ * size_coeff_.second, - node.x_ * size_coeff_.first); - cell_.setFillColor(colors_.at(planning::NodeState::kPath)); - window_.draw(cell_); + points2[i].x = path[i].y_ * size_coeff_.second; + points2[i].y = path[i].x_ * size_coeff_.first; + points2[i].w = size_coeff_.second; + points2[i].h = size_coeff_.first; } + color = colors_.at(planning::NodeState::kPath); + SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a); + SDL_RenderFillRects(renderer, points2, path.size()); } } @@ -125,6 +122,8 @@ void Visualizer::VizTreeLog() return; } auto log = get_log_function_(); + auto color = colors_.at(planning::NodeState::kVisited); + SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a); for (auto &node_parent : log.first) { if (node_parent->parent == nullptr) @@ -132,58 +131,101 @@ void Visualizer::VizTreeLog() continue; } - sf::Vertex line[] = { - sf::Vertex( - sf::Vector2f(node_parent->parent->node.y_ * size_coeff_.second, - node_parent->parent->node.x_ * size_coeff_.first), - colors_.at(planning::NodeState::kVisited)), - sf::Vertex(sf::Vector2f(node_parent->node.y_ * size_coeff_.second, - node_parent->node.x_ * size_coeff_.first), - colors_.at(planning::NodeState::kVisited))}; - window_.draw(line, 2, sf::Lines); + DrawLine(planning::Node(node_parent->parent->node.y_ * size_coeff_.second, + node_parent->parent->node.x_ * size_coeff_.first), + planning::Node(node_parent->node.y_ * size_coeff_.second, + node_parent->node.x_ * size_coeff_.first)); } if (log.second != nullptr) { auto path{planning::ReconstructPath(log.second)}; + color = colors_.at(planning::NodeState::kPath); + SDL_SetRenderDrawColor(renderer, color.r, color.g, color.b, color.a); for (auto i = 0u; i < path.size() - 1; i++) { - sf::Vertex line[] = { - sf::Vertex(sf::Vector2f(path[i].y_ * size_coeff_.second, - path[i].x_ * size_coeff_.first), - colors_.at(planning::NodeState::kPath)), - sf::Vertex(sf::Vector2f(path[i + 1].y_ * size_coeff_.second, - path[i + 1].x_ * size_coeff_.first), - colors_.at(planning::NodeState::kPath))}; - window_.draw(line, 2, sf::Lines); + DrawLine(planning::Node(path[i].y_ * size_coeff_.second, + path[i].x_ * size_coeff_.first), + planning::Node(path[i + 1].y_ * size_coeff_.second, + path[i + 1].x_ * size_coeff_.first)); } } } void Visualizer::Run() { - while (window_.isOpen()) + if (SDL_Init(SDL_INIT_VIDEO) != 0) { + std::cerr << "SDL_Init Error: " << SDL_GetError() << std::endl; + exit(EXIT_FAILURE); + } - sf::Event event; - while (window_.pollEvent(event)) - { - if (event.type == sf::Event::Closed) - { - window_.close(); - } - } + win = SDL_CreateWindow(window_name_.c_str(), + map->GetWidth() * size_coeff_.second, + map->GetHeight() * size_coeff_.first, 0); + if (win == nullptr) + { + std::cerr << "SDL_CreateWindow Error: " << SDL_GetError() << std::endl; + SDL_Quit(); + exit(EXIT_FAILURE); + } - window_.clear(); - sf::Sprite sprite(render_texture_.getTexture()); - window_.draw(sprite); + renderer = SDL_CreateRenderer(win, NULL); + if (renderer == nullptr) + { + std::cerr << "SDL_CreateRenderer Error: " << SDL_GetError() << std::endl; + SDL_DestroyWindow(win); + SDL_Quit(); + exit(EXIT_FAILURE); + } + + while (!loopShouldStop) + { + CheckEvent(); + ClearScreen(); + RenderMap(); viz_function_(); - window_.draw(start_node_); - window_.draw(goal_node_); - window_.display(); - std::this_thread::sleep_for(std::chrono::milliseconds(1000 / 30)); + SDL_RenderPresent(renderer); } + + SDL_DestroyRenderer(renderer); + SDL_DestroyWindow(win); + SDL_Quit(); +} + +void Visualizer::CheckEvent() +{ + SDL_Event event; + while (SDL_PollEvent(&event)) + { + // When user close the window + if (event.type == SDL_EVENT_QUIT || + (event.type == SDL_EventType::SDL_EVENT_KEY_DOWN && + event.key.key == SDLK_ESCAPE)) + { + loopShouldStop = SDL_TRUE; + is_running_ = false; + } + } +} + +void Visualizer::ClearScreen() +{ + SDL_SetRenderDrawColor(renderer, 0, 0, 0, 255); + SDL_RenderClear(renderer); +} + +void Visualizer::DrawLine(planning::Node start, planning::Node end) +{ + SDL_RenderLine(renderer, start.x_, start.y_, end.x_, end.y_); +} + +void Visualizer::DrawFilledRectangle(planning::Node start, planning::Node end) +{ + SDL_FRect rect{float(start.x_), float(start.y_), float(end.x_ - start.x_), + float(end.y_ - start.y_)}; + SDL_RenderFillRect(renderer, &rect); } } // namespace tools From 44f740ab568d84135f9fd3bf55032bfde53e6d60 Mon Sep 17 00:00:00 2001 From: Bilal Kahraman Date: Fri, 23 Aug 2024 17:02:51 +0300 Subject: [PATCH 2/4] Fix docker and update linter --- .github/workflows/cmake-single-platform.yml | 2 +- .github/workflows/lint.yml | 2 +- docker/entrypoint.sh | 2 +- docker/test.sh | 40 +++++++++++++++++++++ 4 files changed, 43 insertions(+), 3 deletions(-) create mode 100755 docker/test.sh diff --git a/.github/workflows/cmake-single-platform.yml b/.github/workflows/cmake-single-platform.yml index 506fa45..0540be2 100644 --- a/.github/workflows/cmake-single-platform.yml +++ b/.github/workflows/cmake-single-platform.yml @@ -90,4 +90,4 @@ jobs: - name: Run Docker working-directory: ${{github.workspace}}/docker run: | - bash run.sh + bash test.sh diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 9c2182f..e406f45 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -27,7 +27,7 @@ jobs: find . -not -path "./.git/*" -not -path "./.vscode/*" -name "*.cpp" -o -name "*.h" | xargs clang-format -i -style=file # commit the changes (if there are any) - name: Commit changes - uses: stefanzweifel/git-auto-commit-action@v4.16.0 + uses: stefanzweifel/git-auto-commit-action@v5 with: commit_message: 🎨 apply clang-format changes branch: ${{ github.head_ref }} diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 2369431..d84a24e 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -1,4 +1,4 @@ #!/bin/bash cd path-planning/build -./main \ No newline at end of file +ctest -C --verbose \ No newline at end of file diff --git a/docker/test.sh b/docker/test.sh new file mode 100755 index 0000000..9f2e7ad --- /dev/null +++ b/docker/test.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +RED='\033[0;31m' # red +GREEN='\033[0;32m' # green +YELLOW='\033[1;33m' # yellow +BLUE='\033[1;34m' # blue +CYAN='\033[1;36m' # cyan +NC='\033[0m' # no color + +IMAGE_NAME="path_planning:latest" +CONTAINER_NAME=planning + +XSOCK=/tmp/.X11-unix +XAUTH=$HOME/.Xauthority + +VOLUMES="--volume=$XSOCK:$XSOCK:rw + --volume=$XAUTH:$XAUTH:rw" + +if (docker ps --all | grep -q ${CONTAINER_NAME}) +then + printf "${GREEN}---DOCKER CONTAINER IS VALID---\n${NC}" + if (docker ps | grep -q ${CONTAINER_NAME}) + then + printf "${YELLOW}---OPENNING DOCKER CONTAINER---\n${NC}" + docker exec ${CONTAINER_NAME} /bin/bash + else + printf "${YELLOW}---STARTING DOCKER CONTAINER---\n${NC}" + docker start ${CONTAINER_NAME} 1>/dev/null 2>&1 + docker exec ${CONTAINER_NAME} /bin/bash + fi +else + printf "${RED}---CREATING DOCKER CONTAINER---\n${NC}" + docker run \ + --rm \ + --net=host \ + --privileged \ + $VOLUMES \ + --name="${CONTAINER_NAME}" \ + $IMAGE_NAME +fi From 7364f57490ce1a24901d21010254a1a339162510 Mon Sep 17 00:00:00 2001 From: Bilal Kahraman Date: Fri, 23 Aug 2024 17:07:38 +0300 Subject: [PATCH 3/4] Use checkout v4 and give write permission --- .github/workflows/lint.yml | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index e406f45..0b50953 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -5,10 +5,16 @@ on: branches: [ "main" ] types: [opened, labeled, unlabeled, synchronize] jobs: - format: + format-code: runs-on: ubuntu-latest + + permissions: + # Give the default GITHUB_TOKEN write permission to commit and push the + # added or changed files to the repository. + contents: write + steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: token: ${{ secrets.BOT_TOKEN || github.token }} # check out HEAD on the branch From 0cebcf2d7d7a242885a2744384cd47d7274715b9 Mon Sep 17 00:00:00 2001 From: Bilal Kahraman Date: Fri, 23 Aug 2024 17:19:56 +0300 Subject: [PATCH 4/4] Remove sleep --- planning/grid_base/a_star/a_star.cpp | 1 - planning/grid_base/bfs/bfs.cpp | 1 - planning/grid_base/dfs/dfs.cpp | 1 - planning/tree_base/rrt/rrt.cpp | 1 - 4 files changed, 4 deletions(-) diff --git a/planning/grid_base/a_star/a_star.cpp b/planning/grid_base/a_star/a_star.cpp index 8fedbf2..6a1612d 100644 --- a/planning/grid_base/a_star/a_star.cpp +++ b/planning/grid_base/a_star/a_star.cpp @@ -101,7 +101,6 @@ Path AStar::FindPath(const Node &start_node, const Node &goal_node, search_list.push(neighbor_node); } - std::this_thread::sleep_for(std::chrono::microseconds(100)); } if (search_list.empty()) diff --git a/planning/grid_base/bfs/bfs.cpp b/planning/grid_base/bfs/bfs.cpp index dd28535..d80b201 100644 --- a/planning/grid_base/bfs/bfs.cpp +++ b/planning/grid_base/bfs/bfs.cpp @@ -84,7 +84,6 @@ Path BFS::FindPath(const Node &start_node, const Node &goal_node, search_list.push(neighbor_node); } - std::this_thread::sleep_for(std::chrono::microseconds(100)); } if (search_list.empty()) { diff --git a/planning/grid_base/dfs/dfs.cpp b/planning/grid_base/dfs/dfs.cpp index 3a6cd3f..fa712f9 100644 --- a/planning/grid_base/dfs/dfs.cpp +++ b/planning/grid_base/dfs/dfs.cpp @@ -81,7 +81,6 @@ Path DFS::FindPath(const Node &start_node, const Node &goal_node, search_list.push(new_node_parent); } - std::this_thread::sleep_for(std::chrono::microseconds(100)); } if (search_list.empty()) diff --git a/planning/tree_base/rrt/rrt.cpp b/planning/tree_base/rrt/rrt.cpp index 7ab1e06..477ff06 100644 --- a/planning/tree_base/rrt/rrt.cpp +++ b/planning/tree_base/rrt/rrt.cpp @@ -75,7 +75,6 @@ Path RRT::FindPath(const Node &start_node, const Node &goal_node, // Get path. return ReconstructPath(goal); } - std::this_thread::sleep_for(std::chrono::milliseconds(1)); } return Path();