From 1ab700f27fd8000f8f0bdbcee6c5467b1cb16eda Mon Sep 17 00:00:00 2001 From: Sravan Balaji Date: Thu, 26 Jan 2023 16:10:58 -0500 Subject: [PATCH] Repo Re-Org, More like ROS Package - Reorganize repo so docker stuff is a folder within fast_rrt_ros ROS package - Update filepaths in README - Update `build_and_run_docker.bash` to use main folder as build context, but use Dockerfile inside docker folder - Update filepaths in Dockerfile --- .../CMakeLists.txt => CMakeLists.txt | 0 README.md | 14 +++---- .../config => config}/planner.yaml | 0 docker/Dockerfile | 35 ++++++++++-------- .../build_and_run_docker.bash | 2 +- .../fast_rrt_ros/docs => docs}/Capture1.PNG | Bin .../fast_rrt_ros/docs => docs}/Capture2.PNG | Bin .../fast_rrt_ros/docs => docs}/Capture3.PNG | Bin .../fast_rrt_ros/docs => docs}/Capture4.PNG | Bin .../fast_rrt_ros/docs => docs}/Capture5.PNG | Bin .../fast_rrt_ros/docs => docs}/Capture6.PNG | Bin .../fast_rrt_ros/docs => docs}/Capture7.PNG | Bin .../docs => docs}/Fast_RRTdocumentation.md | 0 .../fast_rrt_ros/docs => docs}/createNode.PNG | Bin .../fast_rrt_ros/docs => docs}/fast_rrt.PNG | Bin .../docs => docs}/findReachest.PNG | Bin .../docs => docs}/findReachestSketch.PNG | Bin .../fast_rrt_ros/docs => docs}/move_base.png | Bin .../docs => docs}/rewireSketch.PNG | Bin ...in.xml => fast_rrt_star_planner_plugin.xml | 0 .../fast_rrt_star_helper.h | 0 .../include => include}/fast_rrt_star_node.h | 0 .../fast_rrt_star_planner.h | 0 .../fast_rrt_ros/package.xml => package.xml | 0 {docker/scripts => scripts}/1_gazebo.bash | 0 {docker/scripts => scripts}/2_rviz.bash | 0 {docker/scripts => scripts}/3_default.bash | 0 .../scripts => scripts}/3_fast_rrt_star.bash | 0 .../3_fast_rrt_star_debug.bash | 0 .../3_fast_rrt_star_debug_valgrind.bash | 0 .../src => src}/fast_rrt_star_helper.cpp | 0 .../src => src}/fast_rrt_star_node.cpp | 0 .../src => src}/fast_rrt_star_planner.cpp | 0 33 files changed, 27 insertions(+), 24 deletions(-) rename docker/fast_rrt_ros/CMakeLists.txt => CMakeLists.txt (100%) rename {docker/fast_rrt_ros/config => config}/planner.yaml (100%) rename build_and_run_docker.bash => docker/build_and_run_docker.bash (92%) rename {docker/fast_rrt_ros/docs => docs}/Capture1.PNG (100%) rename {docker/fast_rrt_ros/docs => docs}/Capture2.PNG (100%) rename {docker/fast_rrt_ros/docs => docs}/Capture3.PNG (100%) rename {docker/fast_rrt_ros/docs => docs}/Capture4.PNG (100%) rename {docker/fast_rrt_ros/docs => docs}/Capture5.PNG (100%) rename {docker/fast_rrt_ros/docs => docs}/Capture6.PNG (100%) rename {docker/fast_rrt_ros/docs => docs}/Capture7.PNG (100%) rename {docker/fast_rrt_ros/docs => docs}/Fast_RRTdocumentation.md (100%) rename {docker/fast_rrt_ros/docs => docs}/createNode.PNG (100%) rename {docker/fast_rrt_ros/docs => docs}/fast_rrt.PNG (100%) rename {docker/fast_rrt_ros/docs => docs}/findReachest.PNG (100%) rename {docker/fast_rrt_ros/docs => docs}/findReachestSketch.PNG (100%) rename {docker/fast_rrt_ros/docs => docs}/move_base.png (100%) rename {docker/fast_rrt_ros/docs => docs}/rewireSketch.PNG (100%) rename docker/fast_rrt_ros/fast_rrt_star_planner_plugin.xml => fast_rrt_star_planner_plugin.xml (100%) rename {docker/fast_rrt_ros/include => include}/fast_rrt_star_helper.h (100%) rename {docker/fast_rrt_ros/include => include}/fast_rrt_star_node.h (100%) rename {docker/fast_rrt_ros/include => include}/fast_rrt_star_planner.h (100%) rename docker/fast_rrt_ros/package.xml => package.xml (100%) rename {docker/scripts => scripts}/1_gazebo.bash (100%) rename {docker/scripts => scripts}/2_rviz.bash (100%) rename {docker/scripts => scripts}/3_default.bash (100%) rename {docker/scripts => scripts}/3_fast_rrt_star.bash (100%) rename {docker/scripts => scripts}/3_fast_rrt_star_debug.bash (100%) rename {docker/scripts => scripts}/3_fast_rrt_star_debug_valgrind.bash (100%) rename {docker/fast_rrt_ros/src => src}/fast_rrt_star_helper.cpp (100%) rename {docker/fast_rrt_ros/src => src}/fast_rrt_star_node.cpp (100%) rename {docker/fast_rrt_ros/src => src}/fast_rrt_star_planner.cpp (100%) diff --git a/docker/fast_rrt_ros/CMakeLists.txt b/CMakeLists.txt similarity index 100% rename from docker/fast_rrt_ros/CMakeLists.txt rename to CMakeLists.txt diff --git a/README.md b/README.md index 96057de..bf29f7f 100644 --- a/README.md +++ b/README.md @@ -21,19 +21,19 @@ ROS Global Path Planner Plugin implementation of the [Fast-RRT* algorithm](https ## Pseudocode - + Fast-RRT* is more optimal than its predecessors RRT and RRT* through its novel method of creating an additional node when planning around obstacles. The node placement draws upon the observation that paths that traverse closer to obstacles in the environment tend to be shorter, or more optimal, overall. -Check out the [documentation file](./docker/fast_rrt_ros/docs/Fast_RRTdocumentation.md) for an in depth explanation of how the Fast-RRT* functions work. +Check out the [documentation file](./docs/Fast_RRTdocumentation.md) for an in depth explanation of how the Fast-RRT* functions work. ## ROS The Fast-RRT* code is a plugin to the `global_planner` in the [move_base](http://wiki.ros.org/move_base) navigation stack. - + This has been tested on the following ROS 1 distributions: @@ -73,7 +73,7 @@ We have containerized our planner to make testing quick and easy. Due to the use Once you have setup Docker and a way of displaying GUI applications running inside a Docker container, **check the sections below**. -Next, build the docker image and run the container with the included bash script: [build_and_run_docker.bash](./build_and_run_docker.bash). +Next, build the docker image and run the container with the included bash script: `./docker/build_and_run_docker.bash`. **NOTE**: Do not run this script from the `docker` folder. Assuming nothing went wrong you should now be inside the husky image container. @@ -81,11 +81,11 @@ Assuming nothing went wrong you should now be inside the husky image container. There are two important locations inside the container - `/opt/ros/$ROS_DISTRO` where all the ros debian packages such as the husky stack are installed and `/root/catkin_ws` which contains any source packages. -`/root/catkin_ws` contains a `scripts` and a `src` folder. The former contains scripts for running Gazebo, Rviz, and the planner in various modes. The latter contains the source code for the Fast-RRT* planner which was copied into the image from [docker/fast_rrt_ros](./docker/fast_rrt_ros/). +`/root/catkin_ws` contains a `scripts` and a `src` folder. The former contains scripts for running Gazebo, Rviz, and the planner in various modes. The latter contains the source code for the Fast-RRT* planner which was copied into the image. -Other than the planner source code, you can also modify the husky description and navigation launch files found in `/opt/ros/$ROS_DISTRO/share/husky_description` and `/opt/ros/$ROS_DISTRO/share/husky_navigation` respectively. Modified versions are included in the [docker](./docker/) folder and are copied into the image when the [Dockerfile](./docker/Dockerfile) is built by [build_and_run_docker.bash](./build_and_run_docker.bash). +Other than the planner source code, you can also modify the husky description and navigation launch files found in `/opt/ros/$ROS_DISTRO/share/husky_description` and `/opt/ros/$ROS_DISTRO/share/husky_navigation` respectively. Modified versions are included in the [docker](./docker/) folder and are copied into the image when the [Dockerfile](./docker/Dockerfile) is built by [build_and_run_docker.bash](./docker/build_and_run_docker.bash). -The [Fast-RRT* planner configuration file](./docker/fast_rrt_ros/config/planner.yaml) is copied into the appropriate location in the image as specified in the [Dockerfile](./docker/Dockerfile). This has parameters that control the behavior of the planner and should be adjusted before running the docker container. +The [Fast-RRT* planner configuration file](./config/planner.yaml) is copied into the appropriate location in the image as specified in the [Dockerfile](./docker/Dockerfile). This has parameters that control the behavior of the planner and should be adjusted before running the docker container. The [husky description](./docker/husky_description/urdf/husky.urdf.xacro) was modified from the default to enable the LiDAR sensor. diff --git a/docker/fast_rrt_ros/config/planner.yaml b/config/planner.yaml similarity index 100% rename from docker/fast_rrt_ros/config/planner.yaml rename to config/planner.yaml diff --git a/docker/Dockerfile b/docker/Dockerfile index b1d1f54..fc28b47 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -18,11 +18,11 @@ RUN apt-get update && \ # Copy launch files and husky description to appropriate locations ARG HUSKY_NAV_LAUNCH=husky_navigation/launch ARG HUSKY_DES_URDF=husky_description/urdf -COPY ./$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star.launch /opt/ros/$ROS_DISTRO/share/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star.launch -COPY ./$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_debug.launch /opt/ros/$ROS_DISTRO/share/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_debug.launch -COPY ./$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_mapless_demo.launch /opt/ros/$ROS_DISTRO/share/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_mapless_demo.launch -COPY ./$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_mapless_demo_debug.launch /opt/ros/$ROS_DISTRO/share/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_mapless_demo_debug.launch -COPY ./$HUSKY_DES_URDF/husky.urdf.xacro /opt/ros/$ROS_DISTRO/share/$HUSKY_DES_URDF/husky.urdf.xacro +COPY ./docker/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star.launch /opt/ros/$ROS_DISTRO/share/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star.launch +COPY ./docker/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_debug.launch /opt/ros/$ROS_DISTRO/share/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_debug.launch +COPY ./docker/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_mapless_demo.launch /opt/ros/$ROS_DISTRO/share/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_mapless_demo.launch +COPY ./docker/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_mapless_demo_debug.launch /opt/ros/$ROS_DISTRO/share/$HUSKY_NAV_LAUNCH/move_base_fast_rrt_star_mapless_demo_debug.launch +COPY ./docker/$HUSKY_DES_URDF/husky.urdf.xacro /opt/ros/$ROS_DISTRO/share/$HUSKY_DES_URDF/husky.urdf.xacro # Declare some environment variables ENV ROS_WORKSPACE=/root/catkin_ws @@ -31,15 +31,18 @@ ENV ROS_PACKAGE_PATH=/root/catkin_ws/src:/opt/ros/$ROS_DISTRO/share # Add setup.bash sourcing to bashrc RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> /etc/bash.bashrc -# Place Fast-RRT* in catkin workspace -COPY ./fast_rrt_ros/ /root/catkin_ws/src/fast_rrt_ros -COPY ./CMakeLists.txt /root/catkin_ws/src/CMakeLists.txt +# Copy catkin_ws CMakeLists, scripts, and planner configuration to image +WORKDIR /root/catkin_ws/ +COPY ./docker/CMakeLists.txt ./src/CMakeLists.txt +COPY ./scripts/ ./scripts +COPY ./config/planner.yaml /opt/ros/$ROS_DISTRO/share/husky_navigation/config/planner.yaml -# Copy scripts to image -COPY ./scripts/ /root/catkin_ws/scripts/ - -# Copy planner configuration -COPY ./fast_rrt_ros/config/planner.yaml /opt/ros/$ROS_DISTRO/share/husky_navigation/config/planner.yaml - -# Set working directory -WORKDIR /root/catkin_ws/ \ No newline at end of file +# Copy Fast-RRT* to catkin workspace in image +WORKDIR /root/catkin_ws/src/fast_rrt_ros +COPY ./include/ ./include/ +COPY ./src/ ./src/ +COPY ./CMakeLists.txt ./CMakeLists.txt +COPY ./fast_rrt_star_planner_plugin.xml ./fast_rrt_star_planner_plugin.xml +COPY ./LICENSE ./LICENSE +COPY ./package.xml ./package.xml +COPY ./README.md ./README.md diff --git a/build_and_run_docker.bash b/docker/build_and_run_docker.bash similarity index 92% rename from build_and_run_docker.bash rename to docker/build_and_run_docker.bash index 62e0b5b..3a189fb 100755 --- a/build_and_run_docker.bash +++ b/docker/build_and_run_docker.bash @@ -15,7 +15,7 @@ then fi # Build husky_image from Dockerfile in this directory -docker build -t husky_image ./docker/ +docker build -t husky_image -f ./docker/Dockerfile . # Run husky_image with specified environment variables, volume mounting, and host networking docker run \ diff --git a/docker/fast_rrt_ros/docs/Capture1.PNG b/docs/Capture1.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/Capture1.PNG rename to docs/Capture1.PNG diff --git a/docker/fast_rrt_ros/docs/Capture2.PNG b/docs/Capture2.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/Capture2.PNG rename to docs/Capture2.PNG diff --git a/docker/fast_rrt_ros/docs/Capture3.PNG b/docs/Capture3.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/Capture3.PNG rename to docs/Capture3.PNG diff --git a/docker/fast_rrt_ros/docs/Capture4.PNG b/docs/Capture4.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/Capture4.PNG rename to docs/Capture4.PNG diff --git a/docker/fast_rrt_ros/docs/Capture5.PNG b/docs/Capture5.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/Capture5.PNG rename to docs/Capture5.PNG diff --git a/docker/fast_rrt_ros/docs/Capture6.PNG b/docs/Capture6.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/Capture6.PNG rename to docs/Capture6.PNG diff --git a/docker/fast_rrt_ros/docs/Capture7.PNG b/docs/Capture7.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/Capture7.PNG rename to docs/Capture7.PNG diff --git a/docker/fast_rrt_ros/docs/Fast_RRTdocumentation.md b/docs/Fast_RRTdocumentation.md similarity index 100% rename from docker/fast_rrt_ros/docs/Fast_RRTdocumentation.md rename to docs/Fast_RRTdocumentation.md diff --git a/docker/fast_rrt_ros/docs/createNode.PNG b/docs/createNode.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/createNode.PNG rename to docs/createNode.PNG diff --git a/docker/fast_rrt_ros/docs/fast_rrt.PNG b/docs/fast_rrt.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/fast_rrt.PNG rename to docs/fast_rrt.PNG diff --git a/docker/fast_rrt_ros/docs/findReachest.PNG b/docs/findReachest.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/findReachest.PNG rename to docs/findReachest.PNG diff --git a/docker/fast_rrt_ros/docs/findReachestSketch.PNG b/docs/findReachestSketch.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/findReachestSketch.PNG rename to docs/findReachestSketch.PNG diff --git a/docker/fast_rrt_ros/docs/move_base.png b/docs/move_base.png similarity index 100% rename from docker/fast_rrt_ros/docs/move_base.png rename to docs/move_base.png diff --git a/docker/fast_rrt_ros/docs/rewireSketch.PNG b/docs/rewireSketch.PNG similarity index 100% rename from docker/fast_rrt_ros/docs/rewireSketch.PNG rename to docs/rewireSketch.PNG diff --git a/docker/fast_rrt_ros/fast_rrt_star_planner_plugin.xml b/fast_rrt_star_planner_plugin.xml similarity index 100% rename from docker/fast_rrt_ros/fast_rrt_star_planner_plugin.xml rename to fast_rrt_star_planner_plugin.xml diff --git a/docker/fast_rrt_ros/include/fast_rrt_star_helper.h b/include/fast_rrt_star_helper.h similarity index 100% rename from docker/fast_rrt_ros/include/fast_rrt_star_helper.h rename to include/fast_rrt_star_helper.h diff --git a/docker/fast_rrt_ros/include/fast_rrt_star_node.h b/include/fast_rrt_star_node.h similarity index 100% rename from docker/fast_rrt_ros/include/fast_rrt_star_node.h rename to include/fast_rrt_star_node.h diff --git a/docker/fast_rrt_ros/include/fast_rrt_star_planner.h b/include/fast_rrt_star_planner.h similarity index 100% rename from docker/fast_rrt_ros/include/fast_rrt_star_planner.h rename to include/fast_rrt_star_planner.h diff --git a/docker/fast_rrt_ros/package.xml b/package.xml similarity index 100% rename from docker/fast_rrt_ros/package.xml rename to package.xml diff --git a/docker/scripts/1_gazebo.bash b/scripts/1_gazebo.bash similarity index 100% rename from docker/scripts/1_gazebo.bash rename to scripts/1_gazebo.bash diff --git a/docker/scripts/2_rviz.bash b/scripts/2_rviz.bash similarity index 100% rename from docker/scripts/2_rviz.bash rename to scripts/2_rviz.bash diff --git a/docker/scripts/3_default.bash b/scripts/3_default.bash similarity index 100% rename from docker/scripts/3_default.bash rename to scripts/3_default.bash diff --git a/docker/scripts/3_fast_rrt_star.bash b/scripts/3_fast_rrt_star.bash similarity index 100% rename from docker/scripts/3_fast_rrt_star.bash rename to scripts/3_fast_rrt_star.bash diff --git a/docker/scripts/3_fast_rrt_star_debug.bash b/scripts/3_fast_rrt_star_debug.bash similarity index 100% rename from docker/scripts/3_fast_rrt_star_debug.bash rename to scripts/3_fast_rrt_star_debug.bash diff --git a/docker/scripts/3_fast_rrt_star_debug_valgrind.bash b/scripts/3_fast_rrt_star_debug_valgrind.bash similarity index 100% rename from docker/scripts/3_fast_rrt_star_debug_valgrind.bash rename to scripts/3_fast_rrt_star_debug_valgrind.bash diff --git a/docker/fast_rrt_ros/src/fast_rrt_star_helper.cpp b/src/fast_rrt_star_helper.cpp similarity index 100% rename from docker/fast_rrt_ros/src/fast_rrt_star_helper.cpp rename to src/fast_rrt_star_helper.cpp diff --git a/docker/fast_rrt_ros/src/fast_rrt_star_node.cpp b/src/fast_rrt_star_node.cpp similarity index 100% rename from docker/fast_rrt_ros/src/fast_rrt_star_node.cpp rename to src/fast_rrt_star_node.cpp diff --git a/docker/fast_rrt_ros/src/fast_rrt_star_planner.cpp b/src/fast_rrt_star_planner.cpp similarity index 100% rename from docker/fast_rrt_ros/src/fast_rrt_star_planner.cpp rename to src/fast_rrt_star_planner.cpp