### module CLI Start Example Source: https://docs.px4.io/main/en/modules/modules_template.html Example command to start the template module with specific flags and parameters. ```bash module start -f -p 42 ``` -------------------------------- ### Start custom application in extras.txt Source: https://docs.px4.io/main/en/concept/system_startup.html Example content for /etc/extras.txt to start a custom application after main system boot. ```sh custom_app start ``` -------------------------------- ### Install PX4 development environment and simulator Source: https://docs.px4.io/main/en/ros/ros2_comm.html Clones the PX4-Autopilot repository, runs the setup script, and builds the SITL simulator. The setup script installs the recommended simulator; use the --no-sim-tools flag to keep an existing simulator installation. ```sh cd git clone https://github.com/PX4/PX4-Autopilot.git --recursive bash ./PX4-Autopilot/Tools/setup/ubuntu.sh cd PX4-Autopilot/ make px4_sitl ``` -------------------------------- ### Run the go-to example node Source: https://docs.px4.io/main/en/test_cards/mc_11_companion_ros2_external_mode.html Start the go-to example node on the companion computer. The console should show 'Registering 'Go-to Example'' followed by 'Got RegisterExtComponentReply' to confirm successful registration. ```sh ros2 run example_mode_goto_cpp example_mode_goto ``` -------------------------------- ### Start uxrce_dds_client with namespace Source: https://docs.px4.io/main/en/middleware/uxrce_dds.html Example command to start the client with a specific namespace using the -n flag. ```sh uxrce_dds_client start -n uav_1 ``` -------------------------------- ### Install Docker using convenience script Source: https://docs.px4.io/main/en/test_and_ci/docker.html Use the convenience script to install Docker on Ubuntu for non-production setups. ```sh curl -fsSL get.docker.com -o get-docker.sh sudo sh get-docker.sh ``` -------------------------------- ### VOXL ESC Start Example Source: https://docs.px4.io/main/en/modules/modules_driver.html Typical command to start the VOXL ESC module. ```bash todo ``` -------------------------------- ### Run Go-To Example Source: https://docs.px4.io/main/en/simulation/px4_sitl_prebuilt_packages.html Execute the bundled Go-To example from a host terminal while the Agent and PX4 are running. ```sh docker exec -it px4-ros2 /usr/local/bin/ros2-entrypoint.sh \ ros2 run example_mode_goto_cpp example_mode_goto ``` -------------------------------- ### batmon start example Source: https://docs.px4.io/main/en/modules/modules_driver.html Example command to start the BatMon smart battery driver at I2C address 0x0B on bus 4. Use the -X flag for external I2C bus and -a to set the address. ```text batmon start -X -a 11 -b 4 ``` -------------------------------- ### Download and run ubuntu.sh without full source Source: https://docs.px4.io/main/en/dev_setup/dev_env_linux.html Downloads only the setup script and requirements file, then runs the setup. Useful when you only need the development environment without the entire PX4 source code. ```sh wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/ubuntu.sh wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/requirements.txt bash ubuntu.sh ``` -------------------------------- ### Start uxrce_dds_client over serial or UDP Source: https://docs.px4.io/main/en/modules/modules_system.html Starts the UXRCE-DDS client using either a serial device or UDP. The serial example uses /dev/ttyS3 at 921600 baud; the UDP example connects to 127.0.0.1 on port 15555. ```shell uxrce_dds_client start -t serial -d /dev/ttyS3 -b 921600 ``` ```shell uxrce_dds_client start -t udp -h 127.0.0.1 -p 15555 ``` -------------------------------- ### Download and run setup scripts individually Source: https://docs.px4.io/main/en/dev_setup/dev_env_linux_arch.html Download the setup script and requirements file separately before executing the script. ```sh wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/arch.sh wget https://raw.githubusercontent.com/PX4/PX4-Autopilot/main/Tools/setup/requirements.txt bash arch.sh ``` -------------------------------- ### Run ubuntu.sh setup script Source: https://docs.px4.io/main/en/dev_setup/dev_env_linux.html Installs the full development environment for simulators and NuttX/Pixhawk. Acknowledge prompts during execution. Use --no-nuttx and --no-sim-tools to omit those components. Restart the computer after completion. ```sh bash ./PX4-Autopilot/Tools/setup/ubuntu.sh ``` -------------------------------- ### Preview and serve the library Source: https://docs.px4.io/main/en/contribute/docs.html Command to start the development/preview server. ```sh yarn start ``` -------------------------------- ### Start PCA9685 PWM output driver Source: https://docs.px4.io/main/en/modules/modules_driver.html Example command to start the PCA9685 driver with specific I2C address and bus parameters. ```bash pca9685_pwm_out start -X -a 0x40 -b 1 ``` -------------------------------- ### Restart WSL after setup Source: https://docs.px4.io/main/en/dev_setup/dev_env_windows_wsl.html Restart the WSL computer after the setup script completes: exit the shell, shut down WSL, and start WSL again. ```sh exit wsl --shutdown wsl ``` -------------------------------- ### Install PX4 and build the simulator Source: https://docs.px4.io/main/en/ros2/user_guide.html Sets up the PX4 development environment and builds the simulator. Run from the home directory; the ubuntu.sh script installs the recommended simulator for your Ubuntu version. Use the --no-sim-tools flag with ubuntu.sh to keep an existing simulator installation. ```sh cd git clone https://github.com/PX4/PX4-Autopilot.git --recursive bash ./PX4-Autopilot/Tools/setup/ubuntu.sh cd PX4-Autopilot/ make px4_sitl ``` -------------------------------- ### SITL startup output showing SITL COMMAND and PX4 startup Source: https://docs.px4.io/main/en/debug/simulation_debugging.html Example output from starting the simulation. It shows the SITL COMMAND line with the PX4 bin file path and build directory, followed by the PX4 banner and startup log lines including the autostart file and SYS_AUTOSTART value. ```shell SITL COMMAND: "" ""/etc ______ __ __ ___ | ___ \ \ \ / / / | | |_/ / \ V / / /| | | __/ / \ / /_| | | | / /^\ \ \___ | \_| \/ \/ |_/ px4 starting. INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0 INFO [init] found model autostart file as SYS_AUTOSTART=10015 ``` -------------------------------- ### Install clang and build PX4 with clang Source: https://docs.px4.io/main/en/flight_controller/raspberry_pi_navio2.html Installs clang from the Ubuntu repository and shows an example CMake build of PX4 firmware out of tree using clang. Requires GCC to be installed first. ```sh sudo apt-get install clang ``` ```sh cd mkdir build/px4_raspberrypi_default_clang cd build/px4_raspberrypi_default_clang cmake \ -G"Unix Makefiles" \ -DCONFIG=px4_raspberrypi_default \ -UCMAKE_C_COMPILER \ -DCMAKE_C_COMPILER=clang \ -UCMAKE_CXX_COMPILER \ -DCMAKE_CXX_COMPILER=clang++ \ ../.. make ``` -------------------------------- ### sony_asdt1 driver examples Source: https://docs.px4.io/main/en/modules/modules_driver_distance_sensor.html Example invocations for the Sony AS-DT1 serial driver. The start command requires a serial device via -d; adding -s sends a flash and prints the response instead of starting measurements. The status and stop commands are also shown. ```text sony_asdt1 start -d /dev/ttyS4 sony_asdt1 start -d /dev/ttyS4 -s sony_asdt1 status sony_asdt1 stop ``` -------------------------------- ### Source local_setup.bash Source: https://docs.px4.io/main/en/ros/ros2_offboard_control.html Sources the local_setup.bash to set up the built workspace environment. ```sh source install/local_setup.bash ``` -------------------------------- ### ft_technologies_serial start and stop examples Source: https://docs.px4.io/main/en/modules/modules_driver.html Shows how to start and stop the FT Technologies serial driver on a specified serial device. The start command requires a device path, and the stop command stops the driver. ```bash ft_technologies_serial start -d /dev/ttyS1 ``` ```bash ft_technologies_serial stop ``` -------------------------------- ### Start GDB for target bootloader (FMUv6X, FMUv6X-RT, FMUv5) Source: https://docs.px4.io/main/en/advanced_config/bootloader_update.html Run the appropriate command for the target bootloader (FMUv6X, FMUv6X-RT, or FMUv5) from the directory containing the bootloader binary. The bootloader .elf file must be built first. Note that H7 bootloaders from PX4/PX4-Autopilot are named with the pattern '*._bootloader.elf', while bootloaders from PX4/PX4-Bootloader are named with the pattern '*_bl.elf'. ```sh arm-none-eabi-gdb px4_fmu-v6x_bootloader.elf ``` ```sh arm-none-eabi-gdb px4_fmu-v6xrt_bootloader.elf ``` ```sh arm-none-eabi-gdb px4fmuv5_bl.elf ```