Comment on page
PX4 Development
On a clean Ubuntu environment (e.g., 18.04 LTS), we need to
- use arg
--no-nuttx
to omit NuttX/Pixhawk tools - use arg
--no-sim-tools
to omit jMAVSim and Gazebo9 simulator
- we use source installation for development
- use
sudo
forinstall_geographiclib_datasets.sh
echo "source ~/catkin_ws/devel/setup.bash --extend" >> ~/.bashrc
ubuntu.sh
is needed for both hardware and simulation- To have more flexibility, we install three parts separately: ROS, sim dependencies, and MAVROS
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
git clone [email protected]:UCR-Robotics/PX4-Autopilot.git --recursive
cd PX4-Autopilot
DONT_RUN=1 make px4_sitl_default gazebo
# iris.sdf will be generated in PX4-Autopilot/Tools/sitl_gazebo/models/iris
# may add the following to ~/.bashrc
PX4_SRC_DIR=~/PX4-Autopilot
export GAZEBO_PLUGIN_PATH=$GAZEBO_PLUGIN_PATH:${PX4_SRC_DIR}/build/px4_sitl_default/build_gazebo
export GAZEBO_MODEL_PATH=$GAZEBO_MODEL_PATH:${PX4_SRC_DIR}/Tools/sitl_gazebo/models
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${PX4_SRC_DIR}/build/px4_sitl_default/build_gazebo
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:${PX4_SRC_DIR}
export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:${PX4_SRC_DIR}/Tools/sitl_gazebo
- similar to
px4.launch
orposix_sitl.launch
- run offboard control C++ program by
rosrun <package_name> offboard_node
- 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)
- set up environment variables
- ROS launch files
Last modified 2yr ago