Skip to content

Commit

Permalink
Tools: add ardupilot_gazebo to install-ROS-ubuntu script
Browse files Browse the repository at this point in the history
Co-authored-by: Jaime Machuca <[email protected]>
  • Loading branch information
2 people authored and rmackay9 committed Sep 10, 2022
1 parent b06afa8 commit 9d59d0f
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions Tools/environment_install/install-ROS-ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -209,8 +209,10 @@ heading "${green}Initializaing rosdep${reset}"
sudo rosdep init || true
# To find available packages, use:
rosdep update

# Use this to install dependencies of packages in a workspace
# rosdep install --from-paths src --ignore-src --rosdistro=${ROS_DISTRO} -y

# Environment Setup - Don't add /opt/ros/${ROS_VERSION}/setup.bash if it's already in bashrc
if maybe_prompt_user "Do you want to add ROS_HOSTNAME and ROS_MASTER_URI to your .bashrc [N/y]?" ; then
heading "${green}Adding setup.bash, ROS_MASTER_URI and ROS_HOSTNAME to .bashrc ${reset}"
Expand Down Expand Up @@ -246,6 +248,28 @@ else
echo "Skipping adding ardupilot_ws to your home folder."
fi

heading "${green}Installing Ardupilot_ros Gazebo Plugin${reset}"

# Installing ardupilot_gazebo
git clone https://github.com/ArduPilot/ardupilot_gazebo
pushd ardupilot_gazebo
mkdir build
pushd build
cmake ..
make
sudo make install
popd
popd
rm -rf ardupilot_gazebo

echo "source /usr/share/gazebo/setup.sh" >> ~/.bashrc

echo "export GAZEBO_MODEL_PATH=~/ardupilot_gazebo/models:${GAZEBO_MODEL_PATH}" >> ~/.bashrc
echo "export GAZEBO_MODEL_PATH=~/ardupilot_gazebo/models_gazebo:${GAZEBO_MODEL_PATH}" >> ~/.bashrc
echo "export GAZEBO_RESOURCE_PATH=~/ardupilot_gazebo/worlds:${GAZEBO_RESOURCE_PATH}" >> ~/.bashrc
echo "export GAZEBO_PLUGIN_PATH=~/ardupilot_gazebo/build:${GAZEBO_PLUGIN_PATH}" >> ~/.bashrc


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
Expand Down

0 comments on commit 9d59d0f

Please sign in to comment.