Drone - umrover/mrover-ros GitHub Wiki

Setup

  1. Run the master install script by running: python3 -c "$(wget https://raw.githubusercontent.com/umrover/mrover-ros/master/install.py -O-)" --install-drone
    This will install ROS, create a Catkin workspace, and clone the necessary repositories. It also downloads the ground control software and everything you need to run the simulation.

  2. catkin build

  3. source /opt/ros/noetic/setup.bash (or .zsh)

  4. source ~/catkin_ws/devel/setup.bash (or .zsh)

(It's recommended to put 3-4 in a function in your bash/zshrc):

src-ros() {
	source /opt/ros/noetic/setup.zsh
	source ~/catkin_ws/devel/setup.zsh
}
  1. Similar to 3-4, either run or put these lines in a function in your bash/zshrc:
setup-drone() {
	cwd=$(pwd)
	cd ~/catkin_ws/src/px4

	DONT_RUN=1 make px4_sitl_default gazebo
	source Tools/simulation/gazebo/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default
	export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)
	export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/simulation/gazebo/sitl_gazebo

        cd $cwd
}
  1. Launch the ground control software by navigating to wherever you downloaded it to (in the install script) and run ./QGroundControl
  2. Launch the drone and simulation: roslaunch mrover drone.launch
  3. Once the simulation starts up, ensure that typing "commander takeoff" and "commander land" make the drone takeoff and land, respectively, in the simulation.