-
Notifications
You must be signed in to change notification settings - Fork 17.7k
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: Add ardupilot_gazebo install script #22598
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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,27 @@ 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 | ||
sudo apt install libgz-sim7-dev rapidjson-dev | ||
git clone https://github.com/ArduPilot/ardupilot_gazebo | ||
pushd $AP_GZ_ROOT | ||
mkdir build && pushd build | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Need to create the workspace directory first, then clone, then cd into the project, then make build dir and build. mkdir -p $AP_GZ_ROOT/src
pushd $AP_GZ_ROOT/src
git clone https://github.com/ArduPilot/ardupilot_gazebo
pushd ardupilot_gazebo
mkdir build && pushd build Suggest that |
||
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 | ||
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 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sudo apt install gz-garden rapidjson-dev
is needed to install all the libraries. See https://gazebosim.org/docs/garden/install_ubuntu.