From c32b376f93cb34b8d8229b6bb8f776836d935621 Mon Sep 17 00:00:00 2001 From: "Ryan Y. Liu" Date: Sun, 15 Oct 2023 21:06:11 +0800 Subject: [PATCH 1/3] fix building in Conda ROS by Robostack --- README.md | 14 ++++++++++++++ gcopter/CMakeLists.txt | 2 +- map_gen/mockamap/CMakeLists.txt | 2 ++ map_gen/mockamap/include/maps.hpp | 1 + 4 files changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 5b629a2..7bce5cf 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,17 @@ +# About This Fork + +This fork supports building and testing using a ROS Noetic Conda install maintained by [Robostack](https://robostack.github.io/GettingStarted.html). + +```sh +mamba install ros-noetic-desktop-full=1.5.0 -c robostack-staging -y + +mamba install compilers cmake pkg-config make ninja colcon-common-extensions catkin_tools -y + +mamba install ompl=1.5.2 armadillo=12.6.5 -y +``` + +Now you can use it on whatever distro you like (Ubuntu Jammy is tested). See commits to find out what changes have been made. Origin README is preserved below. + # GCOPTER __GCOPTER__ is an efficient and versatile multicopter trajectory optimizer built upon a novel sparse trajectory representation named [__MINCO__](https://arxiv.org/pdf/2103.00190.pdf). __User-defined state-input constraints__ for dynamics involving [__nonlinear drag effects__](https://github.com/ZJU-FAST-Lab/GCOPTER/blob/main/misc/flatness.pdf) are supported. diff --git a/gcopter/CMakeLists.txt b/gcopter/CMakeLists.txt index fe5087f..bdd6499 100755 --- a/gcopter/CMakeLists.txt +++ b/gcopter/CMakeLists.txt @@ -2,7 +2,7 @@ cmake_minimum_required(VERSION 2.8.3) project(gcopter) -set(CMAKE_CXX_FLAGS "-std=c++14") +set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++14") set(CMAKE_BUILD_TYPE "Release") set(CMAKE_CXX_FLAGS_RELEASE "-O3 -Wall -fPIC") diff --git a/map_gen/mockamap/CMakeLists.txt b/map_gen/mockamap/CMakeLists.txt index afe63a6..3ad6908 100644 --- a/map_gen/mockamap/CMakeLists.txt +++ b/map_gen/mockamap/CMakeLists.txt @@ -7,6 +7,7 @@ add_compile_options(-std=c++14) ## Find catkin macros and libraries ## if COMPONENTS list like find_package(catkin REQUIRED COMPONENTS xyz) ## is used, also find other catkin packages +find_package(PCL REQUIRED) find_package(catkin REQUIRED COMPONENTS roscpp pcl_ros @@ -151,6 +152,7 @@ add_executable(${PROJECT_NAME}_node ## Specify libraries to link a library or executable target against target_link_libraries(${PROJECT_NAME}_node ${catkin_LIBRARIES} + ${PCL_LIBRARIES} ) ############# diff --git a/map_gen/mockamap/include/maps.hpp b/map_gen/mockamap/include/maps.hpp index bcda759..0db846b 100644 --- a/map_gen/mockamap/include/maps.hpp +++ b/map_gen/mockamap/include/maps.hpp @@ -1,6 +1,7 @@ #ifndef MAPS_HPP #define MAPS_HPP +#include #include #include From fc7a6e95e9d0505fe69519bcec6b062834ad5da8 Mon Sep 17 00:00:00 2001 From: "Ryan Y. Liu" Date: Sun, 15 Oct 2023 21:07:13 +0800 Subject: [PATCH 2/3] fix typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 7bce5cf..97b7b3c 100644 --- a/README.md +++ b/README.md @@ -10,7 +10,7 @@ mamba install compilers cmake pkg-config make ninja colcon-common-extensions cat mamba install ompl=1.5.2 armadillo=12.6.5 -y ``` -Now you can use it on whatever distro you like (Ubuntu Jammy is tested). See commits to find out what changes have been made. Origin README is preserved below. +Now you can use it on whatever distro you like (Ubuntu Jammy is tested). See commits to find out what changes have been made. The original README is kept below, enjoy! # GCOPTER From 9c835f323e550c971aaed96e77f70d5ca3ebae51 Mon Sep 17 00:00:00 2001 From: "Ryan Y. Liu" Date: Sun, 15 Oct 2023 22:05:11 +0800 Subject: [PATCH 3/3] integrate "fork info" into the original readme --- README.md | 43 +++++++++++++++++++++++++++---------------- 1 file changed, 27 insertions(+), 16 deletions(-) diff --git a/README.md b/README.md index 97b7b3c..a71e01a 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,3 @@ -# About This Fork - -This fork supports building and testing using a ROS Noetic Conda install maintained by [Robostack](https://robostack.github.io/GettingStarted.html). - -```sh -mamba install ros-noetic-desktop-full=1.5.0 -c robostack-staging -y - -mamba install compilers cmake pkg-config make ninja colcon-common-extensions catkin_tools -y - -mamba install ompl=1.5.2 armadillo=12.6.5 -y -``` - -Now you can use it on whatever distro you like (Ubuntu Jammy is tested). See commits to find out what changes have been made. The original README is kept below, enjoy! - # GCOPTER __GCOPTER__ is an efficient and versatile multicopter trajectory optimizer built upon a novel sparse trajectory representation named [__MINCO__](https://arxiv.org/pdf/2103.00190.pdf). __User-defined state-input constraints__ for dynamics involving [__nonlinear drag effects__](https://github.com/ZJU-FAST-Lab/GCOPTER/blob/main/misc/flatness.pdf) are supported. @@ -53,7 +39,10 @@ __Paper__: [Geometrically Constrained Trajectory Optimization for Multicopters]( ### Example 1: Global Trajectory Planning This is a minimal yet non-trivial example of our trajectory optimizer for real-time high-quality corridor and global trajectory generation subject to dynamic constraints. For installation, the following terminal commands are helpful. - + +* If you want to use it with the system-installed ROS: + + ```sh sudo apt update sudo apt install cpufrequtils sudo apt install libompl-dev @@ -64,8 +53,30 @@ This is a minimal yet non-trivial example of our trajectory optimizer for real-t catkin_make source devel/setup.bash roslaunch gcopter global_planning.launch + ``` + +* Alternatively, you can try it in a virtual environment: + + Using a virtual environment is great if you are on Ubuntu 22 and don't want to compile ROS 1, or maybe want to use this project with deep learning frameworks. Please refer to [RoboStack](https://robostack.github.io/GettingStarted.html)'s page for more information. + + ```sh + mamba create -n gcopter python=3.9 -y + mamba activate gcopter + + mamba install ros-noetic-desktop-full=1.5.0 -c robostack-staging -y + mamba install compilers cmake pkg-config make ninja colcon-common-extensions catkin_tools -y + mamba install ompl=1.5.2 -y + + # reactivate the env to prevent permission errors + mamba deactivate + mamba activate gcopter + cd ${CATKIN_WORKSPACE} + catkin_make + source devel/setup.bash + roslaunch gcopter global_planning.launch + ``` -After conduct the command, you will see the windows for rviz and rqt_plot. Please follow the gif below for global trajectory planning in a random map. +After conducting the command, you will see the windows for rviz and rqt_plot. Please follow the gif below for global trajectory planning in a random map.