This pacakge provides interface of Agilicious to Pixhawk4 SITL simulator.
We test the following installation steps in Ubuntu18.04 with ROS Melodic.
In the following section we guide you through installing and running a Gazebo simulation.
-
Clone the PX4 Firmware and all its submodules (it may take some time).
cd ~ git clone https://github.com/PX4/Firmware.git --recursive cd ~/Firmware
-
Install PX4 dependencies.
# Install PX4 "common" dependencies. ./Tools/setup/ubuntu.sh --no-sim-tools --no-nuttx # Gstreamer plugins (for Gazebo camera) sudo apt install gstreamer1.0-plugins-bad gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-ugly libgstreamer-plugins-base1.0-dev
-
Build the Firmware once in order to generate SDF model files for Gazebo. This step will actually run a simulation (that you can immediately close).
# This is necessary to prevent some Qt-related errors (feel free to try to omit it) export QT_X11_NO_MITSHM=1 # Build and run simulation make px4_sitl_default gazebo # Quit the simulation (Ctrl+C) # Setup some more Gazebo-related environment variables (modify this line based on the location of the Firmware folder on your machine) . ~/Firmware/Tools/simulation/gazebo-classic/setup_gazebo.bash ~/Firmware ~/Firmware/build/px4_sitl_default
-
Download mavros
sudo apt-get install ros-$ROS_DISTRO-mavros
-
Finally, set the ROS_PACKAGE_PATH and GAZEBO_MODEL_PATH in your bashrc. Ensure your ~/.bashrc is setup correctly so that each new terminal is sourced correctly:
sudo gedit ~/.bashrc
Ensure that at the bottom of that document you have exactly this:
source /opt/ros/melodic/setup.bash px4_dir=~/Firmware source $px4_dir/Tools/setup_gazebo.bash $px4_dir $px4_dir/build/px4_sitl_default export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$px4_dir export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$px4_dir/Tools/sitl_gazebo
Follow the guide in https://github.com/uzh-rpg/agilicious
to install the Agilicious.
- Clone the Agihawk repository to the same work space as Agilicious. Assume that the source folder is in path
~/agi_ws/src
.cd ~/agi_ws/src git clone https://github.com/FSC-Lab/agihawk git clone https://github.com/catkin/catkin_simple git clone https://github.com/ethz-asl/mav_comm.git catkin build
- Go to the ~/.bashrc setup and add the following line before the px4 firmware setups. The content should look like:
source /opt/ros/melodic/setup.bash source ~/agi_ws/devel/setup.bash px4_dir=~/Firmware source $px4_dir/Tools/setup_gazebo.bash $px4_dir $px4_dir/build/px4_sitl_default export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$px4_dir export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$px4_dir/Tools/sitl_gazebo
In order to use the rpt_gui, we need to downgrade the PyQt5 to 5.10.1 to match the version rpt
pip install PyQt5==5.10.1
Open a new terminal to automatically source the bashrc file. Use launch file to put everything together
roslaunch agihawk run_px4_simulation.launch
git clone https://github.com/ethz-asl/rotors_simulator
sudo apt-get install ros-$ROS_DISTRO-joy ros-$ROS_DISTRO-octomap-msgs ros-$ROS_DISTRO-octomap-ros ros-$ROS_DISTRO-mavlink protobuf-compiler libgoogle-glog-dev ros-$ROS_DISTRO-control-toolbox ros-$ROS_DISTRO-gazebo-plugins
roslaunch agihawk run_rotors_simulation.launch