PX4 Development
Ubuntu Development Environment
On a clean Ubuntu environment (e.g., 18.04 LTS), we need to
Run the script ubuntu.sh to install PX4 related dependencies (both hardware and simulation)
use arg
--no-nuttx
to omit NuttX/Pixhawk toolsuse arg
--no-sim-tools
to omit jMAVSim and Gazebo9 simulator
Install ROS Melodic by following the official ROS Wiki.
Run the script ubuntu_sim_common_deps.sh to install common dependencies for simulation.
Install MAVROS by following the instructions in its official repository.
we use source installation for development
use
sudo
forinstall_geographiclib_datasets.sh
echo "source ~/catkin_ws/devel/setup.bash --extend" >> ~/.bashrc
Notes
ubuntu.sh
is needed for both hardware and simulationubuntu_sim_ros_melodic.sh
is not used/recommendedTo have more flexibility, we install three parts separately: ROS, sim dependencies, and MAVROS
Gazebo SITL Simulation
In order to run PX4 in Gazebo simulation, we have three more steps.
build PX4 source code to generate a Iris quadrotor model in Gazebo (i.e. the target)
set up environment variables
roslaunch Gazebo simulation and run offboard control program
Build Iris quadrotor model in Gazebo
Ser up environment variables
Run Offboard Control
launch SITL and MAVROS by
mavros_posix_sitl.launch
similar to
px4.launch
orposix_sitl.launch
run offboard control C++ program by
rosrun <package_name> offboard_node
References
PX4 documentation: Ubuntu Development Environment
provides two bash scripts:
ubuntu.sh
andubuntu_sim_ros_melodic.sh
build targets for Gazebo, jMAVSim, or NuttX
ROS/Gazebo and Raspberry Pi (armhf or aarch64)
PX4 documentation: MAVROS installation
PX4 documentation: ROS with Gazebo Simulation
set up environment variables
ROS launch files
PX4 documentation: MAVROS Offboard Control C++ Example
Last updated