To install on a fresh Ubuntu VM, open a terminal and go through the following steps.
- wget https://raw.githubusercontent.com/darknight-007/Firmware/master/setup-install.sh
- bash setup-install.sh
(you will be asked for your password in the beginning)
Once installation is over,
- cd ~/src/Firmware
- make posix_sitl_default gazebo
It will take a bit the first time you run this. Also, if the build fails, try again. You should see a Gazebo client window with the F450 at the center.
In another terminal, run the mavros node
- roslaunch mavros px4.launch fcu_url:="udp://:14540@127.0.0.1:14557"
and, in yet another terminal
- cd ~/catkin_ws/src/mavros/test_mavros/scripts
- python mavros_wpmission_test.py
You will now see the UAV takeoff, fly a mission, and land again.
On a terminal, you can look at the list of mavros topics,
- rostopic list
And maybe check out the state of the FMU,
- rostopic echo /mavros/state
GAZEBO ROS
To acquire gazebo camera pugin data, we need to start the SITL stack with no_sim=1. In terminal 1,
- make no_sim=1 posix_sitl_default gazebo
In a bit, you should see the ASCII PX4 art, and a message "Waiting for initial data on UDP. Please start the flight simulator to proceed.."
At this time open another terminal, and use
- roslaunch mavros gazebo-mavros.launch gui:=true
You should now see both the Gazebo client, and an RQT window showing the image-view panels, and a line plot for UAV height. You will have to click the reload (circular arrow) buttons for the camera image streams to activate on RQT, and choose the front and down cameras respectively from the dropdowns. The height plot should start updating on its own.
The next step is the same as non gazebo_ros mode. That is, in another terminal
- cd ~/catkin_ws/src/mavros/test_mavros/scripts
- python mavros_wpmission_test.py
You should now see the UAV take off, and the camera images update accordingly.
*** It's advised that you close gazebo client at this time so that the controller simulation has maximum fidelity.
*** Do not use gui:=true when starting the gazebo-mavros.launch file for actual simulation use.
------ UPSTREAM INFO-----
This repository contains the PX4 Flight Core, with the main applications located in the src/modules directory. It also contains the PX4 Drone Platform, which contains drivers and middleware to run drones.
- Official Website: http://px4.io
- License: BSD 3-clause (see LICENSE.md)
- Supported airframes (more experimental are supported):
- Multicopters
- Fixed wing
- VTOL
- Releases
- Downloads
Please refer to the user documentation and user forum for flying drones with the PX4 flight stack.
This repository contains code supporting these boards:
- Snapdragon Flight
- FMUv1.x
- FMUv2.x (Pixhawk, Pixhawk 2 and Pixfalcon)
- FMUv4.x (Pixhawk X and Pixracer)
- AeroCore (v1 and v2)
- STM32F4Discovery (basic support) Tutorial