Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tools: Update ardupilot_gazebo install script #22608

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions Tools/environment_install/install-ROS-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ set -e
# set -x

ROS_WS_ROOT=$HOME/ardupilot-ws
AP_GZ_ROOT=$HOME/ardupilot_gazebo
AP_GZ_ROOT=$HOME/ardupilot_gz_ws

red=`tput setaf 1`
green=`tput setaf 2`
Expand Down Expand Up @@ -231,6 +231,7 @@ if maybe_prompt_user "Add ardupilot-ws to your home folder [N/y]?" ; then
if [ ! -d $ROS_WS_ROOT ]; then
mkdir -p $ROS_WS_ROOT/src
pushd $ROS_WS_ROOT
source /opt/ros/${ROS_VERSION}/setup.bash
catkin init
pushd src
git clone https://github.com/ArduPilot/ardupilot_ros.git
Expand All @@ -250,16 +251,19 @@ fi

if maybe_prompt_user "Add ardupilot_gazebo to your home folder [N/y]?" ; then
if [ ! -d $AP_GZ_ROOT ]; then
sudo apt install libgz-sim7-dev rapidjson-dev
sudo apt install gz-garden rapidjson-dev
mkdir -p $AP_GZ_ROOT/src
pushd $AP_GZ_ROOT/src
git clone https://github.com/ArduPilot/ardupilot_gazebo
pushd $AP_GZ_ROOT
pushd ardupilot_gazebo
mkdir build && pushd build
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j4
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
popd
echo "export GZ_SIM_SYSTEM_PLUGIN_PATH=${AP_GZ_ROOT}/src/ardupilot_gazebo/build:${GZ_SIM_SYSTEM_PLUGIN_PATH}" >> ~/.bashrc
echo "export GZ_SIM_RESOURCE_PATH=${AP_GZ_ROOT}/src/ardupilot_gazebo/models:${AP_GZ_ROOT}/src/ardupilot_gazebo/worlds:${GZ_SIM_RESOURCE_PATH}" >> ~/.bashrc
else
heading "${red}ardupilot_gazebo already exists, skipping...${reset}"
fi
Expand Down