From b0be10893f27f2e0de49dae95b9cf0139cf967fb Mon Sep 17 00:00:00 2001 From: Sanket Sharma Date: Fri, 6 Jan 2023 13:28:17 +0530 Subject: [PATCH 1/2] Tools: Add ardupilot_gazebo install script Added ardupilot_gazebo package for simulation purposes --- .../environment_install/install-ROS-ubuntu.sh | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/Tools/environment_install/install-ROS-ubuntu.sh b/Tools/environment_install/install-ROS-ubuntu.sh index 90804c15dbc82..c2ba7ec49b604 100755 --- a/Tools/environment_install/install-ROS-ubuntu.sh +++ b/Tools/environment_install/install-ROS-ubuntu.sh @@ -4,6 +4,7 @@ set -e # set -x ROS_WS_ROOT=$HOME/ardupilot-ws +AP_GZ_ROOT=$HOME/ardupilot_gazebo red=`tput setaf 1` green=`tput setaf 2` @@ -246,6 +247,26 @@ else echo "Skipping adding ardupilot_ws to your home folder." fi + +if maybe_prompt_user "Add ardupilot_gazebo to your home folder [N/y]?" ; then + if [ ! -d $AP_GZ_ROOT ]; then + git clone https://github.com/khancyr/ardupilot_gazebo + pushd $AP_GZ_ROOT + mkdir build + pushd build + cmake .. + make -j4 + sudo make install + popd + popd + else + heading "${red}ardupilot_gazebo already exists, skipping...${reset}" + fi + +else + echo "Skipping adding ardupilot_gazebo to your home folder." +fi + heading "${green}Adding setup.bash, ROS_MASTER_URI and ROS_HOSTNAME to .bashrc ${reset}" grep -q -F "source $ROS_WS_ROOT/devel/setup.bash" ~/.bashrc || echo "source $ROS_WS_ROOT/devel/setup.bash" >> ~/.bashrc source ~/.bashrc From 680486635d1e1afd7e27a7780ce634b64944e2df Mon Sep 17 00:00:00 2001 From: Sanket Sharma Date: Fri, 6 Jan 2023 13:54:27 +0530 Subject: [PATCH 2/2] updated ardupilot_gazebo source and dependencies --- Tools/environment_install/install-ROS-ubuntu.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Tools/environment_install/install-ROS-ubuntu.sh b/Tools/environment_install/install-ROS-ubuntu.sh index c2ba7ec49b604..a77541abdb7a1 100755 --- a/Tools/environment_install/install-ROS-ubuntu.sh +++ b/Tools/environment_install/install-ROS-ubuntu.sh @@ -250,15 +250,16 @@ fi if maybe_prompt_user "Add ardupilot_gazebo to your home folder [N/y]?" ; then if [ ! -d $AP_GZ_ROOT ]; then - git clone https://github.com/khancyr/ardupilot_gazebo + sudo apt install libgz-sim7-dev rapidjson-dev + git clone https://github.com/ArduPilot/ardupilot_gazebo pushd $AP_GZ_ROOT - mkdir build - pushd build - cmake .. + mkdir build && pushd build + cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo make -j4 - sudo make install popd popd + echo 'export GZ_SIM_SYSTEM_PLUGIN_PATH=$AP_GZ_ROOT/build:${GZ_SIM_SYSTEM_PLUGIN_PATH}' >> ~/.bashrc + echo 'export GZ_SIM_RESOURCE_PATH=$AP_GZ_ROOT/models:$AP_GZ_ROOT/worlds:${GZ_SIM_RESOURCE_PATH}' >> ~/.bashrc else heading "${red}ardupilot_gazebo already exists, skipping...${reset}" fi