From d232302ff575d4266c1fb4606fa39a2636eb3973 Mon Sep 17 00:00:00 2001 From: Hamish Willee Date: Tue, 27 Nov 2018 12:01:20 +1100 Subject: [PATCH] Update to new build config targets --- en/advanced/switching_state_estimators.md | 4 +- en/airframes/adding_a_new_frame.md | 6 +- en/apps/hello_sky.md | 27 +- en/concept/system_startup.md | 2 +- en/debug/gdb_debugging.md | 8 +- en/debug/profiling.md | 8 +- en/debug/simulation_debugging.md | 16 +- en/debug/system_wide_replay.md | 18 +- en/hardware/porting_guide.md | 10 +- en/log/logging.md | 3 +- en/middleware/micrortps.md | 4 +- .../micrortps_manual_code_generation.md | 2 +- en/ros/external_position_estimation.md | 2 +- en/sensor_bus/i2c.md | 2 +- en/setup/building_px4.md | 77 ++-- en/setup/dev_env_windows_bash_on_win.md | 8 +- en/setup/dev_env_windows_cygwin.md | 4 +- en/simulation/README.md | 22 +- en/simulation/gazebo.md | 12 +- en/simulation/hitl.md | 4 +- en/simulation/jmavsim.md | 6 +- en/simulation/multi-vehicle-simulation.md | 6 +- en/simulation/multi_vehicle_jmavsim.md | 2 +- en/simulation/ros_interface.md | 10 +- en/software_update/stm32_bootloader.md | 4 +- en/test_and_ci/continous_integration.md | 3 +- en/test_and_ci/docker.md | 4 +- kr/concept/system_startup.md | 2 +- kr/debug/gdb_debugging.md | 10 +- kr/debug/profiling.md | 4 +- kr/debug/simulation_debugging.md | 14 +- kr/debug/system_wide_replay.md | 12 +- kr/middleware/drivers.md | 2 +- kr/middleware/micrortps.md | 6 +- .../micrortps_manual_code_generation.md | 2 +- kr/ros/external_position_estimation.md | 2 +- kr/setup/building_px4.md | 338 +++++++++------- kr/setup/dev_env_windows.md | 4 +- kr/simulation/gazebo.md | 8 +- kr/simulation/jmavsim.md | 4 +- kr/simulation/multi-vehicle-simulation.md | 4 +- kr/simulation/ros_interface.md | 8 +- kr/test_and_ci/continous_integration.md | 2 +- kr/test_and_ci/docker.md | 2 +- kr/tutorials/tutorial_hello_sky.md | 15 +- zh/concept/system_startup.md | 2 +- zh/debug/gdb_debugging.md | 8 +- zh/debug/profiling.md | 4 +- zh/debug/simulation_debugging.md | 16 +- zh/debug/system_wide_replay.md | 12 +- zh/middleware/drivers.md | 2 +- zh/middleware/micrortps.md | 4 +- .../micrortps_manual_code_generation.md | 2 +- zh/ros/external_position_estimation.md | 2 +- zh/setup/building_px4.md | 376 ++++++++++-------- zh/simulation/gazebo.md | 10 +- zh/simulation/jmavsim.md | 4 +- zh/simulation/multi-vehicle-simulation.md | 4 +- zh/simulation/ros_interface.md | 8 +- zh/test_and_ci/continous_integration.md | 3 +- zh/test_and_ci/docker.md | 2 +- zh/tutorials/tutorial_hello_sky.md | 17 +- 62 files changed, 645 insertions(+), 544 deletions(-) diff --git a/en/advanced/switching_state_estimators.md b/en/advanced/switching_state_estimators.md index b8f83457c63..f646d5e981b 100644 --- a/en/advanced/switching_state_estimators.md +++ b/en/advanced/switching_state_estimators.md @@ -22,4 +22,6 @@ For multirotors and VTOL use the parameter [SYS_MC_EST_GROUP](../advanced/parame | 1 | enabled | | enabled | | | 2 | | | | enabled | -> **Note** For FMU-v2 (only) you will also need to build PX4 to specifically include required estimator (e.g. EKF2: `make px4fmu-v2`, LPE: `make px4fmu-v2_lpe`). This is required because FMU-v2 is too resource constrained to include both estimators. Other Pixhawk FMU versions include both. +> **Note** For FMU-v2 (only) you will also need to build PX4 to specifically include required estimator (e.g. EKF2: `make px4_fmu-v2`, LPE: `make px4_fmu-v2_lpe`). + This is required because FMU-v2 is too resource constrained to include both estimators. + Other Pixhawk FMU versions include both. diff --git a/en/airframes/adding_a_new_frame.md b/en/airframes/adding_a_new_frame.md index a6cdcab9b0c..aff0b58dfef 100644 --- a/en/airframes/adding_a_new_frame.md +++ b/en/airframes/adding_a_new_frame.md @@ -222,16 +222,14 @@ The following *PX4 User Guide* topics explain how to tune the parameters that wi To make a new airframe available for section in the *QGroundControl* [airframe configuration](https://docs.px4.io/en/config/airframe.html): -1. Make a clean build (e.g. by running `make clean` and then `make px4fmu-v5_default`) +1. Make a clean build (e.g. by running `make clean` and then `make px4_fmu-v5_default`) 1. Open QGC and select **Custom firmware file...** as shown below: ![QGC flash custom firmware](../../assets/gcs/qgc_flash_custom_firmware.png) You will be asked to choose the **.px4** firmware file to flash (this file is a zipped JSON file and contains the airframe metadata). -1. Navigate to the build folder and select the firmware file (e.g. **Firmware/build/nuttx_px4fmu-v5_default/px4fmu-v5_default.px4**). +1. Navigate to the build folder and select the firmware file (e.g. **Firmware/build/px4_fmu-v5_default/px4_fmu-v5_default.px4**). 1. Press **OK** to start flashing the firmware. 1. Restart *QGroundControl*. The new airframe will then be available for selection in *QGroundControl*. - - diff --git a/en/apps/hello_sky.md b/en/apps/hello_sky.md index bf5937d687c..95250002b43 100644 --- a/en/apps/hello_sky.md +++ b/en/apps/hello_sky.md @@ -138,12 +138,13 @@ In this section we create a *minimal application* that just prints out `Hello Sk ## Build the Application/Firmware -The application is now complete. In order to run it you first need to make sure that it is built as part of PX4. Applications are added to the build/firmware in the appropriate board-level *cmake* file for your target: +The application is now complete. In order to run it you first need to make sure that it is built as part of PX4. +Applications are added to the build/firmware in the appropriate board-level *cmake* file for your target: -* Posix SITL (Simulator): [Firmware/cmake/configs/posix_sitl_default.cmake](https://github.com/PX4/Firmware/blob/master/cmake/configs/posix_sitl_default.cmake) -* Pixhawk v1/2: [Firmware/cmake/configs/nuttx_px4fmu-v2_default.cmake](https://github.com/PX4/Firmware/blob/master/cmake/configs/nuttx_px4fmu-v2_default.cmake) -* Pixracer: [Firmware/cmake/configs/nuttx_px4fmu-v4_default.cmake](https://github.com/PX4/Firmware/blob/master/cmake/configs/nuttx_px4fmu-v4_default.cmake) -* *cmake* files for other boards can be found in [Firmware/cmake/configs/](https://github.com/PX4/Firmware/blob/master/cmake/configs/) +* PX4 SITL (Simulator): [Firmware/boards/px4/sitl/default.cmake](https://github.com/PX4/Firmware/blob/master/boards/px4/sitl/default.cmake) +* Pixhawk v1/2: [Firmware/boards/px4/fmu-v2/default.cmake](https://github.com/PX4/Firmware/blob/master/boards/px4/fmu-v2/default.cmake) +* Pixracer (px4/fmu-v4): [Firmware/boards/px4/fmu-v4/default.cmake](https://github.com/PX4/Firmware/blob/master/boards/px4/fmu-v4/default.cmake) +* *cmake* files for other boards can be found in [Firmware/boards/](https://github.com/PX4/Firmware/tree/master/boards) To enable the compilation of the application into the firmware create a new line for your application somewhere in the *cmake* file: @@ -155,9 +156,9 @@ examples/px4_simple_app Build the example using the board-specific command: -* jMAVSim Simulator: `make posix_sitl_default jmavsim` -* Pixhawk v1/2: `make px4fmu-v2_default` -* Pixhawk v3: `make px4fmu-v4_default` +* jMAVSim Simulator: `make px4_sitl_default jmavsim` +* Pixhawk v1/2: `make px4_fmu-v2_default` (or just `make px4_fmu-v2`) +* Pixhawk v3: `make px4_fmu-v4_default` * Other boards: [Building the Code](../setup/building_px4.md#building_nuttx) @@ -167,8 +168,8 @@ Build the example using the board-specific command: Enable the uploader and then reset the board: -* Pixhawk v1/2: `make px4fmu-v2_default upload` -* Pixhawk v3: `make px4fmu-v4_default upload` +* Pixhawk v1/2: `make px4_fmu-v2_default upload` +* Pixhawk v3: `make px4_fmu-v4_default upload` It should print before you reset the board a number of compile messages and at the end: @@ -189,7 +190,8 @@ Rebooting. ### Connect the Console -Now connect to the [system console](../debug/system_console.md) either via serial or USB. Hitting **ENTER** will bring up the shell prompt: +Now connect to the [system console](../debug/system_console.md) either via serial or USB. +Hitting **ENTER** will bring up the shell prompt: ```sh nsh> @@ -230,7 +232,8 @@ The application is now correctly registered with the system and can be extended ## Test App (SITL) -If you're using SITL the *PX4 console* is automatically started (see [Building the Code > First Build (Using the jMAVSim Simulator)](../setup/building_px4.md#jmavsim_build)). As with the *nsh console* (see previous section) you can type `help` to see the list of built-in apps. +If you're using SITL the *PX4 console* is automatically started (see [Building the Code > First Build (Using the jMAVSim Simulator)](../setup/building_px4.md#jmavsim_build)). +As with the *nsh console* (see previous section) you can type `help` to see the list of built-in apps. Enter `px4_simple_app` to run the minimal app. diff --git a/en/concept/system_startup.md b/en/concept/system_startup.md index 9dc60501918..69a9ca79a61 100644 --- a/en/concept/system_startup.md +++ b/en/concept/system_startup.md @@ -30,7 +30,7 @@ For that to work, a few things are required: The modules can be executed from any terminal when PX4 is already running on a system. For example: ``` -cd /build/posix_sitl_default/bin +cd /build/px4_sitl_default/bin ./px4-commander takeoff ./px4-listener sensor_accel ``` diff --git a/en/debug/gdb_debugging.md b/en/debug/gdb_debugging.md index 60a37a225e5..449fd36983f 100644 --- a/en/debug/gdb_debugging.md +++ b/en/debug/gdb_debugging.md @@ -7,7 +7,7 @@ The autopilots running PX4 support debugging via GDB or LLDB. The command below will list the largest static allocations: ```bash -arm-none-eabi-nm --size-sort --print-size --radix=dec build/nuttx_px4fmu-v2_default/nuttx_px4fmu-v2_default.elf | grep " [bBdD] " +arm-none-eabi-nm --size-sort --print-size --radix=dec build/px4_fmu-v2_default/px4_fmu-v2_default.elf | grep " [bBdD] " ``` This NSH command provides the remaining free memory: @@ -39,13 +39,13 @@ sudo apt-get install google-perftools libgoogle-perftools-dev First of all, build the firmware as follows: ```bash -make posix_sitl_default +make px4_sitl_default ``` Start jmavsim: `./Tools/jmavsim_run.sh` In another terminal, type: ```bash -cd build/posix_sitl_default/tmp +cd build/px4_sitl_default/tmp export HEAPPROFILE=/tmp/heapprofile.hprof export HEAP_PROFILE_TIME_INTERVAL=30 ``` @@ -127,7 +127,7 @@ EXC_RETURN: ffffffe9 To decode the hard fault, load the *exact* binary into the debugger: ```bash -arm-none-eabi-gdb build/nuttx_px4fmu-v2_default/nuttx_px4fmu-v2_default.elf +arm-none-eabi-gdb build/px4_fmu-v2_default/px4_fmu-v2_default.elf ``` Then in the GDB prompt, start with the last instructions in R8, with the first address in flash (recognizable because it starts with `0x080`, the first is `0x0808439f`). The execution is left to right. So one of the last steps before the hard fault was when ```mavlink_log.c``` tried to publish something, diff --git a/en/debug/profiling.md b/en/debug/profiling.md index 3f530f3c19d..78d12ef7a5b 100644 --- a/en/debug/profiling.md +++ b/en/debug/profiling.md @@ -13,10 +13,10 @@ The folded stacks are then fed into the visualization script, for which purpose ## Basic Usage Basic usage of the profiler is available through the build system. -For example, the following command builds and profiles px4fmu-v4pro target with 10000 samples (fetching FlameGraph and adding it to the path as needed). +For example, the following command builds and profiles px4_fmu-v4pro target with 10000 samples (fetching *FlameGraph* and adding it to the path as needed). ``` -make px4fmu-v4pro_default profile +make px4_fmu-v4pro_default profile ``` For more control over the build process, including setting the number of samples, see the [Implementation](#implementation). @@ -70,14 +70,14 @@ This is done with the help of the option `--elf=`, which expects a path (r Usage example: ```bash -./poor-mans-profiler.sh --elf=build/nuttx_px4fmu-v4_default/nuttx_px4fmu-v4_default.elf --nsamples=30000 +./poor-mans-profiler.sh --elf=build/px4_fmu-v4_default/px4_fmu-v4_default.elf --nsamples=30000 ``` Note that every launch of the script will overwrite the old stacks. Should you want to append to the old stacks rather than overwrite them, use the option `--append`: ```bash -./poor-mans-profiler.sh --elf=build/nuttx_px4fmu-v4_default/nuttx_px4fmu-v4_default.elf --nsamples=30000 --append +./poor-mans-profiler.sh --elf=build/px4_fmu-v4_default/px4_fmu-v4_default.elf --nsamples=30000 --append ``` As one might suspect, `--append` with `--nsamples=0` will instruct the script to only regenerate the SVG without accessing the target at all. diff --git a/en/debug/simulation_debugging.md b/en/debug/simulation_debugging.md index 31f00bc5d70..03b11feec40 100644 --- a/en/debug/simulation_debugging.md +++ b/en/debug/simulation_debugging.md @@ -8,7 +8,7 @@ The Clang address sanitizer can help to find alignment (bus) errors and other me ```sh make clean # only required on first address sanitizer run after a normal build -PX4_ASAN=1 make posix jmavsim +PX4_ASAN=1 make px4_sitl jmavsim ``` ## Valgrind @@ -30,13 +30,13 @@ sudo apt-get install valgrind SITL can be launched with and without debugger attached and with either jMAVSim or Gazebo as simulation backend. This results in the start options below: ```sh -make posix_sitl_default jmavsim -make posix_sitl_default jmavsim___gdb -make posix_sitl_default jmavsim___lldb +make px4_sitl_default jmavsim +make px4_sitl_default jmavsim___gdb +make px4_sitl_default jmavsim___lldb -make posix_sitl_default gazebo -make posix_sitl_default gazebo___gdb -make posix_sitl_default gazebo___lldb +make px4_sitl_default gazebo +make px4_sitl_default gazebo___gdb +make px4_sitl_default gazebo___lldb make posix_sitl_lpe jmavsim make posix_sitl_lpe jmavsim___gdb @@ -44,7 +44,7 @@ make posix_sitl_lpe jmavsim___lldb make posix_sitl_lpe gazebo make posix_sitl_lpe gazebo___gdb -make posix_sitl_lpe gazebo___lldb +make posix_sitl_lpe gazebo___lldb ``` where the last parameter is the <viewer\_model\_debugger> triplet (using three underscores implies the default 'iris' model). diff --git a/en/debug/system_wide_replay.md b/en/debug/system_wide_replay.md index bc1fb947684..843e856a9b8 100644 --- a/en/debug/system_wide_replay.md +++ b/en/debug/system_wide_replay.md @@ -27,17 +27,17 @@ Reasons for this are given below. - First, choose the file to replay, and build the target (from within the Firmware directory): -```sh -export replay= -make posix_sitl_default -``` + ```sh + export replay= + make px4_sitl_default + ``` This will create the output in a separate build directory - `build/posix_sitl_default_replay` (so that the parameters don't interfere with + `build/px4_sitl_default_replay` (so that the parameters don't interfere with normal builds). It's possible to choose any posix SITL build target for replay, the build system knows through the `replay` environment variable that it's in replay mode. - Add ORB publisher rules file in - `build/posix_sitl_default_replay/tmp/rootfs/orb_publisher.rules`. + `build/px4_sitl_default_replay/tmp/rootfs/orb_publisher.rules`. This file defines which module is allowed to publish which messages. It has the following format: ``` @@ -62,7 +62,7 @@ ignore_others: true to be disabled for replay. - Optional: setup parameter overrides in the file - `build/posix_sitl_default_replay/tmp/rootfs/replay_params.txt`. + `build/px4_sitl_default_replay/tmp/rootfs/replay_params.txt`. This file should contain a list of ` `, like: ``` EKF2_GB_NOISE 0.001 @@ -75,7 +75,7 @@ EKF2_GB_NOISE 0.001 directory. Only necessary if a mission should be replayed. - Start the replay: ```sh - make posix_sitl_default jmavsim + make px4_sitl_default jmavsim ``` This will automatically open the log file, apply the parameters and start to replay. Once done, it will be reported and the process can be exited. Then @@ -127,7 +127,7 @@ The parameters can be adjusted as well. They can be extracted from the log with \(install pyulog with `sudo pip install pyulog` first\): ``` -ulog_params -i $replay -d ' ' | grep -e '^EKF2' > build/posix_sitl_default_replay/tmp/rootfs/replay_params.txt +ulog_params -i $replay -d ' ' | grep -e '^EKF2' > build/px4_sitl_default_replay/tmp/rootfs/replay_params.txt ``` Then edit the parameters in the file as needed and restart the replay process with `make posix none`. This will create a new log file. diff --git a/en/hardware/porting_guide.md b/en/hardware/porting_guide.md index 060a4238949..e7596857dff 100644 --- a/en/hardware/porting_guide.md +++ b/en/hardware/porting_guide.md @@ -13,7 +13,7 @@ This guide is focused only on the host OS and middleware as the applications/fli In addition to the host operating system specific configuration files described below, there are several groups of configuration files for each board located throughout the code base: * Board startup and configuration files are located in: [src/drivers/boards](https://github.com/PX4/Firmware/tree/master/src/drivers/boards). * This folder contains bus mappings, GPIO mappings, and the initialization code for each board. - * FMUv5 example: [src/drivers/boards/px4fmu-v5](https://github.com/PX4/Firmware/tree/master/src/drivers/boards/px4fmu-v5). + * FMUv5 example: [src/drivers/boards/px4fmu-v5](https://github.com/PX4/Firmware/tree/master/src/drivers/boards/px4fmu-v5). * The boot file system (startup script) is located in: [ROMFS/px4fmu\_common](https://github.com/PX4/Firmware/tree/master/ROMFS/px4fmu_common) * The board specific build configurations are located in: [cmake/configs/](https://github.com/PX4/Firmware/blob/master/cmake/configs/). * Driver files are located in: [src/drivers](https://github.com/PX4/Firmware/tree/master/src/drivers). @@ -31,11 +31,11 @@ For all NuttX based flight controllers (e.g. the Pixhawk series) the OS is loade The configuration files for NuttX based boards, including linker scripts and other required settings are located under [platforms/nuttx/nuttx-configs](https://github.com/PX4/Firmware/tree/master/platforms/nuttx/nuttx-configs). The following example uses FMUv5 as it is a recent [reference configuration](../debug/reference-design.md) for NuttX based flight controllers: -* Running `make px4fmu-v5_default` from the `src/Firmware` directory will build the FMUv5 config +* Running `make px4_fmu-v5_default` from the **Firmware** directory will build the FMUv5 config * The base FMUv5 configuration files are located in: [platforms/nuttx/nuttx-configs/px4fmu-v5](https://github.com/PX4/Firmware/tree/master/platforms/nuttx/nuttx-configs/px4fmu-v5). * Board specific header: [platforms/nuttx/nuttx-configs/px4fmu-v5/include/board.h](https://github.com/PX4/Firmware/blob/master/platforms/nuttx/nuttx-configs/px4fmu-v5/include/board.h). * NuttX OS config (created with Nuttx menuconfig): [nuttx-configs/px4fmu-v5/nsh/defconfig](https://github.com/PX4/Firmware/blob/master/platforms/nuttx/nuttx-configs/px4fmu-v5/nsh/defconfig). -* Build configuration: [cmake/configs/nuttx\_px4fmu-v5\_default.cmake](https://github.com/PX4/Firmware/blob/master/cmake/configs/nuttx_px4fmu-v5_default.cmake). +* Build configuration: [PX4/Firmware/boards/px4/fmu-v5/default.cmake](https://github.com/PX4/Firmware/blob/master/boards/px4/fmu-v5/default.cmake). The function of each of these files, and perhaps more, will need to be duplicated for a new flight controller board. @@ -43,8 +43,8 @@ The function of each of these files, and perhaps more, will need to be duplicate If you need to modify the NuttX OS configuration, you can do this via [menuconfig](https://bitbucket.org/nuttx/nuttx) using the PX4 shortcuts: ```sh -make px4fmu-v5_default menuconfig -make px4fmu-v5_default qconfig +make px4_fmu-v5_default menuconfig +make px4_fmu-v5_default qconfig ``` For fresh installs of PX4 onto Ubuntu using [ubuntu_sim_nuttx.sh](https://raw.githubusercontent.com/PX4/Devguide/master/build_scripts/ubuntu_sim_nuttx.sh) you will also need to install *kconfig* tools from [NuttX tools](https://bitbucket.org/nuttx/tools/src/master/). diff --git a/en/log/logging.md b/en/log/logging.md index 100450385fe..2d24f0cc5ab 100644 --- a/en/log/logging.md +++ b/en/log/logging.md @@ -22,9 +22,10 @@ for a list of all supported logger commands and parameters. ## Configuration + The list of logged topics can be customized with a file on the SD card. Create a file `etc/logging/logger_topics.txt` on the card with a list of topics (For -SITL, it's `build/posix_sitl_default/tmp/rootfs/fs/microsd/etc/logging/logger_topics.txt`): +SITL, it's `build/px4_sitl_default/tmp/rootfs/fs/microsd/etc/logging/logger_topics.txt`): ``` , ``` diff --git a/en/middleware/micrortps.md b/en/middleware/micrortps.md index 581eb88ba0b..cc54943864d 100644 --- a/en/middleware/micrortps.md +++ b/en/middleware/micrortps.md @@ -144,9 +144,9 @@ rtps: The *Client* source code is generated, compiled and built into the PX4 firmware as part of the normal build process. To build the firmware for NuttX/Pixhawk flight controllers use the `_rtps` feature in the configuration target. -For example, to build RTPS for px4fmu-v4: +For example, to build RTPS for px4_fmu-v4: ```sh -make px4fmu-v4_rtps +make px4_fmu-v4_rtps ``` To build the firmware for a SITL POSIX target: diff --git a/en/middleware/micrortps_manual_code_generation.md b/en/middleware/micrortps_manual_code_generation.md index 4e4c843c2e7..2972ce436da 100644 --- a/en/middleware/micrortps_manual_code_generation.md +++ b/en/middleware/micrortps_manual_code_generation.md @@ -141,7 +141,7 @@ The manually generated *Client* code is built and used in *exactly* the same way Specifically, once manually generated, the *Client* source code is compiled and built into the PX4 firmware as part of the normal build process. For example, to compile the code and include it in firmware for NuttX/Pixhawk targets: ```sh -make px4fmu-v4_default upload +make px4_fmu-v4_default upload ``` > **Note** You must first [disable automatic bridge code generation](#disable-automatic-bridge-code-generation) so that the toolchain uses the manually generated source code (and does not attempt to regenerate it). diff --git a/en/ros/external_position_estimation.md b/en/ros/external_position_estimation.md index 06be8cd62dd..7f462877fcf 100644 --- a/en/ros/external_position_estimation.md +++ b/en/ros/external_position_estimation.md @@ -1,6 +1,6 @@ # Using Vision or Motion Capture Systems -> **Info** Before following the instructions below, ensure that your autopilot has a firmware version with the LPE modules enabled. The LPE version of the PX4 firmware can be found inside the zip file of the latest PX4 release or it can be built from source using a build command such as `make px4fmu-v2_lpe`. See [Building the Code](../setup/building_px4.md) for more details. +> **Info** Before following the instructions below, ensure that your autopilot has a firmware version with the LPE modules enabled. The LPE version of the PX4 firmware can be found inside the zip file of the latest PX4 release or it can be built from source using a build command such as `make px4_fmu-v2_lpe`. See [Building the Code](../setup/building_px4.md) for more details. This page aims at getting a PX4 based system using position data from sources other than GPS (such as motion capture systems like VICON and Optitrack and vision based estimation systems like [ROVIO](https://github.com/ethz-asl/rovio), [SVO](https://github.com/uzh-rpg/rpg_svo) or [PTAM](https://github.com/ethz-asl/ethzasl_ptam) ) diff --git a/en/sensor_bus/i2c.md b/en/sensor_bus/i2c.md index 5ec4563298e..c439f7b568f 100644 --- a/en/sensor_bus/i2c.md +++ b/en/sensor_bus/i2c.md @@ -21,7 +21,7 @@ To include a driver in firmware you must add the driver to the [cmake config fil drivers/sf1xx ``` -> **Tip** For example, you can see/search for this driver in the [px4fmu-v4_default](https://github.com/PX4/Firmware/blob/master/cmake/configs/nuttx_px4fmu-v4_default.cmake) configuration. +> **Tip** For example, you can see/search for this driver in the [px4_fmu-v4_default](https://github.com/PX4/Firmware/blob/master/boards/px4/fmu-v4/default.cmake) configuration. ## I2C Driver Examples diff --git a/en/setup/building_px4.md b/en/setup/building_px4.md index 1db327128d7..cb852f90452 100644 --- a/en/setup/building_px4.md +++ b/en/setup/building_px4.md @@ -58,7 +58,7 @@ For the first build we'll build for a simulated target using a console environme Navigate into the **Firmware** directory and start [jMAVSim](../simulation/jmavsim.md) using the following command: ```sh -make posix jmavsim +make px4_sitl jmavsim ``` This will bring up the PX4 console below: @@ -87,36 +87,38 @@ Flying the simulation with the ground control station is closer to the real oper To build for NuttX- or Pixhawk- based boards, navigate into the **Firmware** directory and then call `make` with the build target for your board. -> **Note** In the example below the first part of the build target `px4fmu-v4` is the autopilot hardware version and `default` is the configuration name (in this case the "default" configuration). All PX4 build targets follow this logic). +> **Note** In the example below the first part of the build target `px4_fmu-v4` is the autopilot hardware version and `default` is the configuration name (in this case the "default" configuration). All PX4 build targets follow this logic). For example, to build for *Pixracer* you would use the following command: ```sh cd Firmware -make px4fmu-v4_default +make px4_fmu-v4_default ``` A successful run will end with similar output to: ```sh --- Build files have been written to: /home/youruser/src/Firmware/build/nuttx_px4fmu-v4_default -[954/954] Creating /home/youruser/src/Firmware/build/nuttx_px4fmu-v4_default/px4fmu-v4_default.px4 +-- Build files have been written to: /home/youruser/src/Firmware/build/px4_fmu-v4_default +[954/954] Creating /home/youruser/src/Firmware/build/px4_fmu-v4_default/px4_fmu-v4_default.px4 ``` The following list shows the build commands for common boards: -* Pixhawk 4: `make px4fmu-v5_default` -* [Pixracer](https://docs.px4.io/en/flight_controller/pixracer.html): `make px4fmu-v4_default` -* [Pixhawk 3 Pro](https://docs.px4.io/en/flight_controller/pixhawk3_pro.html): `make px4fmu-v4pro_default` -* [Pixhawk Mini](https://docs.px4.io/en/flight_controller/pixhawk_mini.html): `make px4fmu-v3_default` -* [Pixhawk 2](https://docs.px4.io/en/flight_controller/pixhawk-2.html): `make px4fmu-v3_default` -* [mRo Pixhawk](https://docs.px4.io/en/flight_controller/mro_pixhawk.html): `make px4fmu-v3_default` (supports 2MB Flash) -* [HKPilot32](https://docs.px4.io/en/flight_controller/HKPilot32.html): `make px4fmu-v2_default` -* [Pixfalcon](https://docs.px4.io/en/flight_controller/pixfalcon.html): `make px4fmu-v2_default` -* [Dropix](https://docs.px4.io/en/flight_controller/dropix.html): `make px4fmu-v2_default` -* [MindPX](https://docs.px4.io/en/flight_controller/mindpx.html)/[MindRacer](https://docs.px4.io/en/flight_controller/mindracer.html): `make mindpx-v2_default` -* [mRo X-2.1](https://docs.px4.io/en/flight_controller/mro_x2.1.html): `make auav-x21_default` -* [Crazyflie 2.0](https://docs.px4.io/en/flight_controller/crazyflie2.html): `make crazyflie_default` -* [Intel® Aero Ready to Fly Drone](https://docs.px4.io/en/flight_controller/intel_aero.html): `make aerofc-v1_default` -* [Pixhawk 1](https://docs.px4.io/en/flight_controller/pixhawk.html): `make px4fmu-v2_default` +* Pixhawk 4: `make px4_fmu-v5_default` +* [Pixracer](https://docs.px4.io/en/flight_controller/pixracer.html): `make px4_fmu-v4_default` +* [Pixhawk 3 Pro](https://docs.px4.io/en/flight_controller/pixhawk3_pro.html): `make px4_fmu-v4pro_default` +* [Pixhawk Mini](https://docs.px4.io/en/flight_controller/pixhawk_mini.html): `make px4_fmu-v3_default` +* [Pixhawk 2](https://docs.px4.io/en/flight_controller/pixhawk-2.html): `make px4_fmu-v3_default` +* [mRo Pixhawk](https://docs.px4.io/en/flight_controller/mro_pixhawk.html): `make px4_fmu-v3_default` (supports 2MB Flash) +* [HKPilot32](https://docs.px4.io/en/flight_controller/HKPilot32.html): `make px4_fmu-v2_default` +* [Pixfalcon](https://docs.px4.io/en/flight_controller/pixfalcon.html): `make px4_fmu-v2_default` +* [Dropix](https://docs.px4.io/en/flight_controller/dropix.html): `make px4_fmu-v2_default` +* [MindPX](https://docs.px4.io/en/flight_controller/mindpx.html)/[MindRacer](https://docs.px4.io/en/flight_controller/mindracer.html): `make airmind_mindpx-v2_default` +* [mRo X-2.1](https://docs.px4.io/en/flight_controller/mro_x2.1.html): `make auav_x21_default` +* [Crazyflie 2.0](https://docs.px4.io/en/flight_controller/crazyflie2.html): `make bitcraze_crazyflie_default` +* [Intel® Aero Ready to Fly Drone](https://docs.px4.io/en/flight_controller/intel_aero.html): `make intel_aerofc-v1_default` +* [Pixhawk 1](https://docs.px4.io/en/flight_controller/pixhawk.html): `make px4_fmu-v2_default` > **Warning** You **must** use a [supported version of GCC](../setup/dev_env_linux_ubuntu.md#nuttx-based-hardware) to build this board (e.g. the same as used by [CI/docker](../test_and_ci/docker.md)) or remove modules from the build. Building with an unsupported GCC may fail, as PX4 is close to the board's 1MB flash limit. -* Pixhawk 1 with 2 MB flash: `make px4fmu-v3_default` +* Pixhawk 1 with 2 MB flash: `make px4_fmu-v3_default` + +> **Note** Generally the `_default` suffix is optional (i.e. you can also build using `make px4_fmu-v4`, `make bitcraze_crazyflie`, etc.). ### Uploading Firmware (Flashing the board) @@ -124,7 +126,7 @@ The following list shows the build commands for common boards: Append `upload` to the make commands to upload the compiled binary to the autopilot hardware via USB. For example ```sh -make px4fmu-v4_default upload +make px4_fmu-v4_default upload ``` A successful run will end with this output: @@ -150,10 +152,10 @@ The command below builds the target for [Raspberry Pi 2/3 Navio2](https://docs.p ```sh cd Firmware -make posix_rpi_cross # for cross-compiler build +make emlid_navio2_cross # for cross-compiler build ``` -The "px4" executable file is in the directory **build/posix_rpi_cross/**. +The "px4" executable file is in the directory **build/emlid_navio2_cross/**. Make sure you can connect to your RPi over ssh, see [instructions how to access your RPi](https://docs.px4.io/en/flight_controller/raspberry_pi_navio2.html#developer-quick-start). Then set the IP (or hostname) of your RPi using: @@ -166,7 +168,7 @@ And upload it with: ```sh cd Firmware -make posix_rpi_cross upload # for cross-compiler build +make emlid_navio2_cross upload # for cross-compiler build ``` Then, connect over ssh and run it with (as root): @@ -177,18 +179,18 @@ sudo ./bin/px4 -s px4.config #### Native Build -If you're building *directly* on the Pi, you will want the native build target (posix_rpi_native). +If you're building *directly* on the Pi, you will want the native build target (emlid_navio2_native). ```sh cd Firmware -make posix_rpi_native # for native build +make emlid_navio2_native # for native build ``` -The "px4" executable file is in the directory **build/posix_rpi_native/**. +The "px4" executable file is in the directory **build/emlid_navio2_native/**. Run it directly with: ```sh -sudo ./build/posix_rpi_native/px4 ./posix-configs/rpi/px4.config +sudo ./build/emlid_navio2_native/px4 ./posix-configs/rpi/px4.config ``` A successful build followed by executing px4 will give you something like this: @@ -222,23 +224,26 @@ cd /home/pi && ./bin/px4 -d -s px4.config > px4.log Support for the [Parrot Bebop](https://docs.px4.io/en/flight_controller/bebop.html) is at an early stage and should be used very carefully. #### Build + ```sh cd Firmware -make posix_bebop_default +make parrot_bebop_default ``` -Turn on your Bebop and connect your host machine with the Bebop's wifi. Then, press the power button +Turn on your Bebop and connect your host machine with the Bebop's wifi. +Then, press the power button four times to enable ADB and to start the telnet daemon. ```sh -make posix_bebop_default upload +make parrot_bebop_default upload ``` This will upload the PX4 mainapp into /data/ftp/internal_000/ and create the file /home/root/parameters if not already present. This also uploads the mixer file and the px4.config file into the /home/root/ directory. #### Run -Connect to the Bebop's wifi and press the power button four times. Next, +Connect to the Bebop's wifi and press the power button four times. +Next, connect with the Bebop via telnet or adb shell and run the commands bellow. ```sh @@ -310,7 +315,7 @@ The commands below build the targets for the Linux and the DSP side. Both execut ```sh cd Firmware -make eagle_default +make atlflight_eagle_default ``` To load the SW on the device, connect via USB cable and make sure the device is booted. Run this in a new terminal window: @@ -322,10 +327,10 @@ adb shell Go back to previous terminal and upload: ```sh -make eagle_default upload +make atlflight_eagle_default upload ``` -Note that this will also copy (and overwrite) the two config files [mainapp.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/mainapp.config) and [px4.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/px4.config) to the device. Those files are stored under /usr/share/data/adsp/px4.config and /home/linaro/mainapp.config respectively if you want to edit the startup scripts directly on your vehicle. +Note that this will also copy (and overwrite) the two config files [mainapp.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/mainapp.config) and [px4.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/px4.config) to the device. Those files are stored under /usr/share/data/adsp/px4.config and /home/linaro/mainapp.config respectively if you want to edit the startup scripts directly on your vehicle. The mixer currently needs to be copied manually: @@ -415,7 +420,7 @@ cd ../Firmware-build cmake ../Firmware -G "CodeBlocks - Unix Makefiles" ``` -Then load the CMakeLists.txt in the root firmware folder via File -> Open File or Project -> Select the CMakeLists.txt file. +Then load the CMakeLists.txt in the root firmware folder via **File > Open File or Project** (Select the CMakeLists.txt file). After loading, the **play** button can be configured to run the project by selecting 'custom executable' in the run target configuration and entering 'make' as executable and 'upload' as argument. diff --git a/en/setup/dev_env_windows_bash_on_win.md b/en/setup/dev_env_windows_bash_on_win.md index 9718d9bd596..1d4c9120027 100644 --- a/en/setup/dev_env_windows_bash_on_win.md +++ b/en/setup/dev_env_windows_bash_on_win.md @@ -27,13 +27,13 @@ To setup the development environment: ### Build Firmware -To build the firmware (i.e. for px4fmu-v4): +To build the firmware (i.e. for px4_fmu-v4): 1. Enter the following commands in the bash shell: ``` cd ~/src/Firmware - make px4fmu-v4_default + make px4_fmu-v4_default ``` - On successful completion you'll find the firmware here: `Firmware/build/nuttx_px4fmu-v4_default/px4fmu-v4_default.px4` + On successful completion you'll find the firmware here: `Firmware/build/px4_fmu-v4_default/px4_fmu-v4_default.px4` > **Note** The `make` commands to build firmware for other boards can be found in [Building the Code](../setup/building_px4.md#nuttx--pixhawk-based-boards) @@ -53,7 +53,7 @@ To run JMAVSim: > **Tip** Add this line to the Ubuntu **.bashrc** file if you don't want to enter it every session. 1. Start PX4 and jMAVSim in the bash shell: ```sh - make posix jmavsim + make px4_sitl jmavsim ``` The JMAVSim UI is then displayed in XMing as shown below: diff --git a/en/setup/dev_env_windows_cygwin.md b/en/setup/dev_env_windows_cygwin.md index b853d80bad5..9cc4fc7d0ed 100644 --- a/en/setup/dev_env_windows_cygwin.md +++ b/en/setup/dev_env_windows_cygwin.md @@ -52,7 +52,7 @@ The toolchain uses a specially configured console window (started by running the # Navigate to Firmware repo cd Firmware # Build and runs SITL simulation with jMAVSim to test the setup - make posix jmavsim + make px4_sitl jmavsim ``` The console will then display: @@ -127,7 +127,7 @@ git submodule foreach --recursive git config --unset core.filemode # remove the The following features are known to work (version 2.0): * Building and running SITL with jMAVSim with significantly better performance than a VM (it generates a native windows binary **px4.exe**). -* Building and uploading NuttX builds (e.g.: px4fmu-v2 and px4fmu-v4) +* Building and uploading NuttX builds (e.g.: px4_fmu-v2 and px4_fmu-v4) * Style check with *astyle* (supports the command: `make format`) * Command line auto completion * Non-invasive installer! The installer does NOT affect your system and global path (it only modifies the selected installation directory e.g. **C:\PX4\** and uses a temporary local path). diff --git a/en/simulation/README.md b/en/simulation/README.md index 3e393275e4f..f000441d1c0 100644 --- a/en/simulation/README.md +++ b/en/simulation/README.md @@ -76,7 +76,7 @@ If you use the normal build system SITL `make` configuration targets (see next s The build system makes it very easy to build and start PX4 on SITL, launch a simulator, and connect them. For example, you can launch a SITL version of PX4 that uses the EKF2 estimator and simulate a plane in Gazebo with just the following command (provided all the build and gazebo dependencies are present!): ``` -make posix_sitl_default gazebo_plane +make px4_sitl_default gazebo_plane ``` > **Tip** It is also possible to separately build and start SITL and the various simulators, but this is nowhere near as "turnkey". @@ -88,16 +88,16 @@ make [CONFIGURATION_TARGET] [VIEWER_MODEL_DEBUGGER] ``` where: -* **CONFIGURATION_TARGET:** has the format `[OS_][PLATFORM][_FEATURE]` +* **CONFIGURATION_TARGET:** has the format `[OEM_][PLATFORM][_FEATURE]` - * **OS:** posix, nuttx, qurt - * **PLATFORM:** sitl (or in principle any platform supported among the different OS: bebop, eagle, excelsior, etc.) + * **OEM:** (manufacturer) aerotenna, airmind, atlflight, auav, beaglebone, intel, nxp, parrot, px4 etc. + * **PLATFORM:** sitl, fmu-v2, fmu-v3, fmu-v4, fmu-v5, navio2, etc.) * **FEATURE:** A particular high level feature - for example to cross-compile or to run tests. In most cases this is `default`. > **Tip** You can get a list of all available configuration targets using the command: - ``` - make list_config_targets - ``` + ``` + make list_config_targets + ``` * **VIEWER_MODEL_DEBUGGER:** has the format `[SIMULATOR]_[MODEL][_DEBUGGER]` @@ -106,9 +106,9 @@ where: * **DEBUGGER:** Debugger to (optionally) use: `none`, `ide`, `gdb`, `lldb`, `ddd`, `valgrind`, `callgrind`. For more information see [Simulation Debugging](../debug/simulation_debugging.md). > **Tip** You can get a list of all available `VIEWER_MODEL_DEBUGGER` options using the command: - ``` - make posix list_vmd_make_targets - ``` + ``` + make posix list_vmd_make_targets + ``` Notes: - Most of the values in the `CONFIGURATION_TARGET` and `VIEWER_MODEL_DEBUGGER` have defaults, and are hence optional. @@ -116,7 +116,7 @@ Notes: - You can use three underscores if you want to specify a default value between two other settings. For example, `gazebo___gdb` is equivalent to `gazebo_iris_gdb`. - You can use a `none` value for `VIEWER_MODEL_DEBUGGER` to start PX4 and wait for a simulator. - For example start PX4 using `make posix_sitl_default none` and jMAVSim using `./Tools/jmavsim_run.sh`. + For example start PX4 using `make px4_sitl_default none` and jMAVSim using `./Tools/jmavsim_run.sh`. ### Additional Options diff --git a/en/simulation/gazebo.md b/en/simulation/gazebo.md index 389822f17bc..a38badef3ed 100644 --- a/en/simulation/gazebo.md +++ b/en/simulation/gazebo.md @@ -51,7 +51,7 @@ The easiest way to do this is to open a terminal in the root directory of the PX ```sh cd ~/src/Firmware -make posix_sitl_default gazebo +make px4_sitl_default gazebo ``` ### Quadrotor with Optical Flow @@ -79,7 +79,7 @@ make posix gazebo_plane ### Standard VTOL ```sh -make posix_sitl_default gazebo_standard_vtol +make px4_sitl_default gazebo_standard_vtol ``` ![Standard VTOL in Gazebo](../../assets/gazebo/standard_vtol.png) @@ -87,7 +87,7 @@ make posix_sitl_default gazebo_standard_vtol ### Tailsitter VTOL ```sh -make posix_sitl_default gazebo_tailsitter +make px4_sitl_default gazebo_tailsitter ``` ![Tailsitter VTOL in Gazebo](../../assets/gazebo/tailsitter.png) @@ -104,7 +104,7 @@ make posix gazebo_rover ### HippoCampus TUHH (UUV: Unmanned Underwater Vehicle) {#uuv} ```sh -make posix_sitl_default gazebo_hippocampus +make px4_sitl_default gazebo_hippocampus ``` ![Submarine/UUV](../../assets/gazebo/hippocampus.png) @@ -188,7 +188,7 @@ GPS noise is enabled if the target vehicle's SDF file contains a value for the ` To enable/disable GPS noise: 1. Build any gazebo target in order to generate SDF files (for all vehicles). For example: ``` - make posix_sitl_default gazebo_iris + make px4_sitl_default gazebo_iris ``` > **Tip** The SDF files are not overwritten on subsequent builds. 2. Open the SDF file for your target vehicle (e.g. **./Tools/sitl_gazebo/models/iris/iris.sdf**). @@ -215,7 +215,7 @@ To start Gazebo and PX4 separately: * Run gazebo (or any other sim) server and client viewers via the terminal: ``` - make posix_sitl_default gazebo_none_ide + make px4_sitl_default gazebo_none_ide ``` * In your IDE select `px4_` target you want to debug (e.g. `px4_iris`) * Start the debug session directly from IDE diff --git a/en/simulation/hitl.md b/en/simulation/hitl.md index cdf142aa247..d68cb2c04ab 100644 --- a/en/simulation/hitl.md +++ b/en/simulation/hitl.md @@ -108,11 +108,11 @@ Follow the appropriate setup steps for your simulator in the following sections. 1. Update the environment variables: ```sh cd - make posix_sitl_default gazebo + make px4_sitl_default gazebo ``` In a new terminal, run: ```sh - source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default + source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default ``` 1. Open the vehicle model's sdf file (e.g. **Tools/sitl_gazebo/models/iris/iris.sdf**). diff --git a/en/simulation/jmavsim.md b/en/simulation/jmavsim.md index 07febbbb4b2..61691a8fc41 100644 --- a/en/simulation/jmavsim.md +++ b/en/simulation/jmavsim.md @@ -26,7 +26,7 @@ graph LR; After ensuring that the [simulation prerequisites](../setup/dev_env.md) are installed on the system, just launch: The convenience make target will compile the POSIX host build and run the simulation. ```sh -make posix_sitl_default jmavsim +make px4_sitl_default jmavsim ``` This will bring up the PX4 shell: @@ -77,7 +77,7 @@ For example, to set the latitude, longitude and altitude: export PX4_HOME_LAT=28.452386 export PX4_HOME_LON=-13.867138 export PX4_HOME_ALT=28.5 -make posix_sitl_default jmavsim +make px4_sitl_default jmavsim ``` @@ -124,4 +124,4 @@ The simulation can be [interfaced to ROS](../simulation/ros_interface.md) the sa ## Important Files * The startup script is in the [posix-configs/SITL/init](https://github.com/PX4/Firmware/tree/master/posix-configs/SITL/init) folder and named `rcS_SIM_AIRFRAME`, the default is `rcS_jmavsim_iris`. -* The root file system (the equivalent of `/` as seen by the) is located inside the build directory: `build/posix_sitl_default/src/firmware/posix/rootfs/` +* The root file system (the equivalent of `/` as seen by the) is located inside the build directory: `build/px4_sitl_default/src/firmware/posix/rootfs/` diff --git a/en/simulation/multi-vehicle-simulation.md b/en/simulation/multi-vehicle-simulation.md index 26d83d9d00f..3ffedc43804 100644 --- a/en/simulation/multi-vehicle-simulation.md +++ b/en/simulation/multi-vehicle-simulation.md @@ -22,13 +22,13 @@ To build an example setup, follow the step below: ``` cd Firmware_clone git submodule update --init --recursive - make posix_sitl_default - make posix_sitl_default sitl_gazebo + make px4_sitl_default + make px4_sitl_default sitl_gazebo ``` 1. Source your environment: ``` - source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default + source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd):$(pwd)/Tools/sitl_gazebo ``` diff --git a/en/simulation/multi_vehicle_jmavsim.md b/en/simulation/multi_vehicle_jmavsim.md index 3ebaa874bff..c45a850bbea 100644 --- a/en/simulation/multi_vehicle_jmavsim.md +++ b/en/simulation/multi_vehicle_jmavsim.md @@ -17,7 +17,7 @@ To start multiple instances (on separate ports): 1. Build PX4 ``` - make posix_sitl_default + make px4_sitl_default ``` 1. Run **sitl_multiple_run.sh**, specifying the number of instances to start (e.g. 2): ``` diff --git a/en/simulation/ros_interface.md b/en/simulation/ros_interface.md index 4ff6813f27a..a05cdfe86af 100644 --- a/en/simulation/ros_interface.md +++ b/en/simulation/ros_interface.md @@ -53,9 +53,9 @@ To run SITL wrapped in ROS the ROS environment needs to be updated, then launch ```sh cd -make posix_sitl_default gazebo +make px4_sitl_default gazebo source ~/catkin_ws/devel/setup.bash // (optional) -source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default +source Tools/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/sitl_gazebo roslaunch px4 posix_sitl.launch @@ -70,12 +70,10 @@ This section shows how the *roslaunch* instructions provided previously actually First start the simulator using the command below: ```sh -no_sim=1 make posix_sitl_default gazebo +no_sim=1 make px4_sitl_default gazebo ``` The console will look like this: - - ```sh [init] shell id: 46979166467136 [init] task name: px4 @@ -103,7 +101,7 @@ Now in a new terminal make sure you will be able to insert the Iris model throug ```sh cd -source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default +source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default ``` Now start Gazebo like you would when working with ROS and insert the Iris quadcopter model. Once the Iris is loaded it will automatically connect to the px4 app. diff --git a/en/software_update/stm32_bootloader.md b/en/software_update/stm32_bootloader.md index 16b7326525f..c92cdc15f7d 100644 --- a/en/software_update/stm32_bootloader.md +++ b/en/software_update/stm32_bootloader.md @@ -73,8 +73,8 @@ JLinkGDBServer -select USB=0 -device STM32F427VI -if SWD-DP -speed 20000 The `--device`/SoC for common targets is: * **FMUv2, FMUv3, FMUv4, aerofc-v1, mindpx-v2:** STM32F427VI -* **px4fmu-v4pro:** STM32F469II -* **px4fmu-v5:** STM32F765II +* **px4_fmu-v4pro:** STM32F469II +* **px4_fmu-v5:** STM32F765II * **crazyflie:** STM32F405RG diff --git a/en/test_and_ci/continous_integration.md b/en/test_and_ci/continous_integration.md index b48fe67548a..f38d1a81642 100644 --- a/en/test_and_ci/continous_integration.md +++ b/en/test_and_ci/continous_integration.md @@ -14,5 +14,6 @@ Semaphore is primarily used to compile changes for the Qualcomm Snapdragon platf ## [CircleCI](https://circleci.com/gh/PX4/Firmware) -CircleCI tests the proposed next version of GCC to be used for stable firmware releases using the docker image [px4io/px4-dev-nuttx-gcc_next](https://hub.docker.com/r/px4io/px4-dev-nuttx-gcc_next/). It uses the makefile target quick_check which compiles px4fmu-v4_default, posix_sitl_default, runs testing, and verifies code style. +CircleCI tests the proposed next version of GCC to be used for stable firmware releases using the docker image [px4io/px4-dev-nuttx-gcc_next](https://hub.docker.com/r/px4io/px4-dev-nuttx-gcc_next/). +It uses the makefile target `quick_check` which compiles `px4_fmu-v4_default`, `px4_sitl_default`, runs testing, and verifies code style. diff --git a/en/test_and_ci/docker.md b/en/test_and_ci/docker.md index d50a6588b9f..e047aa42f4c 100644 --- a/en/test_and_ci/docker.md +++ b/en/test_and_ci/docker.md @@ -69,7 +69,7 @@ The easiest way to use the containers is via the [docker_run.sh](https://github. For example, to build SITL you would call (from within the **/Firmware** directory): ```sh -sudo ./Tools/docker_run.sh 'make posix_sitl_default' +sudo ./Tools/docker_run.sh 'make px4_sitl_default' ``` Or to start a bash session using the NuttX toolchain: ``` @@ -122,7 +122,7 @@ If everything went well you should be in a new bash shell now. Verify if everyth ```sh cd src/firmware #This is -make posix_sitl_default gazebo +make px4_sitl_default gazebo ``` diff --git a/kr/concept/system_startup.md b/kr/concept/system_startup.md index 419598ff752..1c8fa00db28 100644 --- a/kr/concept/system_startup.md +++ b/kr/concept/system_startup.md @@ -30,7 +30,7 @@ For that to work, a few things are required: The modules can be executed from any terminal when PX4 is already running on a system. For example: ``` -cd /build/posix_sitl_default/bin +cd /build/px4_sitl_default/bin ./px4-commander takeoff ./px4-listener sensor_accel ``` diff --git a/kr/debug/gdb_debugging.md b/kr/debug/gdb_debugging.md index 327514273a9..4289508102f 100644 --- a/kr/debug/gdb_debugging.md +++ b/kr/debug/gdb_debugging.md @@ -6,10 +6,8 @@ PX4를 실행하는 autopilot에서 GDB나 LLDB를 통한 디버깅이 가능합 아래에서 이 명령을 이용하면 가장 많이 정적 메모리 할당한 목록을 보여줍니다. : -
- ```bash -arm-none-eabi-nm --size-sort --print-size --radix=dec build/px4fmu-v2_default/src/firmware/nuttx/firmware_nuttx | grep " [bBdD] " +arm-none-eabi-nm --size-sort --print-size --radix=dec build/px4_fmu-v2_default/src/firmware/nuttx/firmware_nuttx | grep " [bBdD] " ``` NSH 명령은 남은 메모리의 양을 알려줍니다.: @@ -39,13 +37,13 @@ sudo apt-get install google-perftools libgoogle-perftools-dev 무엇보다 먼저 펌웨어를 다음과 같이 빌드 : ```bash -make posix_sitl_default +make px4_sitl_default ``` jmavsim 시작하기: `./Tools/jmavsim_run.sh` 다른 터미널에서 다음을 입력: ```bash -cd build/posix_sitl_default/tmp +cd build/px4_sitl_default/tmp export HEAPPROFILE=/tmp/heapprofile.hprof export HEAP_PROFILE_TIME_INTERVAL=30 ``` @@ -128,7 +126,7 @@ EXC_RETURN: ffffffe9
```bash -arm-none-eabi-gdb build/px4fmu-v2_default/src/firmware/nuttx/firmware_nuttx +arm-none-eabi-gdb build/px4_fmu-v2_default/src/firmware/nuttx/firmware_nuttx ``` GDB 프롬프트에서, R8에서 마지막 명령과 flash에서 첫번째 주소로 시작합니다.(`0x080`로 시작하고 첫번째 주소는 `0x0808439f`임) 하드폴트가 있기 전에 마지막 동작 중에 하나는 ```mavlink_log.c```가 뭔가를 publish를 시도했다는 것입니다. diff --git a/kr/debug/profiling.md b/kr/debug/profiling.md index 65fba2b39ef..af95a151d5c 100644 --- a/kr/debug/profiling.md +++ b/kr/debug/profiling.md @@ -33,13 +33,13 @@ PMSP는 GDB를 사용하여 stack trace를 수집합니다. 사용 예제: ```bash -./poor-mans-profiler.sh --elf=build/px4fmu-v4_default/src/firmware/nuttx/firmware_nuttx --nsamples=30000 +./poor-mans-profiler.sh --elf=build/px4_fmu-v4_default/src/firmware/nuttx/firmware_nuttx --nsamples=30000 ``` 스크립트를 매번 실행은 기존 stack을 덮어쓰게 된다는 것을 명심하세요. 기존 stack을 추가하기를 원한다면 `--append` 옵션을 사용하세요 : ```bash -./poor-mans-profiler.sh --elf=build/px4fmu-v4_default/src/firmware/nuttx/firmware_nuttx --nsamples=30000 --append +./poor-mans-profiler.sh --elf=build/px4_fmu-v4_default/src/firmware/nuttx/firmware_nuttx --nsamples=30000 --append ``` `--append`을 `--nsamples=0`와 함께 사용하면 스크립트는 타겟에 접근하지 않고 SVG를 다시 생성하라는 명령이 됩니다. diff --git a/kr/debug/simulation_debugging.md b/kr/debug/simulation_debugging.md index 6577160e58a..91945458fe0 100644 --- a/kr/debug/simulation_debugging.md +++ b/kr/debug/simulation_debugging.md @@ -8,7 +8,7 @@ Clag address sanitizer는 세그멘테이션 폴트와 같이 alignment 에러 ```sh make clean # only required on first address sanitizer run after a normal build -PX4_ASAN=1 make posix jmavsim +PX4_ASAN=1 make px4_sitl jmavsim ``` ## Valgrind @@ -30,13 +30,13 @@ sudo apt-get install valgrind SITL은 디버거가 연결과 상관없이 jMAVSIm이나 Gazebo와 같은 백엔드 시뮬레이션과 함께 실행할 수 있습니다. 다음과 같은 시작 옵션들로 : ```sh -make posix_sitl_default jmavsim -make posix_sitl_default jmavsim___gdb -make posix_sitl_default jmavsim___lldb +make px4_sitl_default jmavsim +make px4_sitl_default jmavsim___gdb +make px4_sitl_default jmavsim___lldb -make posix_sitl_default gazebo -make posix_sitl_default gazebo___gdb -make posix_sitl_default gazebo___lldb +make px4_sitl_default gazebo +make px4_sitl_default gazebo___gdb +make px4_sitl_default gazebo___lldb make posix_sitl_lpe jmavsim make posix_sitl_lpe jmavsim___gdb diff --git a/kr/debug/system_wide_replay.md b/kr/debug/system_wide_replay.md index dbf64c45944..b388bb973b7 100644 --- a/kr/debug/system_wide_replay.md +++ b/kr/debug/system_wide_replay.md @@ -17,11 +17,11 @@ ORB 메시지를 바탕으로 시스템 특정 부분의 동작을 기록하고 - 먼저 재연할 파일을 선택하고 타겟(Firmware 디렉토리 내에 있는)을 빌드합니다: ```sh export replay= -make posix_sitl_default +make px4_sitl_default ``` - 여기서는 `build/posix_sitl_default_replay`라는 별도의 빌드 디렉토리에 결과물을 생성합니다. (이 파라미터는 일반 빌드에 영향을 주지 않음) 재연을 위해 posix SITL build target을 선택하는 것이 가능합니다. 빌드 시스템은 `replay` 환경변수를 통해 현재 재연 모드에 있는지 알 수 있습니다. + 여기서는 `build/px4_sitl_default_replay`라는 별도의 빌드 디렉토리에 결과물을 생성합니다. (이 파라미터는 일반 빌드에 영향을 주지 않음) 재연을 위해 posix SITL build target을 선택하는 것이 가능합니다. 빌드 시스템은 `replay` 환경변수를 통해 현재 재연 모드에 있는지 알 수 있습니다. - ORB publisher rule 파일을 - `build/posix_sitl_default_replay/tmp/rootfs/orb_publisher.rules`에 추가합니다. + `build/px4_sitl_default_replay/tmp/rootfs/orb_publisher.rules`에 추가합니다. 이 파일은 어떤 모듈이 어떤 메시지를 publish하도록 허용하는지 정의합니다. 다음과 같은 포맷으로 : ``` @@ -41,7 +41,7 @@ ignore_others: true 이렇게 하는 경우, 일반적으로 여기 topic들을 publish하는 module이 replay에 대해서 disable하지 않아도 됩니다. - Optional: setup parameter를 아래 파일에 덮어쓴다. - `build/posix_sitl_default_replay/tmp/rootfs/replay_params.txt`. + `build/px4_sitl_default_replay/tmp/rootfs/replay_params.txt`. 이 파일은 ` `의 목록을 포함해야만 한다. 다음과 같다. : ``` EKF2_GB_NOISE 0.001 @@ -51,7 +51,7 @@ EKF2_GB_NOISE 0.001 - Optional: SD 카드에 있는 `dataman` mission 파일을 해당 build 디렉토리에 복사. mission이 replay인 경우에만 필요. - replay 시작하기: ```sh - make posix_sitl_default jmavsim + make px4_sitl_default jmavsim ``` 이렇게 하면 자동으로 log 파일을 열어서 paramter를 적용하고 replay를 시작합니다. 일단 완료되면, 결과를 리포팅하고 해당 process는 종료됩니다. 다음으로 새로 생성된 log 파일은 분석하고 `_replayed`가 파일이름에 추가됩니다. @@ -91,7 +91,7 @@ INFO [replay] Replay done (published 9917 msgs, 2.136 s) 파라미터도 조절할 수 있습니다. \(먼저 pyulog 설치 `sudo pip install pyulog`\)하고 log로부터 추출할 수 있습니다 : ``` -ulog_params -i $replay -d ' ' | grep -e '^EKF2' > build/posix_sitl_default_replay/tmp/rootfs/replay_params.txt +ulog_params -i $replay -d ' ' | grep -e '^EKF2' > build/px4_sitl_default_replay/tmp/rootfs/replay_params.txt ``` 다음으로는 필요하면 파일에 있는 파라미터를 수정하고 `make posix none`로 replay 프로세스를 재시작합니다. 이렇게하면 새로운 로그 파일이 생성됩니다. diff --git a/kr/middleware/drivers.md b/kr/middleware/drivers.md index acdd8fb9495..299a5cbc3e7 100644 --- a/kr/middleware/drivers.md +++ b/kr/middleware/drivers.md @@ -23,7 +23,7 @@ PX4는 [reactive system](../concept/architecture.md)으로 pub/sub을 사용해 * OS 설정은 [nuttx-configs](https://github.com/PX4/Firmware/tree/master/nuttx-configs)에 있습니다. OS는 application 빌드의 일부로 로드됩니다. * PX4 미들웨어 설정은 [src/drivers/boards](https://github.com/PX4/Firmware/tree/master/src/drivers/boards)에 있습니다. 여기에는 bus와 GPIO 매핑 그리고 보드 초기화 코드가 있습니다. * Driver는 [src/drivers](https://github.com/PX4/Firmware/tree/master/src/drivers)에 위치하고 있습니다. - * Reference config: 'make px4fmu-v4_default'를 실행하면 FMUv4 config를 빌드합니다. 현재 NuttX를 참조하는 설정입니다. + * Reference config: 'make px4_fmu-v4_default'를 실행하면 FMUv4 config를 빌드합니다. 현재 NuttX를 참조하는 설정입니다. ### QuRT / Hexagon diff --git a/kr/middleware/micrortps.md b/kr/middleware/micrortps.md index 4521424b63b..1b88010911e 100644 --- a/kr/middleware/micrortps.md +++ b/kr/middleware/micrortps.md @@ -59,7 +59,9 @@ set(config_rtps_receive_topics ) ``` -> **Caution** At time of writing (August 2017), only the small set of uORB topics listed above are included in our cmake files: **posix_sitl_default.cmake**, **nuttx_px4fmu-v4_default.cmake**, **posix_sdflight_default.cmake**. It is likely you will need to edit your *cmake* file and add additional uORB topics. In future we hope to define a larger standard set. +> **Caution** At time of writing (August 2017), only the small set of uORB topics listed above are included in our *cmake* files: **PX4/Firmware/boards/px4/sitl/default.cmake**, **PX4/Firmware/boards/px4/fmu-v4/default.cmake**, **posix_sdflight_default.cmake**. + It is likely you will need to edit your *cmake* file and add additional uORB topics. + In future we hope to define a larger standard set. For *manual code generation* the uORB topics that will be supported by the bridge are specified when you call **generate_microRTPS_bridge.py** (using the `-s`/`--send` and `-r`/`--receive` flags). See [Manual Generation of the Code](../middleware/micrortps_manual_code_generation.md) for more information. @@ -70,7 +72,7 @@ The *Client* source code is generated, compiled and built into the PX4 firmware To build and upload the firmware for NuttX/Pixhawk flight controllers: ```sh -make px4fmu-v4_default upload +make px4_fmu-v4_default upload ``` To build and upload the firmware for Qualcomm Snapdragon Flight: diff --git a/kr/middleware/micrortps_manual_code_generation.md b/kr/middleware/micrortps_manual_code_generation.md index f023e36b093..a149866ccf4 100644 --- a/kr/middleware/micrortps_manual_code_generation.md +++ b/kr/middleware/micrortps_manual_code_generation.md @@ -141,7 +141,7 @@ src/modules/micrortps_bridge/micrortps_client 특히 한번 수동으로 생성되면, *Client* 소스 코드가 컴파일되고 일반 빌드 프로세스로 PX4 펌웨어로 빌드됩니다. 예제로 코드를 컴파일하려면 펌웨어에 Nuttx/Pixhawk 타겟에 include합니다.: ```sh -make px4fmu-v4_default upload +make px4_fmu-v4_default upload ``` > **Note** 먼저 [자동 bridge 코드 생성 비활성화](#disable-automatic-bridge-code-generation)시켜서 툴체인이 수동으로 생성한 소스 코드를 사용하도록 합니다. (그리고 재생성하지 않도록 합니다) diff --git a/kr/ros/external_position_estimation.md b/kr/ros/external_position_estimation.md index e1095deb586..425fe900170 100644 --- a/kr/ros/external_position_estimation.md +++ b/kr/ros/external_position_estimation.md @@ -1,6 +1,6 @@ # 비젼 혹은 모션 캡쳐 시스템 사용하기 -> **Info** 아래 내용을 따라하기 전에, 여러분의 autopilot의 펌웨어 버전이 LPE 모듈이 활성화되어 있는지 확인합니다. PX4 펌웨어의 LPE 버전은 최신 PX4 릴리즈의 zip 파일 내부 혹은 `make px4fmu-v2_lpe`와 같은 빌드명령으로 소스를 빌드하면 볼수 있습니다. 상세한 내용은 [코드 빌드하기](../setup/building_px4.md)를 참고하세요. +> **Info** 아래 내용을 따라하기 전에, 여러분의 autopilot의 펌웨어 버전이 LPE 모듈이 활성화되어 있는지 확인합니다. PX4 펌웨어의 LPE 버전은 최신 PX4 릴리즈의 zip 파일 내부 혹은 `make px4_fmu-v2_lpe`와 같은 빌드명령으로 소스를 빌드하면 볼수 있습니다. 상세한 내용은 [코드 빌드하기](../setup/building_px4.md)를 참고하세요. 이 페이지의 목적은 GPS이 아닌 소스로부터(VICON과 Optitrack 같은 모션 캡쳐 시스템 그리고 [ROVIO](https://github.com/ethz-asl/rovio), [SVO](https://github.com/uzh-rpg/rpg_svo) 혹은 [PTAM](https://github.com/ethz-asl/ethzasl_ptam) )와 같은 비젼 기반 estimation 시스템) 위치 데이터를 사용하는 PX4 기반 시스템을 구성하는 것입니다. diff --git a/kr/setup/building_px4.md b/kr/setup/building_px4.md index a90daa451c9..cb852f90452 100644 --- a/kr/setup/building_px4.md +++ b/kr/setup/building_px4.md @@ -1,92 +1,135 @@ -# PX4 Software 빌드하기 +# Building PX4 Software -PX4는 콘솔이나 IDE 개발환경에서 빌드할 수 있습니다. +PX4 can be built on the console or in an IDE, for both simulated and hardware targets. -## 소프트웨어 다운로드와 처음 빌드하기 +## Downloading PX4 Source Code {#get_px4_code} -콘솔 환경을 이용해서 시뮬레이트 타겟용으로 처음 빌드를 해봅시다. 실제 하드웨어나 IDE에서 진행하기 전에 시스템 셋업이 제대로 되었는지를 확인할 수 있습니다. +The PX4 source code is stored on Github in the [PX4/Firmware](https://github.com/PX4/Firmware) repository. We recommend that you [fork](https://help.github.com/articles/fork-a-repo/) this repository (creating a copy associated with your own Github account), and then [clone](https://help.github.com/articles/cloning-a-repository/) the source to your local computer. -먼저 터미널 띄우기 -* OS X의 경우 ⌘-space를 누르고 'terminal' 찾기 -* Ubuntu의 경우, 런치바를 클릭하고 'terminal' 찾기 -* Windows의 경우, 시작 메뉴에서 PX4 폴더 찾은 후에 'PX4 Console' 클릭하기 +> **Tip** Forking the repository allows you to better manage your custom code. Later on you will be able to use *git* to share changes with the main project. -PX4/Firmware 저장소를 clone하고 jMAVSim 타겟으로 빌드합니다. 아래와 같습니다. 숙련된 개발자는 [자신의 fork](https://help.github.com/articles/fork-a-repo/)를 clone합니다. +The steps to fork and clone the project source code are: +1. [Sign up](https://github.com/) to Github. +1. Go to the [Firmware](https://github.com/PX4/Firmware) repository and click the **Fork** button near the upper right corner. + This will create and open the forked repository. + + ![Github Fork button](../../assets/toolchain/github_fork.png) +1. Copy the repository URL for your *Firmware* repository fork. The easiest way to do this is to click the **Clone or download** button and then copy the URL: + + ![Github Clone or download button](../../assets/toolchain/github_clone_or_download.png) +1. Open a command prompt/terminal on your computer + * On OS X, hit ⌘-space and search for 'terminal'. + * On Ubuntu, click the launch bar and search for 'terminal'. + * On Windows, find the PX4 folder in the start menu and click on 'PX4 Console'. +1. Clone the repository fork using the copied URL. This will look something like: + ``` + git clone https://github.com//Firmware.git + ``` + + > **Tip** If you're just experimenting (and don't want to make any sort of permanent changes) you can simply clone the main Firmware repository as shown: + > ```sh + > git clone https://github.com/PX4/Firmware.git + > ``` + + Windows users [refer to the Github help](https://help.github.com/desktop/guides/getting-started-with-github-desktop/installing-github-desktop/). + You can use a *git* command line client as above or instead perform the same actions with the *Github for Windows* app. + + +This will copy *most* of the *very latest* version of PX4 source code onto your computer +(the rest of the code is automatically fetched from other [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) when you build PX4). + +> **Tip** To get the source for a *specific older release*, you could then: +> ```sh +> # Navigate into Firmware directory +> cd Firmware +> +> # list the releases (tags) +> git tag -l +> +> # Checkout code for particular tag (e.g. for tag 1.7.4beta) +> git checkout v1.7.4beta +> ``` + + +## First Build (Using the jMAVSim Simulator) {#jmavsim_build} + +For the first build we'll build for a simulated target using a console environment. This allows us to validate the system setup before moving on to real hardware and an IDE. + +Navigate into the **Firmware** directory and start [jMAVSim](../simulation/jmavsim.md) using the following command: ```sh -mkdir -p ~/src -cd ~/src -git clone https://github.com/PX4/Firmware.git -cd Firmware -make posix jmavsim +make px4_sitl jmavsim ``` -아래와 같이 PX4 콘솔이 뜨고: +This will bring up the PX4 console below: -![](../../assets/console_jmavsim.png) +![PX4 Console (jMAVSim)](../../assets/console_jmavsim.png) -다음과 같이 입력하면 드론이 이륙: +The drone can be flown by typing: ```sh pxh> commander takeoff ``` -![](../../assets/jmavsim_first_takeoff.png) +![jMAVSim UI](../../assets/jmavsim_first_takeoff.png) -**CTRL-C** 를 누르면 시뮬레이션과 시뮬레이션되는 flight code가 멈추게 됩니다. 시뮬레이션 셋업의 상세한 내용은 다음을 참고 : [jMAVSim Simulation](../simulation/jmavsim.md). +The drone can be landed by typing `commander land` and the whole simulation can be stopped by doing **CTRL+C** (or by entering `shutdown`). -그라운드 컨트롤 스테이션으로 시뮬레이션 비행은 실제 비행체로 동작하는 것과 유사합니다. 비행체가 비행 중일때 지도에서 위치를 클릭하고 슬라이더를 활성화시킵니다. 이렇게 하면 비행체가 이동하게 됩니다. +> **Tip** The simulation setup is documented in full detail here: [jMAVSim Simulation](../simulation/jmavsim.md). -![](../../assets/qgc_goto.jpg) +Flying the simulation with the ground control station is closer to the real operation of the vehicle. Click on a location in the map while the vehicle is flying (takeoff flight mode) and enable the slider. This will reposition the vehicle. +![QGroundControl GoTo](../../assets/qgc_goto.jpg) -## NuttX / Pixhawk 기반 보드 -### 빌드하기 +## NuttX / Pixhawk Based Boards -NuttX- 나 Pixhawk- 기반 보드용으로 빌드하기 위해서는 **Firmware** 디렉토리로 가서 여러분이 가진 보드에 적합한 빌드를 위해서 `make`를 호출합니다. +### Building {#building_nuttx} -> **Note** 아래 예제에서 빌드 타겟 `px4fmu-v2`의 첫번째 부분은 autopilot 하드웨어 버전이고 `default`는 설정 이름입니다.(이경우 "default" 설정) PX4의 모든 빌드 타겟은 다음과 같은 로직을 따릅니다. +To build for NuttX- or Pixhawk- based boards, navigate into the **Firmware** directory and then call `make` with the build target for your board. -예제로 *Pixhawk 1* 용으로 빌드하는 경우 다음과 같은 명령을 사용: +> **Note** In the example below the first part of the build target `px4_fmu-v4` is the autopilot hardware version and `default` is the configuration name (in this case the "default" configuration). All PX4 build targets follow this logic). + +For example, to build for *Pixracer* you would use the following command: ```sh cd Firmware -make px4fmu-v2_default +make px4_fmu-v4_default ``` -성공적으로 실행되면 다음과 같이 출력: +A successful run will end with similar output to: ```sh -[100%] Linking CXX executable firmware_nuttx -[100%] Built target firmware_nuttx -Scanning dependencies of target build/firmware_px4fmu-v2 -[100%] Generating nuttx-px4fmu-v2-default.px4 -[100%] Built target build/firmware_px4fmu-v2 +-- Build files have been written to: /home/youruser/src/Firmware/build/px4_fmu-v4_default +[954/954] Creating /home/youruser/src/Firmware/build/px4_fmu-v4_default/px4_fmu-v4_default.px4 ``` -보드들에 대한 빌드 명령 목록: -* [Pixhawk 1](https://docs.px4.io/en/flight_controller/pixhawk.html): `make px4fmu-v2_default` -* [HKPilot32](https://docs.px4.io/en/flight_controller/HKPilot32.html): `make px4fmu-v2_default` -* [Pixfalcon](https://docs.px4.io/en/flight_controller/pixfalcon.html): `make px4fmu-v2_default` -* [Dropix](https://docs.px4.io/en/flight_controller/dropix.html): `make px4fmu-v2_default` -* [mRo Pixhawk](https://docs.px4.io/en/flight_controller/mro_pixhawk.html): `make px4fmu-v3_default` (supports 2MB Flash) -* [Pixhawk 2](https://docs.px4.io/en/flight_controller/pixhawk-2.html): `make px4fmu-v3_default` -* [Pixracer](https://docs.px4.io/en/flight_controller/pixracer.html): `make px4fmu-v4_default` -* [MindPX](https://docs.px4.io/en/flight_controller/mindpx.html)/[MindRacer](https://docs.px4.io/en/flight_controller/mindracer.html): `make px4fmu-v4_default` -* [Pixhawk Mini](https://docs.px4.io/en/flight_controller/pixhawk_mini.html): `make px4fmu-v3_default` -* [Pixhawk 3 Pro](https://docs.px4.io/en/flight_controller/pixhawk3_pro.html): `make px4fmu-v4pro_default` -* [Crazyflie 2.0](https://docs.px4.io/en/flight_controller/crazyflie2.html): `make crazyflie_default` -* [Intel® Aero Ready to Fly Drone](https://docs.px4.io/en/flight_controller/intel_aero.html): `make aerofc-v1_default` -* Pixhawk 4: `make px4fmu-v5_default` -* [AUAV-X2 (Discontinued)](https://docs.px4.io/en/flight_controller/auav_x2.html): `make px4fmu-v2_default` +The following list shows the build commands for common boards: +* Pixhawk 4: `make px4_fmu-v5_default` +* [Pixracer](https://docs.px4.io/en/flight_controller/pixracer.html): `make px4_fmu-v4_default` +* [Pixhawk 3 Pro](https://docs.px4.io/en/flight_controller/pixhawk3_pro.html): `make px4_fmu-v4pro_default` +* [Pixhawk Mini](https://docs.px4.io/en/flight_controller/pixhawk_mini.html): `make px4_fmu-v3_default` +* [Pixhawk 2](https://docs.px4.io/en/flight_controller/pixhawk-2.html): `make px4_fmu-v3_default` +* [mRo Pixhawk](https://docs.px4.io/en/flight_controller/mro_pixhawk.html): `make px4_fmu-v3_default` (supports 2MB Flash) +* [HKPilot32](https://docs.px4.io/en/flight_controller/HKPilot32.html): `make px4_fmu-v2_default` +* [Pixfalcon](https://docs.px4.io/en/flight_controller/pixfalcon.html): `make px4_fmu-v2_default` +* [Dropix](https://docs.px4.io/en/flight_controller/dropix.html): `make px4_fmu-v2_default` +* [MindPX](https://docs.px4.io/en/flight_controller/mindpx.html)/[MindRacer](https://docs.px4.io/en/flight_controller/mindracer.html): `make airmind_mindpx-v2_default` +* [mRo X-2.1](https://docs.px4.io/en/flight_controller/mro_x2.1.html): `make auav_x21_default` +* [Crazyflie 2.0](https://docs.px4.io/en/flight_controller/crazyflie2.html): `make bitcraze_crazyflie_default` +* [Intel® Aero Ready to Fly Drone](https://docs.px4.io/en/flight_controller/intel_aero.html): `make intel_aerofc-v1_default` +* [Pixhawk 1](https://docs.px4.io/en/flight_controller/pixhawk.html): `make px4_fmu-v2_default` + > **Warning** You **must** use a [supported version of GCC](../setup/dev_env_linux_ubuntu.md#nuttx-based-hardware) to build this board (e.g. the same as used by [CI/docker](../test_and_ci/docker.md)) or remove modules from the build. Building with an unsupported GCC may fail, as PX4 is close to the board's 1MB flash limit. +* Pixhawk 1 with 2 MB flash: `make px4_fmu-v3_default` + +> **Note** Generally the `_default` suffix is optional (i.e. you can also build using `make px4_fmu-v4`, `make bitcraze_crazyflie`, etc.). -### 펌웨어 업로드 (보드에 flash) +### Uploading Firmware (Flashing the board) -컴파일된 바이너리를 USB로 하드웨어에 업로드하기 위해 `upload`를 make 명령에 추가합니다. +Append `upload` to the make commands to upload the compiled binary to the autopilot hardware via USB. For example ```sh -make px4fmu-v2_default upload +make px4_fmu-v4_default upload ``` -성공적으로 실행되면 다음과 같이 출력: +A successful run will end with this output: ```sh Erase : [====================] 100.0% @@ -97,60 +140,60 @@ Rebooting. [100%] Built target upload ``` -## 기타 보드들 +## Other Boards -다음 보드들에 대해서 빌드와 배포는 좀더 복잡합니다. +The following boards have more complicated build and/or deployment instructions. +### Raspberry Pi 2/3 Boards -### Raspberry Pi 2/3 보드 -아래 명령은 Raspbian용으로 타겟을 빌드합니다. +The command below builds the target for [Raspberry Pi 2/3 Navio2](https://docs.px4.io/en/flight_controller/raspberry_pi_navio2.html). -#### 크로스-컴파일러 빌드 +#### Cross-compiler Build ```sh cd Firmware -make posix_rpi_cross # for cross-compiler build +make emlid_navio2_cross # for cross-compiler build ``` -build/posix_rpi_cross/src/firmware/posix 디렉토리에 실행가능한 "px4" 파일이 있습니다. -RPi를 ssh로 연결할 수 있는지 확인합니다. [RPi에 접근하는 방법](https://docs.px4.io/en/flight_controller/raspberry_pi_navio2.html#developer-quick-start)를 참고합니다. +The "px4" executable file is in the directory **build/emlid_navio2_cross/**. +Make sure you can connect to your RPi over ssh, see [instructions how to access your RPi](https://docs.px4.io/en/flight_controller/raspberry_pi_navio2.html#developer-quick-start). -다음으로 RPi의 IP(혹은 hostname)를 다음과 같이 설정 : +Then set the IP (or hostname) of your RPi using: ```sh export AUTOPILOT_HOST=192.168.X.X ``` -그리고 upload : +And upload it with: ```sh cd Firmware -make posix_rpi_cross upload # for cross-compiler build +make emlid_navio2_cross upload # for cross-compiler build ``` -다음으로 ssh에서 연결하고 root 권한으로 실행 : +Then, connect over ssh and run it with (as root): ```sh -sudo ./px4 px4.config +sudo ./bin/px4 -s px4.config ``` -#### Native build +#### Native Build -Pi에서 *직접* 빌드를 하는 경우에 native build target(posix_rpi_native)이 필요합니다. +If you're building *directly* on the Pi, you will want the native build target (emlid_navio2_native). ```sh cd Firmware -make posix_rpi_native # for native build +make emlid_navio2_native # for native build ``` -build/posix_rpi_native/src/firmware/posix 디렉토리에 실행가능한 "px4" 파일이 있습니다. -직접 실행하기 : +The "px4" executable file is in the directory **build/emlid_navio2_native/**. +Run it directly with: ```sh -sudo ./build/posix_rpi_native/src/firmware/posix/px4 ./posix-configs/rpi/px4.config +sudo ./build/emlid_navio2_native/px4 ./posix-configs/rpi/px4.config ``` -px4 실행이 성공적으로 되면 다음과 같은 메시지가 나옵니다 : +A successful build followed by executing px4 will give you something like this: ```sh @@ -167,78 +210,82 @@ px4 starting. pxh> ``` -#### 자동시작 -px4 자동구동시키려면 `/etc/rc.local` 파일에 다음을 추가합니다.(native build를 사용하고 있다면 적절히 수정) 위치는 `exit 0` 바로 직전입니다. : -``` -cd /home/pi && ./px4 -d px4.config > px4.log +#### Autostart + +To autostart px4, add the following to the file **/etc/rc.local** (adjust it +accordingly if you use native build), right before the `exit 0` line: +```sh +cd /home/pi && ./bin/px4 -d -s px4.config > px4.log ``` -### 패롯 비밥 +### Parrot Bebop -Bebop 지원은 아직 초기 단계로 주의해서 사용해야 합니다. +Support for the [Parrot Bebop](https://docs.px4.io/en/flight_controller/bebop.html) is at an early stage and should be used very carefully. + +#### Build -#### 빌드하기 ```sh cd Firmware -make posix_bebop_default +make parrot_bebop_default ``` -Bebop을 켜고 호스트 머신을 Bebop의 wifi와 연결합니다. 다음으로 파워 버튼을 4번 눌러서 ADB를 활성화 시키고 telnet daemon을 구동시킵니다. +Turn on your Bebop and connect your host machine with the Bebop's wifi. +Then, press the power button +four times to enable ADB and to start the telnet daemon. ```sh -make posix_bebop_default upload +make parrot_bebop_default upload ``` -이렇게 하면 PX4 mainapp을 /usr/bin에 업로드시키고 /home/root/parameters가 없다면 이를 생성합니다. 추가로 Bebop의 mixer 파일과 px4.config가 필요합니다. 현재 이 두 파일은 다음 명령을 통해 수동으로 복사합니다. -```sh -adb connect 192.168.42.1:9050 -adb push ROMFS/px4fmu_common/mixers/bebop.main.mix /home/root -adb push posix-configs/bebop/px4.config /home/root -adb disconnect -``` +This will upload the PX4 mainapp into /data/ftp/internal_000/ and create the file /home/root/parameters if not already +present. This also uploads the mixer file and the px4.config file into the /home/root/ directory. -#### 실행하기 -Bebop의 wifi에 연결하고 파워 버튼을 4번 누릅니다. 다음으로 Bebop에 telnet이나 adb sehll로 연결하고 아래 명령을 실행합니다. +#### Run +Connect to the Bebop's wifi and press the power button four times. +Next, +connect with the Bebop via telnet or adb shell and run the commands bellow. ```sh telnet 192.168.42.1 ``` -Bebop의 원래 드라이버를 kill 하기 : +Kill the Bebop's proprietary driver with ```sh kk ``` - -그리고 PX4 mainapp을 구동시키기 : +and start the PX4 mainapp with: ```sh -px4 /home/root/px4.config +/data/ftp/internal_000/px4 -s /home/root/px4.config ``` -Bebop을 날리기 위해서는 호스트 머신에 조이스틱 장치를 연결하고 QGroundControl를 시작합니다. Bebop과 조이스틱 둘다 인식되어야 합니다. 지시를 따라서 센서를 칼리브레이션하고 조이스틱 장치를 셋업합니다. +In order to fly the Bebop, connect a joystick device with your host machine and start QGroundControl. Both, +the Bebop and the joystick should be recognized. Follow the instructions to calibrate the sensors +and setup your joystick device. -#### 자동시작 +#### Autostart -비밥에서 부팅시에 자동으로 PX4를 시작되게 하려면, init 스크립트 `/etc/init.d/rcS_mode_default`를 수정해야합니다. 다음 라인을 커맨트 처리합니다 : +To auto-start PX4 on the Bebop at boot, modify the init script `/etc/init.d/rcS_mode_default`. Comment the following line: ``` DragonStarter.sh -out2null & ``` -다음으로 교체합니다: +Replace it with: ``` -px4 -d /home/root/px4.config > /home/root/px4.log +echo 1 > /sys/class/gpio/gpio85/value # enables the fan +/data/ftp/internal_000/px4 -d -s /home/root/px4.config > /home/root/px4.log & ``` -위에서 설명한 것처럼 파워 버튼을 4번 눌러서 adb server를 활성화시키고 adb server에 연결합니다. : +Enable adb server by pressing the power button 4 times and connect to adb server as described before: ```sh adb connect 192.168.42.1:9050 ``` -쓰기가 가능하도록 시스템 파티션을 다시 마운트시킵니다 : +Re-mount the system partition as writeable: ```sh adb shell mount -o remount,rw / ``` -파일을 수동으로 수정하는 것을 막기 위해서 다음을 사용할 수 있습니다: https://gist.github.com/mhkabir/b0433f0651f006e3c7ac4e1cbd83f1e8 +In order to avoid editing the file manually, you can use this one : https://gist.github.com/bartslinger/8908ff07381f6ea3b06c1049c62df44e -원본을 저장하고 비밥에 집어 넣습니다. +Save the original one and push this one to the Bebop ```sh adb shell cp /etc/init.d/rcS_mode_default /etc/init.d/rcS_mode_default_backup adb push rcS_mode_default /etc/init.d/ @@ -251,75 +298,77 @@ adb shell reboot ### OcPoC-Zynq Mini -[OcPoC-Zynq Mini](https://docs.px4.io/en/flight_controller/ocpoc_zynq.html)에 관련된 빌드 : -* [Aerotenna OcPoC-Zynq Mini Flight Controller > Building PX4 for OcPoC-Zynq](https://docs.px4.io/en/flight_controller/ocpoc_zynq.html#building-px4-for-ocpoc-zynq) (PX4 사용자 가이드) -* [OcPoC PX4 Setup 페이지](https://aerotenna.readme.io/docs/px4-setup) +Build instructions for the [OcPoC-Zynq Mini](https://docs.px4.io/en/flight_controller/ocpoc_zynq.html) are covered in: +* [Aerotenna OcPoC-Zynq Mini Flight Controller > Building PX4 for OcPoC-Zynq](https://docs.px4.io/en/flight_controller/ocpoc_zynq.html#building-px4-for-ocpoc-zynq) (PX4 User Guide) +* [OcPoC PX4 Setup Page](https://aerotenna.readme.io/docs/px4-setup) -### QuRT / Snapdragon 기반 보드 +### QuRT / Snapdragon Based Boards -#### 빌드하기 +This section shows how to build for the [Qualcomm Snapdragon Flight](https://docs.px4.io/en/flight_controller/snapdragon_flight.html). -NOTE: [Qualcomm ESC 보드](http://shop.intrinsyc.com/products/qualcomm-electronic-speed-control-board) (UART-기반)을 사용하고 있다면, [여기](https://github.com/ATLFlight/ATLFlightDocs/blob/master/PX4.md) 지시를 참고하세요. 일반 PWM 기반 ESC 보드를 사용하는 경우에는 이 페이지의 내용을 계속 따라하면 됩니다. +#### Build -아래 명령으로 Linux와 DSP쪽에 대해서 타겟을 빌드합니다. 실행되면 [muORB](../middleware/uorb.md)를 통해 서로 통신합니다. +> **Note** If you use the [Qualcomm ESC board](http://shop.intrinsyc.com/products/qualcomm-electronic-speed-control-board) (UART-based), then please follow their instructions [here](https://github.com/ATLFlight/ATLFlightDocs/blob/master/PX4.md). If you use normal PWM-based ESCs boards, then you may continue to follow the instructions on this page. + +The commands below build the targets for the Linux and the DSP side. Both executables communicate via [muORB](../middleware/uorb.md). ```sh cd Firmware -make eagle_default +make atlflight_eagle_default ``` -장치에 SW를 로드하기 위해서 USB 케이블을 연결하고 장치가 부팅되는지 확인합니다. 새로운 터미널에서 이를 실행합니다 : +To load the SW on the device, connect via USB cable and make sure the device is booted. Run this in a new terminal window: ```sh adb shell ``` -이전 터미널로 돌아가서 업로드 : +Go back to previous terminal and upload: ```sh -make eagle_default upload +make atlflight_eagle_default upload ``` -[mainapp.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/mainapp.config) 와 [px4.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/px4.config) 2개 설정 파일을 장치로 복사하게 됩니다. 장치에 있는 시작 스크립트를 직접 수정하고자 한다면 이 파일들은 /usr/share/data/adsp/px4.config 와 /home/linaro/mainapp.config 내에 각각 저장되어 있습니다. +Note that this will also copy (and overwrite) the two config files [mainapp.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/mainapp.config) and [px4.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/px4.config) to the device. Those files are stored under /usr/share/data/adsp/px4.config and /home/linaro/mainapp.config respectively if you want to edit the startup scripts directly on your vehicle. -믹서는 현재 수동으로 복사해야 합니다: +The mixer currently needs to be copied manually: ```sh adb push ROMFS/px4fmu_common/mixers/quad_x.main.mix /usr/share/data/adsp ``` -#### 실행하기 +#### Run -DSP 디버그 모니터 실행: +Run the DSP debug monitor: ```sh ${HEXAGON_SDK_ROOT}/tools/debug/mini-dm/Linux_Debug/mini-dm ``` -Note: Mac에서는 [nano-dm](https://github.com/kevinmehall/nano-dm)를 사용할 수 있습니다. +Note: alternatively, especially on Mac, you can also use [nano-dm](https://github.com/kevinmehall/nano-dm). -ADB 쉘로 돌아가서 px4를 실행: +Go back to ADB shell and run px4: ```sh cd /home/linaro ./px4 mainapp.config ``` -px4는 USB 케이블 연결을 끊자마자 멈추게 됩니다.(혹은 ssh 세션이 종료되거나) 비행을 위해서 px4가 부팅뒤에 자동으로 시작되도록 해야 합니다. +Note that the px4 will stop as soon as you disconnect the USB cable (or if you ssh session is disconnected). To fly, you should make the px4 auto-start after boot. -#### 자동시작 +#### Autostart -Snapdragon가 부팅되고 px4를 실행시키려면 `rc.local`에 시작시키는 부분을 추가할 수 있습니다 : +To run the px4 as soon as the Snapdragon has booted, you can add the startup to `rc.local`: -아니면 Snapdragon에 직접 `/etc/rc.local`을 수정: +Either edit the file `/etc/rc.local` directly on the Snapdragon: ```sh adb shell vim /etc/rc.local ``` -이 파일을 여러분의 컴퓨터에 복사하고 수정한 후에 다시 복사: +Or copy the file to your computer, edit it locally, and copy it back: ```sh adb pull /etc/rc.local @@ -327,7 +376,7 @@ gedit rc.local adb push rc.local /etc/rc.local ``` -자동 시작을 위해서 `exit 0`전에 다음 라인을 추가합니다 : +For the auto-start, add the following line before `exit 0`: ```sh (cd /home/linaro && ./px4 mainapp.config > mainapp.log) @@ -335,34 +384,34 @@ adb push rc.local /etc/rc.local exit 0 ``` -`rc.local`가 실행되는지 확인: +Make sure that the `rc.local` is executable: ```sh adb shell chmod +x /etc/rc.local ``` -다음으로 Snapdragon을 리부팅: +Then reboot the Snapdragon: ```sh adb reboot ``` -## IDE에서 컴파일하기 +## Compiling in a Graphical IDE -PX4 시스템은 Qt Creator, Eclipse, Sublime Text를 지원합니다. Qt Creator가 가장 사용자를 위한 기능이 많아서 유일하게 공식적으로 지원하는 IDE입니다. Eclipse와 Sublime의 경우 전문가가 아니라면 사용하기 쉽지 않습니다. 하드코어 사용자는 [Eclipse project](https://github.com/PX4/Firmware/blob/master/eclipse.project)와 [Sublime project](https://github.com/PX4/Firmware/blob/master/Firmware.sublime-project)를 소스 트리에서 찾을 수 있습니다. +The PX4 system supports Qt Creator, Eclipse and Sublime Text. Qt Creator is the most user-friendly variant and hence the only officially supported IDE. Unless an expert in Eclipse or Sublime, their use is discouraged. Hardcore users can find an [Eclipse project](https://github.com/PX4/Firmware/blob/master/eclipse.project) and a [Sublime project](https://github.com/PX4/Firmware/blob/master/Firmware.sublime-project) in the source tree. {% youtube %}https://www.youtube.com/watch?v=Bkk8zttWxEI&rel=0&vq=hd720{% endyoutube %} -## Qt Creator 기능 +## Qt Creator Functionality -Qt creator는 클릭가능한 심볼, 자동완성기능, 빌드, 펌웨어 flash 기능을 제공합니다. +Qt creator offers clickable symbols, auto-completion of the complete codebase and building and flashing firmware. ![](../../assets/toolchain/qtcreator.png) -### Qt Creator (리눅스에서) +### Qt Creator on Linux -Qt Creator를 시작하기 전에, [project file](https://cmake.org/Wiki/CMake_Generator_Specific_Information#Code::Blocks_Generator)이 있어야 합니다. : +Before starting Qt Creator, the [project file](https://cmake.org/Wiki/CMake_Generator_Specific_Information#Code::Blocks_Generator) needs to be created: ```sh cd ~/src/Firmware @@ -371,25 +420,26 @@ cd ../Firmware-build cmake ../Firmware -G "CodeBlocks - Unix Makefiles" ``` -File -> Open File나 Project -> Select CMakeLists.txt를 통해서 root 펌웨어 폴더에 있는 CMakeLists.txt 파일을 로드합니다. +Then load the CMakeLists.txt in the root firmware folder via **File > Open File or Project** (Select the CMakeLists.txt file). + +After loading, the **play** button can be configured to run the project by selecting 'custom executable' in the run target configuration and entering 'make' as executable and 'upload' as argument. -로딩을 마치면 'play' 버튼으로 프로젝트를 실행하도록 설정할 수 있습니다. 설정하는 방법은 run target configuration에서 'custom executable'을 선택하고 'make'를 실행하면서 'upload'을 인자로 입력합니다. +### Qt Creator on Windows -### Qt Creator (윈도우즈에서) +> **Note** Windows has not been tested for PX4 development with Qt Creator. -> ** 아직 Windows에서는 Qt Creator를 테스트하지 않았습니다. ** -### Qt Creator (Mac OS에서) +### Qt Creator on Mac OS -Qt Creator를 시작하기 전에, [project file](https://cmake.org/Wiki/CMake_Generator_Specific_Information#Code::Blocks_Generator)이 필요합니다. : +Before starting Qt Creator, the [project file](https://cmake.org/Wiki/CMake_Generator_Specific_Information#Code::Blocks_Generator) needs to be created: ```sh cd ~/src/Firmware -mkdir build/creator +mkdir -p build/creator cd build/creator -cmake .. -G "CodeBlocks - Unix Makefiles" +cmake ../.. -G "CodeBlocks - Unix Makefiles" ``` -이게 끝났습니다! Qt Creator를 구동시키고 아래 비디오를 참고하여 프로젝트를 빌드하기 위한 단계를 완료합니다. +That's it! Start *Qt Creator*, then complete the steps in the video below to set up the project to build. {% youtube %}https://www.youtube.com/watch?v=0pa0gS30zNw&rel=0&vq=hd720{% endyoutube %} diff --git a/kr/setup/dev_env_windows.md b/kr/setup/dev_env_windows.md index 8782c211f64..c545eab2adc 100644 --- a/kr/setup/dev_env_windows.md +++ b/kr/setup/dev_env_windows.md @@ -38,9 +38,9 @@ To use the build script: 1. Test the script by building the firmware: ``` cd $src/Firmware - make px4fmu-v2_default + make px4_fmu-v2_default ``` - On successful completion you'll find the firmware here: `Firmware/build/px4fmu-v2/src/firmware/nuttx/px4fmu-v2_default.px4` + On successful completion you'll find the firmware here: `Firmware/build/px4_fmu-v2/px4_fmu-v2_default.px4` 1. You can flash the custom firmware on Windows using *QGroundControl* or *Mission Planner* (it is not yet possible to directly flash the firmware from within the bash shell). #### Build script details diff --git a/kr/simulation/gazebo.md b/kr/simulation/gazebo.md index c9c27564e99..92894dc7949 100644 --- a/kr/simulation/gazebo.md +++ b/kr/simulation/gazebo.md @@ -42,7 +42,7 @@ PX4 펌웨어의 소스 디렉토리내에서 airframe 중에 하나로(Quads, p ```sh cd ~/src/Firmware -make posix_sitl_default gazebo +make px4_sitl_default gazebo ``` ### Quadrotor with Optical Flow @@ -70,7 +70,7 @@ make posix gazebo_plane ### 표준 VTOL ```sh -make posix_sitl_default gazebo_standard_vtol +make px4_sitl_default gazebo_standard_vtol ``` ![](../../assets/gazebo/standard_vtol.png) @@ -78,7 +78,7 @@ make posix_sitl_default gazebo_standard_vtol ### Tailsitter VTOL ```sh -make posix_sitl_default gazebo_tailsitter +make px4_sitl_default gazebo_tailsitter ``` ![](../../assets/gazebo/tailsitter.png) @@ -156,7 +156,7 @@ px4가 `sitl_run.sh` 를 실행시키는 기존 cmake 타겟에 추가하는데 * 터미널을 통해서 gazebo(다른 시뮬레이터) 서버와 클라이언트 뷰어 실행: ``` -make posix_sitl_default gazebo_none_ide +make px4_sitl_default gazebo_none_ide ``` * IDE에서 디버깅하기를 원하는 `px4_` 타겟을 선택 (예로 `px4_iris`) * IDE에서 바로 디버깅 세션을 시작 diff --git a/kr/simulation/jmavsim.md b/kr/simulation/jmavsim.md index 520986b91ec..84d0d9ae2ac 100644 --- a/kr/simulation/jmavsim.md +++ b/kr/simulation/jmavsim.md @@ -26,7 +26,7 @@ graph LR; After ensuring that the [simulation prerequisites](../setup/dev_env.md) are installed on the system, just launch: The convenience make target will compile the POSIX host build and run the simulation. ```sh -make posix_sitl_default jmavsim +make px4_sitl_default jmavsim ``` This will bring up the PX4 shell: @@ -51,7 +51,7 @@ pxh> ## Important Files * The startup script is in the [posix-configs/SITL/init](https://github.com/PX4/Firmware/tree/master/posix-configs/SITL/init) folder and named `rcS_SIM_AIRFRAME`, the default is `rcS_jmavsim_iris`. - * The root file system (the equivalent of `/` as seen by the) is located inside the build directory: `build_posix_sitl_default/src/firmware/posix/rootfs/` + * The root file system (the equivalent of `/` as seen by the) is located inside the build directory: `build/px4_sitl_default/src/firmware/posix/rootfs/` ## Taking it to the Sky diff --git a/kr/simulation/multi-vehicle-simulation.md b/kr/simulation/multi-vehicle-simulation.md index a780ff1b24e..2f0d9398a2d 100644 --- a/kr/simulation/multi-vehicle-simulation.md +++ b/kr/simulation/multi-vehicle-simulation.md @@ -19,12 +19,12 @@ ``` cd Firmware_clone git submodule update --init --recursive - make posix_sitl_default gazebo + make px4_sitl_default gazebo ``` * 환경 설정 ``` - source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default + source Tools/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/sitl_gazebo ``` diff --git a/kr/simulation/ros_interface.md b/kr/simulation/ros_interface.md index 3e7a63a01d0..1f961a7b48b 100644 --- a/kr/simulation/ros_interface.md +++ b/kr/simulation/ros_interface.md @@ -48,9 +48,9 @@ ROS로 SITL을 포함시킬려면 ROS 환경의 업데이트가 필요합니다. ```sh cd -make posix_sitl_default gazebo +make px4_sitl_default gazebo source ~/catkin_ws/devel/setup.bash // (optional) -source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default +source Tools/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/sitl_gazebo roslaunch px4 posix_sitl.launch @@ -63,7 +63,7 @@ roslaunch px4 posix_sitl.launch (혹은 수동으로 실행하는 방법) ```sh -no_sim=1 make posix_sitl_default gazebo +no_sim=1 make px4_sitl_default gazebo ``` 시뮬레이션을 구동시키고 콘솔은 다음과 같이 표시됩니다. @@ -96,7 +96,7 @@ INFO Waiting for initial data on UDP. Please start the flight simulator to proc ```sh cd -source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default +source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default ``` ROS와 동작할 때와 Iris 쿼드콥터 모델을 삽입할때처럼 이제 Gazebo를 구동시킵니다. 일단 Iris가 로드되면 자동으로 px4 app에 연결될 것입니다. diff --git a/kr/test_and_ci/continous_integration.md b/kr/test_and_ci/continous_integration.md index 5ba285c2b93..469d8884d7a 100644 --- a/kr/test_and_ci/continous_integration.md +++ b/kr/test_and_ci/continous_integration.md @@ -14,4 +14,4 @@ Travis-ci는 테스팅을 포함한 MacOS posix sitl 빌드가 있습니다. ## [CircleCI](https://circleci.com/gh/PX4/Firmware) -CircleCI는 [px4io/px4-dev-nuttx-gcc_next](https://hub.docker.com/r/px4io/px4-dev-nuttx-gcc_next/) docker 이미지를 사용해서 릴리즈되는 안정 펌웨어에 사용할 GCC의 차기 버전을 테스트합니다. makefile target quick_check를 사용해서 px4fmu-v4_default, posix_sitl_default을 컴파일하고 테스팅을 실행하고 코드 스타일을 검증합니다. +CircleCI는 [px4io/px4-dev-nuttx-gcc_next](https://hub.docker.com/r/px4io/px4-dev-nuttx-gcc_next/) docker 이미지를 사용해서 릴리즈되는 안정 펌웨어에 사용할 GCC의 차기 버전을 테스트합니다. makefile target quick_check를 사용해서 px4_fmu-v4_default, px4_sitl_default을 컴파일하고 테스팅을 실행하고 코드 스타일을 검증합니다. diff --git a/kr/test_and_ci/docker.md b/kr/test_and_ci/docker.md index a0525a0f802..2dc5232aeb6 100644 --- a/kr/test_and_ci/docker.md +++ b/kr/test_and_ci/docker.md @@ -39,7 +39,7 @@ docker run -it --privileged \ ```sh cd -make posix_sitl_default gazebo +make px4_sitl_default gazebo ``` ### 그래픽 드라이버 문제 diff --git a/kr/tutorials/tutorial_hello_sky.md b/kr/tutorials/tutorial_hello_sky.md index b7d8a491205..11b43e51464 100644 --- a/kr/tutorials/tutorial_hello_sky.md +++ b/kr/tutorials/tutorial_hello_sky.md @@ -102,9 +102,10 @@ int px4_simple_app_main(int argc, char *argv[]) 이제 이 application은 완성되어 실행할 수 있습니다. 하지만 NuttShell command로 등록하지는 않았습니다. firmware 내부로 컴파일 가능하도록 하기 위해, build 대상 module 목록에 추가합니다. 위치는 아래와 같습니다. : - * Posix SITL: [Firmware/cmake/configs/posix_sitl_default.cmake](https://github.com/PX4/Firmware/blob/master/cmake/configs/posix_sitl_default.cmake) - * Pixhawk v1/2: [Firmware/cmake/configs/nuttx_px4fmu-v2_default.cmake](https://github.com/PX4/Firmware/blob/master/cmake/configs/nuttx_px4fmu-v2_default.cmake) - * Pixracer: [Firmware/cmake/configs/nuttx_px4fmu-v4_default.cmake](https://github.com/PX4/Firmware/blob/master/cmake/configs/nuttx_px4fmu-v4_default.cmake) +* jMAVSim Simulator: `make px4_sitl_default jmavsim` +* Pixhawk v1/2: `make px4_fmu-v2_default` (or just `make px4_fmu-v2`) +* Pixhawk v3: `make px4_fmu-v4_default` +* Other boards: [Building the Code](../setup/building_px4.md#building_nuttx) 파일내에서 특정 위치에 여러분이 작성한 application을 위해 한 줄 추가합니다. @@ -112,15 +113,15 @@ int px4_simple_app_main(int argc, char *argv[]) 빌드하기: - * Pixhawk v1/2: `make px4fmu-v2_default` - * Pixhawk v3: `make px4fmu-v4_default` +* Pixhawk v1/2: `make px4_fmu-v2_default upload` +* Pixhawk v3: `make px4_fmu-v4_default upload` ## Step 4: app을 업로드하고 테스트하기 uploader를 활성화시키고 board를 리셋 : - * Pixhawk v1/2: `make px4fmu-v2_default upload` - * Pixhawk v3: `make px4fmu-v4_default upload` + * Pixhawk v1/2: `make px4_fmu-v2_default upload` + * Pixhawk v3: `make px4_fmu-v4_default upload` 보드를 리셋하기 전에 많은 컴파일 메시지를 프린트해야 하며 마지막에는 : diff --git a/zh/concept/system_startup.md b/zh/concept/system_startup.md index 419598ff752..1c8fa00db28 100644 --- a/zh/concept/system_startup.md +++ b/zh/concept/system_startup.md @@ -30,7 +30,7 @@ For that to work, a few things are required: The modules can be executed from any terminal when PX4 is already running on a system. For example: ``` -cd /build/posix_sitl_default/bin +cd /build/px4_sitl_default/bin ./px4-commander takeoff ./px4-listener sensor_accel ``` diff --git a/zh/debug/gdb_debugging.md b/zh/debug/gdb_debugging.md index ec452e9df54..4bcf2e233e8 100644 --- a/zh/debug/gdb_debugging.md +++ b/zh/debug/gdb_debugging.md @@ -14,7 +14,7 @@ translated_sha: 95b39d747851dd01c1fe5d36b24e59ec865e323e
```bash -arm-none-eabi-nm --size-sort --print-size --radix=dec build/px4fmu-v2_default/src/firmware/nuttx/firmware_nuttx | grep " [bBdD] " +arm-none-eabi-nm --size-sort --print-size --radix=dec build/px4_fmu-v2_default/src/firmware/nuttx/firmware_nuttx | grep " [bBdD] " ``` 这个NSH命令提供了剩余的空闲内存: @@ -46,13 +46,13 @@ sudo apt-get install google-perftools libgoogle-perftools-dev 首先,用如下指令编译固件: ```bash -make posix_sitl_default +make px4_sitl_default ``` 启动 jmavsim仿真:`./Tools/jmavsim_run.sh` 在另一个中断,输入: ```bash -cd build/posix_sitl_default/tmp +cd build/px4_sitl_default/tmp export HEAPPROFILE=/tmp/heapprofile.hprof export HEAP_PROFILE_TIME_INTERVAL=30 ``` @@ -137,7 +137,7 @@ EXC_RETURN: ffffffe9
```bash -arm-none-eabi-gdb build/px4fmu-v2_default/src/firmware/nuttx/firmware_nuttx +arm-none-eabi-gdb build/px4_fmu-v2_default/src/firmware/nuttx/firmware_nuttx ``` diff --git a/zh/debug/profiling.md b/zh/debug/profiling.md index 8480017ec37..cd29a011465 100644 --- a/zh/debug/profiling.md +++ b/zh/debug/profiling.md @@ -33,13 +33,13 @@ PMSP使用GDB收集堆栈踪迹。目前使用的是 `arm-none-eabi-gdb` ,未来 用法示例: ```bash -./poor-mans-profiler.sh --elf=build/px4fmu-v4_default/src/firmware/nuttx/firmware_nuttx --nsamples=30000 +./poor-mans-profiler.sh --elf=build/px4_fmu-v4_default/src/firmware/nuttx/firmware_nuttx --nsamples=30000 ``` 注意每次运行脚本都会覆盖旧的堆栈。如果你想向旧的堆栈追加而不是重写,使用选项 `--append` : ```bash -./poor-mans-profiler.sh --elf=build/px4fmu-v4_default/src/firmware/nuttx/firmware_nuttx --nsamples=30000 --append +./poor-mans-profiler.sh --elf=build/px4_fmu-v4_default/src/firmware/nuttx/firmware_nuttx --nsamples=30000 --append ``` 正如人们怀疑的那样, `--append` 加上 `--nsamples=0` 会指示脚本在不访问目标的情况下重新生成SVG。 diff --git a/zh/debug/simulation_debugging.md b/zh/debug/simulation_debugging.md index e047513e39a..72e3fef80dd 100644 --- a/zh/debug/simulation_debugging.md +++ b/zh/debug/simulation_debugging.md @@ -13,7 +13,7 @@ The Clang address sanitizer can help to find alignment (bus) errors and other me ```sh make clean # only required on first address sanitizer run after a normal build -PX4_ASAN=1 make posix jmavsim +PX4_ASAN=1 make px4_sitl jmavsim ``` ## Valgrind @@ -35,13 +35,13 @@ sudo apt-get install valgrind SITL can be launched with and without debugger attached and with either jMAVSim or Gazebo as simulation backend. This results in the start options below: ```sh -make posix_sitl_default jmavsim -make posix_sitl_default jmavsim___gdb -make posix_sitl_default jmavsim___lldb +make px4_sitl_default jmavsim +make px4_sitl_default jmavsim___gdb +make px4_sitl_default jmavsim___lldb -make posix_sitl_default gazebo -make posix_sitl_default gazebo___gdb -make posix_sitl_default gazebo___lldb +make px4_sitl_default gazebo +make px4_sitl_default gazebo___gdb +make px4_sitl_default gazebo___lldb make posix_sitl_lpe jmavsim make posix_sitl_lpe jmavsim___gdb @@ -49,7 +49,7 @@ make posix_sitl_lpe jmavsim___lldb make posix_sitl_lpe gazebo make posix_sitl_lpe gazebo___gdb -make posix_sitl_lpe gazebo___lldb +make posix_sitl_lpe gazebo___lldb ``` where the last parameter is the <viewer\_model\_debugger> triplet (using three underscores implies the default 'iris' model). diff --git a/zh/debug/system_wide_replay.md b/zh/debug/system_wide_replay.md index a3dd62704f5..a9d6bbf6168 100644 --- a/zh/debug/system_wide_replay.md +++ b/zh/debug/system_wide_replay.md @@ -35,15 +35,15 @@ Reasons for this are given below. Firmware directory): ```sh export replay= -make posix_sitl_default +make px4_sitl_default ``` This will create the output in a separate build directory - `build/posix_sitl_default_replay` (so that the parameters don't interfere with + `build/px4_sitl_default_replay` (so that the parameters don't interfere with normal builds). It's possible to choose any posix SITL build target for replay, the build system knows through the `replay` environment variable that it's in replay mode. - Add ORB publisher rules file in - `build/posix_sitl_default_replay/tmp/rootfs/orb_publisher.rules`. + `build/px4_sitl_default_replay/tmp/rootfs/orb_publisher.rules`. This file defines which module is allowed to publish which messages. It has the following format: ``` @@ -68,7 +68,7 @@ ignore_others: true to be disabled for replay. - Optional: setup parameter overrides in the file - `build/posix_sitl_default_replay/tmp/rootfs/replay_params.txt`. + `build/px4_sitl_default_replay/tmp/rootfs/replay_params.txt`. This file should contain a list of ` `, like: ``` EKF2_GB_NOISE 0.001 @@ -81,7 +81,7 @@ EKF2_GB_NOISE 0.001 directory. Only necessary if a mission should be replayed. - Start the replay: ```sh - make posix_sitl_default jmavsim + make px4_sitl_default jmavsim ``` This will automatically open the log file, apply the parameters and start to replay. Once done, it will be reported and the process can be exited. Then @@ -133,7 +133,7 @@ The parameters can be adjusted as well. They can be extracted from the log with \(install pyulog with `sudo pip install pyulog` first\): ``` -ulog_params -i $replay -d ' ' | grep -e '^EKF2' > build/posix_sitl_default_replay/tmp/rootfs/replay_params.txt +ulog_params -i $replay -d ' ' | grep -e '^EKF2' > build/px4_sitl_default_replay/tmp/rootfs/replay_params.txt ``` Then edit the parameters in the file as needed and restart the replay process with `make posix none`. This will create a new log file. diff --git a/zh/middleware/drivers.md b/zh/middleware/drivers.md index 031289571a4..fa065422406 100644 --- a/zh/middleware/drivers.md +++ b/zh/middleware/drivers.md @@ -24,7 +24,7 @@ PX4 是一个反应式系统[reactive system](../concept/architecture.md) ,使 - 系统配置文件位于[nuttx-configs](https://github.com/PX4/Firmware/tree/master/nuttx-configs). 作为应用的一部分被构建并被操作系统加载。 - PX4中间件配置位于[src/drivers/boards](https://github.com/PX4/Firmware/tree/master/src/drivers/boards).其中包括总线和GPIO映射还有硬件平台初始化代码。 - 驱动位于[src/drivers](https://github.com/PX4/Firmware/tree/master/src/drivers) -- 参考配置:运行使px4fmu-v4_default构建FMUv4配置,这是当前NuttX参考配置。 +- 参考配置:运行使px4_fmu-v4_default构建FMUv4配置,这是当前NuttX参考配置。 ### QuRT / Hexagon - 启动脚本位于 [posix-configs/](https://github.com/PX4/Firmware/tree/master/posix-configs) diff --git a/zh/middleware/micrortps.md b/zh/middleware/micrortps.md index 640229e4acb..b67f26ef058 100644 --- a/zh/middleware/micrortps.md +++ b/zh/middleware/micrortps.md @@ -63,7 +63,7 @@ set(config_rtps_receive_topics ) ``` -> **Caution** At time of writing (August 2017), only the small set of uORB topics listed above are included in our cmake files: **posix_sitl_default.cmake**, **nuttx_px4fmu-v4_default.cmake**, **posix_sdflight_default.cmake**. It is likely you will need to edit your *cmake* file and add additional uORB topics. In future we hope to define a larger standard set. +> **Caution** At time of writing (August 2017), only the small set of uORB topics listed above are included in our cmake files: **PX4/Firmware/boards/px4/sitl/default.cmake**, **PX4/Firmware/boards/px4/fmu-v4/default.cmake**, **posix_sdflight_default.cmake**. It is likely you will need to edit your *cmake* file and add additional uORB topics. In future we hope to define a larger standard set. For *manual code generation* the uORB topics that will be supported by the bridge are specified when you call **generate_microRTPS_bridge.py** (using the `-s`/`--send` and `-r`/`--receive` flags). See [Manual Generation of the Code](../middleware/micrortps_manual_code_generation.md) for more information. @@ -74,7 +74,7 @@ The *Client* source code is generated, compiled and built into the PX4 firmware To build and upload the firmware for NuttX/Pixhawk flight controllers: ```sh -make px4fmu-v4_default upload +make px4_fmu-v4_default upload ``` To build and upload the firmware for Qualcomm Snapdragon Flight: diff --git a/zh/middleware/micrortps_manual_code_generation.md b/zh/middleware/micrortps_manual_code_generation.md index 4e4c843c2e7..2972ce436da 100644 --- a/zh/middleware/micrortps_manual_code_generation.md +++ b/zh/middleware/micrortps_manual_code_generation.md @@ -141,7 +141,7 @@ The manually generated *Client* code is built and used in *exactly* the same way Specifically, once manually generated, the *Client* source code is compiled and built into the PX4 firmware as part of the normal build process. For example, to compile the code and include it in firmware for NuttX/Pixhawk targets: ```sh -make px4fmu-v4_default upload +make px4_fmu-v4_default upload ``` > **Note** You must first [disable automatic bridge code generation](#disable-automatic-bridge-code-generation) so that the toolchain uses the manually generated source code (and does not attempt to regenerate it). diff --git a/zh/ros/external_position_estimation.md b/zh/ros/external_position_estimation.md index 2e6b8dcae2d..442bbed6edd 100644 --- a/zh/ros/external_position_estimation.md +++ b/zh/ros/external_position_estimation.md @@ -5,7 +5,7 @@ translated_sha: 95b39d747851dd01c1fe5d36b24e59ec865e323e # Using Vision or Motion Capture systems -> **知悉:** Before following the instructions below, ensure that your autopilot has a firmware version with the LPE modules enabled. The LPE version of the PX4 firmware can be found inside the zip file of the latest PX4 release or it can be built from source using a build command such as `make px4fmu-v2_lpe`. See [Building the Code](../setup/building_px4.md) for more details. +> **知悉:** Before following the instructions below, ensure that your autopilot has a firmware version with the LPE modules enabled. The LPE version of the PX4 firmware can be found inside the zip file of the latest PX4 release or it can be built from source using a build command such as `make px4_fmu-v2_lpe`. See [Building the Code](../setup/building_px4.md) for more details. 本文旨在使用除GPS之外的位置数据源构建一个基于PX4的系统,例如像VICON、Optitrack之类的运动捕捉系统和像[ROVIO](https://github.com/ethz-asl/rovio)、[SVO](https://github.com/uzh-rpg/rpg_svo)或者[PTAM](https://github.com/ethz-asl/ethzasl_ptam)之类的基于视觉的估计系统。 diff --git a/zh/setup/building_px4.md b/zh/setup/building_px4.md index 713bbec2c96..cb852f90452 100644 --- a/zh/setup/building_px4.md +++ b/zh/setup/building_px4.md @@ -1,69 +1,135 @@ ---- -translated_page: https://github.com/PX4/Devguide/blob/master/en/setup/building_px4.md -translated_sha: 95b39d747851dd01c1fe5d36b24e59ec865e323e ---- +# Building PX4 Software -# 编译px4软件 +PX4 can be built on the console or in an IDE, for both simulated and hardware targets. +## Downloading PX4 Source Code {#get_px4_code} -PX4可以在控制台或者图形界面/IDE开发 +The PX4 source code is stored on Github in the [PX4/Firmware](https://github.com/PX4/Firmware) repository. We recommend that you [fork](https://help.github.com/articles/fork-a-repo/) this repository (creating a copy associated with your own Github account), and then [clone](https://help.github.com/articles/cloning-a-repository/) the source to your local computer. -## 在控制台编译 -在去到图形界面或者IDE前,验证系统设置的正确性非常重要,因此打开控制台。在 OS X, 敲击 ⌘-space ,并搜索'terminal'。在Ubuntu,单击启动栏,搜索“terminal”(或者trl+alt+T)。在windows平台,在开始菜菜单找到px4文件夹,单击'PX4 Console' +> **Tip** Forking the repository allows you to better manage your custom code. Later on you will be able to use *git* to share changes with the main project. -![](../../assets/toolchain/terminal.png) +The steps to fork and clone the project source code are: -终端在Home目录启动,我们默认去到'~/src/Firmware' 然后,克隆顶层资源库。有经验的开发者可以克隆自己的复制的[资源库](https://help.github.com/articles/fork-a-repo/) +1. [Sign up](https://github.com/) to Github. +1. Go to the [Firmware](https://github.com/PX4/Firmware) repository and click the **Fork** button near the upper right corner. + This will create and open the forked repository. -
+ ![Github Fork button](../../assets/toolchain/github_fork.png) +1. Copy the repository URL for your *Firmware* repository fork. The easiest way to do this is to click the **Clone or download** button and then copy the URL: -```sh -mkdir -p ~/src -cd ~/src -git clone https://github.com/PX4/Firmware.git -cd Firmware -git submodule update --init --recursive -cd .. -``` + ![Github Clone or download button](../../assets/toolchain/github_clone_or_download.png) +1. Open a command prompt/terminal on your computer + * On OS X, hit ⌘-space and search for 'terminal'. + * On Ubuntu, click the launch bar and search for 'terminal'. + * On Windows, find the PX4 folder in the start menu and click on 'PX4 Console'. +1. Clone the repository fork using the copied URL. This will look something like: + ``` + git clone https://github.com//Firmware.git + ``` + + > **Tip** If you're just experimenting (and don't want to make any sort of permanent changes) you can simply clone the main Firmware repository as shown: + > ```sh + > git clone https://github.com/PX4/Firmware.git + > ``` + + Windows users [refer to the Github help](https://help.github.com/desktop/guides/getting-started-with-github-desktop/installing-github-desktop/). + You can use a *git* command line client as above or instead perform the same actions with the *Github for Windows* app. + +This will copy *most* of the *very latest* version of PX4 source code onto your computer +(the rest of the code is automatically fetched from other [git submodules](https://git-scm.com/book/en/v2/Git-Tools-Submodules) when you build PX4). -现在可以通过编译源代码来构建二进制文件。在直接使用硬件前,推荐先[进行仿真](../simulation/jmavsim.md)。喜欢在图形界面开发环境工作的用户也应该继续完成下面部分。 +> **Tip** To get the source for a *specific older release*, you could then: +> ```sh +> # Navigate into Firmware directory +> cd Firmware +> +> # list the releases (tags) +> git tag -l +> +> # Checkout code for particular tag (e.g. for tag 1.7.4beta) +> git checkout v1.7.4beta +> ``` -###基于NuttX / Pixhawk的硬件板 +## First Build (Using the jMAVSim Simulator) {#jmavsim_build} -
+For the first build we'll build for a simulated target using a console environment. This allows us to validate the system setup before moving on to real hardware and an IDE. +Navigate into the **Firmware** directory and start [jMAVSim](../simulation/jmavsim.md) using the following command: ```sh -cd Firmware -make px4fmu-v2_default +make px4_sitl jmavsim ``` -注意到“make”是一个字符命令编译工具,“px4fmu-v2”是硬件/ardupilot版本,“default”是默认配置,所有的PX4编译目标遵循这个规则。 +This will bring up the PX4 console below: -成功编译的最后输出是这样的: - -
+![PX4 Console (jMAVSim)](../../assets/console_jmavsim.png) +The drone can be flown by typing: ```sh -[100%] Linking CXX executable firmware_nuttx -[100%] Built target firmware_nuttx -Scanning dependencies of target build/firmware_px4fmu-v2 -[100%] Generating nuttx-px4fmu-v2-default.px4 -[100%] Built target build/firmware_px4fmu-v2 +pxh> commander takeoff ``` -通过在命令后面添加‘upload’,编译的二进制程序就会通过USB上传到飞控硬件: +![jMAVSim UI](../../assets/jmavsim_first_takeoff.png) + +The drone can be landed by typing `commander land` and the whole simulation can be stopped by doing **CTRL+C** (or by entering `shutdown`). + +> **Tip** The simulation setup is documented in full detail here: [jMAVSim Simulation](../simulation/jmavsim.md). -
+Flying the simulation with the ground control station is closer to the real operation of the vehicle. Click on a location in the map while the vehicle is flying (takeoff flight mode) and enable the slider. This will reposition the vehicle. +![QGroundControl GoTo](../../assets/qgc_goto.jpg) + + +## NuttX / Pixhawk Based Boards + +### Building {#building_nuttx} + +To build for NuttX- or Pixhawk- based boards, navigate into the **Firmware** directory and then call `make` with the build target for your board. + +> **Note** In the example below the first part of the build target `px4_fmu-v4` is the autopilot hardware version and `default` is the configuration name (in this case the "default" configuration). All PX4 build targets follow this logic). + +For example, to build for *Pixracer* you would use the following command: +```sh +cd Firmware +make px4_fmu-v4_default +``` +A successful run will end with similar output to: ```sh -make px4fmu-v2_default upload +-- Build files have been written to: /home/youruser/src/Firmware/build/px4_fmu-v4_default +[954/954] Creating /home/youruser/src/Firmware/build/px4_fmu-v4_default/px4_fmu-v4_default.px4 ``` -上传成功时输出情况如下: +The following list shows the build commands for common boards: +* Pixhawk 4: `make px4_fmu-v5_default` +* [Pixracer](https://docs.px4.io/en/flight_controller/pixracer.html): `make px4_fmu-v4_default` +* [Pixhawk 3 Pro](https://docs.px4.io/en/flight_controller/pixhawk3_pro.html): `make px4_fmu-v4pro_default` +* [Pixhawk Mini](https://docs.px4.io/en/flight_controller/pixhawk_mini.html): `make px4_fmu-v3_default` +* [Pixhawk 2](https://docs.px4.io/en/flight_controller/pixhawk-2.html): `make px4_fmu-v3_default` +* [mRo Pixhawk](https://docs.px4.io/en/flight_controller/mro_pixhawk.html): `make px4_fmu-v3_default` (supports 2MB Flash) +* [HKPilot32](https://docs.px4.io/en/flight_controller/HKPilot32.html): `make px4_fmu-v2_default` +* [Pixfalcon](https://docs.px4.io/en/flight_controller/pixfalcon.html): `make px4_fmu-v2_default` +* [Dropix](https://docs.px4.io/en/flight_controller/dropix.html): `make px4_fmu-v2_default` +* [MindPX](https://docs.px4.io/en/flight_controller/mindpx.html)/[MindRacer](https://docs.px4.io/en/flight_controller/mindracer.html): `make airmind_mindpx-v2_default` +* [mRo X-2.1](https://docs.px4.io/en/flight_controller/mro_x2.1.html): `make auav_x21_default` +* [Crazyflie 2.0](https://docs.px4.io/en/flight_controller/crazyflie2.html): `make bitcraze_crazyflie_default` +* [Intel® Aero Ready to Fly Drone](https://docs.px4.io/en/flight_controller/intel_aero.html): `make intel_aerofc-v1_default` +* [Pixhawk 1](https://docs.px4.io/en/flight_controller/pixhawk.html): `make px4_fmu-v2_default` + > **Warning** You **must** use a [supported version of GCC](../setup/dev_env_linux_ubuntu.md#nuttx-based-hardware) to build this board (e.g. the same as used by [CI/docker](../test_and_ci/docker.md)) or remove modules from the build. Building with an unsupported GCC may fail, as PX4 is close to the board's 1MB flash limit. +* Pixhawk 1 with 2 MB flash: `make px4_fmu-v3_default` + +> **Note** Generally the `_default` suffix is optional (i.e. you can also build using `make px4_fmu-v4`, `make bitcraze_crazyflie`, etc.). + + +### Uploading Firmware (Flashing the board) + +Append `upload` to the make commands to upload the compiled binary to the autopilot hardware via USB. For example + +```sh +make px4_fmu-v4_default upload +``` -
+A successful run will end with this output: ```sh Erase : [====================] 100.0% @@ -74,56 +140,60 @@ Rebooting. [100%] Built target upload ``` -### Raspberry Pi 2 开发板 +## Other Boards +The following boards have more complicated build and/or deployment instructions. -以下命令编译生成Raspbian(posix_pi2_release)版本的固件。 +### Raspberry Pi 2/3 Boards +The command below builds the target for [Raspberry Pi 2/3 Navio2](https://docs.px4.io/en/flight_controller/raspberry_pi_navio2.html). + +#### Cross-compiler Build ```sh cd Firmware -make posix_rpi2_release # for cross-compiler build +make emlid_navio2_cross # for cross-compiler build ``` -"mainapp"可执行文件位于目录build/posix_rpi2_release/src/firmware/posix下。 将其复制到RPi(用你的RPi的IP或主机名替换YOUR_PI,关于如何访问你的RPi,查看[介绍](https://docs.px4.io/en/flight_controller/raspberry_pi_navio2.html#developer-quick-start)) +The "px4" executable file is in the directory **build/emlid_navio2_cross/**. +Make sure you can connect to your RPi over ssh, see [instructions how to access your RPi](https://docs.px4.io/en/flight_controller/raspberry_pi_navio2.html#developer-quick-start). -然后使用以下命令设置你的RPi的IP(或主机名): +Then set the IP (or hostname) of your RPi using: ```sh export AUTOPILOT_HOST=192.168.X.X ``` -并上传: +And upload it with: ```sh cd Firmware -make posix_rpi_cross upload # for cross-compiler build +make emlid_navio2_cross upload # for cross-compiler build ``` -然后,通过ssh连接并运行它(以root权限): +Then, connect over ssh and run it with (as root): ```sh -sudo ./px4 px4.config +sudo ./bin/px4 -s px4.config ``` -#### 本地构建 - +#### Native Build -如果你要直接在Pi上编译,则需要在本地编译固件(posix_rpi_native)。 +If you're building *directly* on the Pi, you will want the native build target (emlid_navio2_native). ```sh cd Firmware -make posix_rpi_native # for native build +make emlid_navio2_native # for native build ``` -“px4”可执行文件位于目录build/posix_rpi_native/src/firmware/posix中。直接运行: - +The "px4" executable file is in the directory **build/emlid_navio2_native/**. +Run it directly with: ```sh -sudo ./build/posix_rpi_native/src/firmware/posix/px4 ./posix-configs/rpi/px4.config +sudo ./build/emlid_navio2_native/px4 ./posix-configs/rpi/px4.config ``` -px4成功执行的情况如下: +A successful build followed by executing px4 will give you something like this: ```sh @@ -140,168 +210,165 @@ px4 starting. pxh> ``` -#### 自启动 - -要自动启动px4,在`exit 0`之前,请将以下内容添加到文件`/etc/rc.local`中(如果使用本机构建,请相应调整): +#### Autostart -``` -cd /home/pi && ./px4 -d px4.config > px4.log +To autostart px4, add the following to the file **/etc/rc.local** (adjust it +accordingly if you use native build), right before the `exit 0` line: +```sh +cd /home/pi && ./bin/px4 -d -s px4.config > px4.log ``` ### Parrot Bebop -支持的Bebop是非常早期的版本,使用前请特别注意。 +Support for the [Parrot Bebop](https://docs.px4.io/en/flight_controller/bebop.html) is at an early stage and should be used very carefully. -#### 编译 +#### Build ```sh cd Firmware -make posix_bebop_default +make parrot_bebop_default ``` -打开你的Bebop,通过Bebop的wifi连接你的主机。 然后,按下电源按钮四次以启用ADB并启动telnet守护程序。 +Turn on your Bebop and connect your host machine with the Bebop's wifi. +Then, press the power button +four times to enable ADB and to start the telnet daemon. ```sh -make posix_bebop_default upload +make parrot_bebop_default upload ``` -以上操作会将PX4 mainapp上传到/usr/bin并创建文件/home/root/parameters(如果尚未存在)。 此外,我们需要Bebop的mixer文件和px4.config。 当前这两个文件必须使用以下命令手动复制。 +This will upload the PX4 mainapp into /data/ftp/internal_000/ and create the file /home/root/parameters if not already +present. This also uploads the mixer file and the px4.config file into the /home/root/ directory. -```sh -adb connect 192.168.42.1:9050 -adb push ROMFS/px4fmu_common/mixers/bebop.main.mix /home/root -adb push posix-configs/bebop/px4.config /home/root -adb disconnect -``` - -#### 运行 - -连接Bebop的wifi,然后按电源按钮四次。 接下来,通过telnet或adb shell与Bebop连接,并运行以下命令。 +#### Run +Connect to the Bebop's wifi and press the power button four times. +Next, +connect with the Bebop via telnet or adb shell and run the commands bellow. ```sh telnet 192.168.42.1 ``` -通过以下命令关闭Bebop的所有驱动。 - +Kill the Bebop's proprietary driver with ```sh kk ``` - -启动PX4 mainapp: - +and start the PX4 mainapp with: ```sh -px4 /home/root/px4.config +/data/ftp/internal_000/px4 -s /home/root/px4.config ``` -为了飞行Bebop,将操纵杆设备与主机连接并启动QGroundControl。 Bebop和操纵杆都应该被识别。按照说明校准传感器并设置操纵杆设备。 - -#### 自启动 - +In order to fly the Bebop, connect a joystick device with your host machine and start QGroundControl. Both, +the Bebop and the joystick should be recognized. Follow the instructions to calibrate the sensors +and setup your joystick device. -要使启动时在Bebop上自动启动PX4,请修改init脚本`/etc/init.d/rcS_mode_default`。 添加下行: +#### Autostart +To auto-start PX4 on the Bebop at boot, modify the init script `/etc/init.d/rcS_mode_default`. Comment the following line: ``` DragonStarter.sh -out2null & ``` - -替换为: - +Replace it with: ``` -px4 -d /home/root/px4.config > /home/root/px4.log +echo 1 > /sys/class/gpio/gpio85/value # enables the fan +/data/ftp/internal_000/px4 -d -s /home/root/px4.config > /home/root/px4.log & ``` -通过按电源按钮4次启用adb服务器,并按照上述方式连接到adb服务器: - - +Enable adb server by pressing the power button 4 times and connect to adb server as described before: ```sh adb connect 192.168.42.1:9050 ``` - -将系统分区重新挂载为可写: +Re-mount the system partition as writeable: ```sh adb shell mount -o remount,rw / ``` -为了避免手动配置文件,可以使用下面链接: https://gist.github.com/mhkabir/b0433f0651f006e3c7ac4e1cbd83f1e8 - -保存原来的,并将其推送到Bebop +In order to avoid editing the file manually, you can use this one : https://gist.github.com/bartslinger/8908ff07381f6ea3b06c1049c62df44e +Save the original one and push this one to the Bebop ```sh adb shell cp /etc/init.d/rcS_mode_default /etc/init.d/rcS_mode_default_backup adb push rcS_mode_default /etc/init.d/ ``` - -同步并重启 +Sync and reboot: ```sh adb shell sync adb shell reboot ``` -### 基于QuRT / Snapdragon的开发板 +### OcPoC-Zynq Mini + +Build instructions for the [OcPoC-Zynq Mini](https://docs.px4.io/en/flight_controller/ocpoc_zynq.html) are covered in: +* [Aerotenna OcPoC-Zynq Mini Flight Controller > Building PX4 for OcPoC-Zynq](https://docs.px4.io/en/flight_controller/ocpoc_zynq.html#building-px4-for-ocpoc-zynq) (PX4 User Guide) +* [OcPoC PX4 Setup Page](https://aerotenna.readme.io/docs/px4-setup) + + +### QuRT / Snapdragon Based Boards -#### 编译 +This section shows how to build for the [Qualcomm Snapdragon Flight](https://docs.px4.io/en/flight_controller/snapdragon_flight.html). -以下命令编译Linux和DSP端的固件。 两个可执行机构通过[muORB](../middleware/uorb.md)进行通信。 +#### Build + +> **Note** If you use the [Qualcomm ESC board](http://shop.intrinsyc.com/products/qualcomm-electronic-speed-control-board) (UART-based), then please follow their instructions [here](https://github.com/ATLFlight/ATLFlightDocs/blob/master/PX4.md). If you use normal PWM-based ESCs boards, then you may continue to follow the instructions on this page. + +The commands below build the targets for the Linux and the DSP side. Both executables communicate via [muORB](../middleware/uorb.md). ```sh cd Firmware -make eagle_default +make atlflight_eagle_default ``` -要将SW加载到设备上,通过USB数据线进行连接,并确保设备已启动。 在新的终端窗口中运行: +To load the SW on the device, connect via USB cable and make sure the device is booted. Run this in a new terminal window: ```sh adb shell ``` -返回上一个终端并上传: +Go back to previous terminal and upload: ```sh -make eagle_default upload +make atlflight_eagle_default upload ``` +Note that this will also copy (and overwrite) the two config files [mainapp.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/mainapp.config) and [px4.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/px4.config) to the device. Those files are stored under /usr/share/data/adsp/px4.config and /home/linaro/mainapp.config respectively if you want to edit the startup scripts directly on your vehicle. -请注意,这也将复制(并覆盖)[mainapp.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/mainapp.config)和[px4.config](https://github.com/PX4/Firmware/blob/master/posix-configs/eagle/flight/px4.config)这两个配置文件到设备。 如果你要直接编辑启动脚本,文件路径分别为/usr/share/data/adsp/px4.config和/home/linaro/mainapp.config。 - -当前需要手动复制mixer +The mixer currently needs to be copied manually: ```sh adb push ROMFS/px4fmu_common/mixers/quad_x.main.mix /usr/share/data/adsp ``` -#### 运行 +#### Run -运行DSP调试监视器: +Run the DSP debug monitor: ```sh ${HEXAGON_SDK_ROOT}/tools/debug/mini-dm/Linux_Debug/mini-dm ``` -注意:如果是在Mac上,你也可以使用[nano-dm](https://github.com/kevinmehall/nano-dm)。 - -回到ADB shell并运行px4: +Note: alternatively, especially on Mac, you can also use [nano-dm](https://github.com/kevinmehall/nano-dm). +Go back to ADB shell and run px4: ```sh cd /home/linaro ./px4 mainapp.config ``` -请注意,只要断开USB数据线(或者ssh会话断开连接),px4就会停止。 如果要飞行,你应该在启动后使px4自动启动。 +Note that the px4 will stop as soon as you disconnect the USB cable (or if you ssh session is disconnected). To fly, you should make the px4 auto-start after boot. -#### 自启动 +#### Autostart +To run the px4 as soon as the Snapdragon has booted, you can add the startup to `rc.local`: -要在Snapdragon启动时一直运行px4,可以将启动添加到`rc.local`中: 或者直接编辑文件`/etc/rc.local`: - +Either edit the file `/etc/rc.local` directly on the Snapdragon: ```sh adb shell vim /etc/rc.local ``` -或将文件复制到你的电脑,在本地进行编辑,然后将其复制回来: +Or copy the file to your computer, edit it locally, and copy it back: ```sh adb pull /etc/rc.local @@ -309,7 +376,7 @@ gedit rc.local adb push rc.local /etc/rc.local ``` -对于自动启动,在 `exit 0`之前添加以下行: +For the auto-start, add the following line before `exit 0`: ```sh (cd /home/linaro && ./px4 mainapp.config > mainapp.log) @@ -317,85 +384,62 @@ adb push rc.local /etc/rc.local exit 0 ``` -确保`rc.local`是可执行的: +Make sure that the `rc.local` is executable: ```sh adb shell chmod +x /etc/rc.local ``` -然后重新启动Snapdragon: +Then reboot the Snapdragon: ```sh adb reboot ``` +## Compiling in a Graphical IDE -##图形IDE界面下编译 -PX4 支持Qt Creator, Eclipse 和Sublime Text三种集成式开发环境。 Qt Creator是最友好的开发环境,所以被是唯一官方支持的IDE。除非资深的Eclipse 或Sublime开发者,否则一般不推荐使用Eclipse或Sublime进行二次开发。硬件底层开发可以在 [Eclipse project](https://github.com/PX4/Firmware/blob/master/eclipse.project) 和 a [Sublime project](https://github.com/PX4/Firmware/blob/master/Firmware.sublime-project) 找到源码。 +The PX4 system supports Qt Creator, Eclipse and Sublime Text. Qt Creator is the most user-friendly variant and hence the only officially supported IDE. Unless an expert in Eclipse or Sublime, their use is discouraged. Hardcore users can find an [Eclipse project](https://github.com/PX4/Firmware/blob/master/eclipse.project) and a [Sublime project](https://github.com/PX4/Firmware/blob/master/Firmware.sublime-project) in the source tree. -{% raw %} - -{% endraw %} +{% youtube %}https://www.youtube.com/watch?v=Bkk8zttWxEI&rel=0&vq=hd720{% endyoutube %} -## Qt Creator 功能 -Qt creator 提供单击选择变量、代码自动补全、代码编译和固件上传等功能。 +## Qt Creator Functionality -![](../../assets/toolchain/qtcreator.png) +Qt creator offers clickable symbols, auto-completion of the complete codebase and building and flashing firmware. -### Linux 平台的 Qt Creator +![](../../assets/toolchain/qtcreator.png) -在启动Qt creator之前, 需要先创建[工程文件](https://cmake.org/Wiki/CMake_Generator_Specific_Information#Code::Blocks_Generator) : +### Qt Creator on Linux -
+Before starting Qt Creator, the [project file](https://cmake.org/Wiki/CMake_Generator_Specific_Information#Code::Blocks_Generator) needs to be created: ```sh cd ~/src/Firmware mkdir ../Firmware-build cd ../Firmware-build -cmake ../Firmware -G "CodeBlocks - Unix Makefiles" -DCONFIG=nuttx_px4fmu-v2_default +cmake ../Firmware -G "CodeBlocks - Unix Makefiles" ``` -接着启动Qt creator(如果系统没安装Qt Creator 百度一下linux下安装Qt Creator,然后再启动Qt Creator)并加载 Firmware 根目录下 CMakeLists.txt 文件,步骤:点击工具栏 File -> Open File or Project -> Select the CMakeLists.txt file 。 -如果加载提示ninja没有安装,请按照“高级Linux”章节进行ninja编译工具的安装,安装完成后,log out(登出)并log in(登入)。 -加载了文件后,点击左侧projects按钮,在run onfiguration栏选择'custom executable',在executable 栏里输入'make', argument栏输入 'upload',将‘play’按钮配置成运行工程。 +Then load the CMakeLists.txt in the root firmware folder via **File > Open File or Project** (Select the CMakeLists.txt file). +After loading, the **play** button can be configured to run the project by selecting 'custom executable' in the run target configuration and entering 'make' as executable and 'upload' as argument. -### Windows平台的 Qt Creator +### Qt Creator on Windows - +> **Note** Windows has not been tested for PX4 development with Qt Creator. -### Mac OS 平台的 Qt Creator -启动 Qt Creator 之前,需要先创建 [project file](https://cmake.org/Wiki/CMake_Generator_Specific_Information#Code::Blocks_Generator) : +### Qt Creator on Mac OS -
+Before starting Qt Creator, the [project file](https://cmake.org/Wiki/CMake_Generator_Specific_Information#Code::Blocks_Generator) needs to be created: ```sh cd ~/src/Firmware -mkdir build/creator +mkdir -p build/creator cd build/creator -cmake .. -G "CodeBlocks - Unix Makefiles" +cmake ../.. -G "CodeBlocks - Unix Makefiles" ``` -完成上述步骤以后,启动 Qt Creator, 完成下面视频中的步骤,就可以进行工程文件的编译了。 +That's it! Start *Qt Creator*, then complete the steps in the video below to set up the project to build. -{% raw %} - -{% endraw %} +{% youtube %}https://www.youtube.com/watch?v=0pa0gS30zNw&rel=0&vq=hd720{% endyoutube %} diff --git a/zh/simulation/gazebo.md b/zh/simulation/gazebo.md index 75cfc3f32d5..e09d9f4c126 100644 --- a/zh/simulation/gazebo.md +++ b/zh/simulation/gazebo.md @@ -76,13 +76,11 @@ PX4 SITL使用Gazebo仿真软件,但不依赖ROS。但是也可以像普通飞 ```sh cd ~/src/Firmware -make posix_sitl_default gazebo +make px4_sitl_default gazebo ``` ### 四旋翼带光流模块 -
- ```sh cd ~/src/Firmware make posix gazebo_iris_opt_flow @@ -108,7 +106,7 @@ make posix gazebo_plane ### 标准垂直起降飞机 ```sh -make posix_sitl_default gazebo_standard_vtol +make px4_sitl_default gazebo_standard_vtol ``` ![](../../assets/gazebo/standard_vtol.png) @@ -116,7 +114,7 @@ make posix_sitl_default gazebo_standard_vtol ### 立式垂直起降 ```sh -make posix_sitl_default gazebo_tailsitter +make px4_sitl_default gazebo_tailsitter ``` ![](../../assets/gazebo/tailsitter.png) @@ -194,7 +192,7 @@ make posix gazebo ### 如何使用 * 通过终端运行gazebo(或任何其他模拟器)服务器(server)和客户端(client)查看器: ``` -make posix_sitl_default gazebo_none_ide +make px4_sitl_default gazebo_none_ide ``` * 在您的IDE中选择您要调试的px4_ 目标(例如`px4_iris`) * 直接从IDE启动调试会话(session) diff --git a/zh/simulation/jmavsim.md b/zh/simulation/jmavsim.md index 9745d4d609e..b2b07372537 100644 --- a/zh/simulation/jmavsim.md +++ b/zh/simulation/jmavsim.md @@ -21,7 +21,7 @@ graph LR;
```sh -make posix_sitl_default jmavsim +make px4_sitl_default jmavsim ``` 这将启动PX4 shell: @@ -46,7 +46,7 @@ pxh> ## 重要的文件 - 启动脚本文件在 [posix-configs/SITL/init](https://github.com/PX4/Firmware/tree/master/posix-configs/SITL/init) 文件夹中并被命名为`rcS_SIM_AIRFRAME`, 默认是 `rcS_jmavsim_iris`. -- 系统启动文件 (相当于 `/` 被视为) 位于构建文件夹内部 : `build/posix_sitl_default/src/firmware/posix/rootfs/` +- 系统启动文件 (相当于 `/` 被视为) 位于构建文件夹内部 : `build/px4_sitl_default/src/firmware/posix/rootfs/` ## 起飞 diff --git a/zh/simulation/multi-vehicle-simulation.md b/zh/simulation/multi-vehicle-simulation.md index 1431af77a46..f26744cbb50 100644 --- a/zh/simulation/multi-vehicle-simulation.md +++ b/zh/simulation/multi-vehicle-simulation.md @@ -24,12 +24,12 @@ To test an example setup, follow the below steps, ``` cd Firmware_clone git submodule update --init --recursive - make posix_sitl_default gazebo + make px4_sitl_default gazebo ``` * source your environment, ``` - source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/posix_sitl_default + source Tools/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/sitl_gazebo ``` diff --git a/zh/simulation/ros_interface.md b/zh/simulation/ros_interface.md index 22b255493f3..edfdac6be41 100644 --- a/zh/simulation/ros_interface.md +++ b/zh/simulation/ros_interface.md @@ -53,9 +53,9 @@ sudo apt-get install ros-$(ROS_DISTRO)-gazebo6-ros-pkgs ```sh cd -make posix_sitl_default +make px4_sitl_default source ~/catkin_ws/devel/setup.bash -source Tools/setup_gazebo.bash $(pwd) build/posix_sitl_default +source Tools/setup_gazebo.bash $(pwd) build/px4_sitl_default export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd) export ROS_PACKAGE_PATH=$ROS_PACKAGE_PATH:$(pwd)/Tools/sitl_gazebo roslaunch px4 posix_sitl.launch @@ -69,7 +69,7 @@ roslaunch px4 posix_sitl.launch (或者如何手动运行) ```sh -no_sim=1 make posix_sitl_default gazebo +no_sim=1 make px4_sitl_default gazebo ``` 这将启动仿真器,控制台看上去是这样的: @@ -101,7 +101,7 @@ INFO Waiting for initial data on UDP. Please start the flight simulator to proc ```sh cd -source Tools/setup_gazebo.bash $(pwd) +source Tools/setup_gazebo.bash $(pwd) ``` > 这里`Firmware_clone`指的就是你下载Firmware时的文件夹.可以具体查看Tools下的README.md以及setup_gazebo.bash文件. diff --git a/zh/test_and_ci/continous_integration.md b/zh/test_and_ci/continous_integration.md index 6bc2d53e5ab..6d6df286481 100644 --- a/zh/test_and_ci/continous_integration.md +++ b/zh/test_and_ci/continous_integration.md @@ -19,5 +19,6 @@ Semaphore is primarily used to compile changes for the Qualcomm Snapdragon platf ## [CircleCI](https://circleci.com/gh/PX4/Firmware) -CircleCI tests the proposed next version of GCC to be used for stable firmware releases using the docker image [px4io/px4-dev-nuttx-gcc_next](https://hub.docker.com/r/px4io/px4-dev-nuttx-gcc_next/). It uses the makefile target quick_check which compiles px4fmu-v4_default, posix_sitl_default, runs testing, and verifies code style. +CircleCI tests the proposed next version of GCC to be used for stable firmware releases using the docker image [px4io/px4-dev-nuttx-gcc_next](https://hub.docker.com/r/px4io/px4-dev-nuttx-gcc_next/). +It uses the makefile target `quick_check` which compiles `px4_fmu-v4_default`, `px4_sitl_default`, runs testing, and verifies code style. diff --git a/zh/test_and_ci/docker.md b/zh/test_and_ci/docker.md index f76ccd674de..ef48fc8c146 100644 --- a/zh/test_and_ci/docker.md +++ b/zh/test_and_ci/docker.md @@ -44,7 +44,7 @@ If everything went well you should be in a new bash shell now. Verify if everyth ```sh cd -make posix_sitl_default gazebo +make px4_sitl_default gazebo ``` ### Graphics driver issues diff --git a/zh/tutorials/tutorial_hello_sky.md b/zh/tutorials/tutorial_hello_sky.md index 9a664463e07..f29a5cbb1cf 100644 --- a/zh/tutorials/tutorial_hello_sky.md +++ b/zh/tutorials/tutorial_hello_sky.md @@ -115,9 +115,10 @@ int px4_simple_app_main(int argc, char *argv[]) 现在应用程序已经完成并且能够运行,但还没有注册成NuttShell命令行工具。如果想要将应用程序编译到固件中,将它加到下面的模块编译列表中: -- Pixhawk v1/2: [Firmware/cmake/configs/nuttx_px4fmu-v2_default.cmake](https://github.com/PX4/Firmware/blob/master/cmake/configs/nuttx_px4fmu-v2_default.cmake) - -- Pixracer: [Firmware/cmake/configs/nuttx_px4fmu-v4_default.cmake](https://github.com/PX4/Firmware/blob/master/cmake/configs/nuttx_px4fmu-v4_default.cmake) +* PX4 SITL (Simulator): [Firmware/boards/px4/sitl/default.cmake](https://github.com/PX4/Firmware/blob/master/boards/px4/sitl/default.cmake) +* Pixhawk v1/2: [Firmware/boards/px4/fmu-v2/default.cmake](https://github.com/PX4/Firmware/blob/master/boards/px4/fmu-v2/default.cmake) +* Pixracer (px4/fmu-v4): [Firmware/boards/px4/fmu-v4/default.cmake](https://github.com/PX4/Firmware/blob/master/boards/px4/fmu-v4/default.cmake) +* *cmake* files for other boards can be found in [Firmware/boards/](https://github.com/PX4/Firmware/tree/master/boards) 在你的应用程序的下面的文件中添加一行: @@ -128,16 +129,16 @@ int px4_simple_app_main(int argc, char *argv[]) 编译它: -- Pixhawk v1/2: `make px4fmu-v2_default` -- Pixhawk v3: `make px4fmu-v4_default` +- Pixhawk v1/2: `make px4_fmu-v2_default` +- Pixhawk v3: `make px4_fmu-v4_default` ## 第四步:上传并且测试应用程序 使能uploader然后重置开发板: -- Pixhawk v1/2: `make px4fmu-v2_default upload` -- Pixhawk v3: `make px4fmu-v4_default upload` +- Pixhawk v1/2: `make px4_fmu-v2_default upload` +- Pixhawk v3: `make px4_fmu-v4_default upload` 在你重置开发板之前,会在后面打印如下的编译信息: @@ -145,8 +146,6 @@ int px4_simple_app_main(int argc, char *argv[]) 一旦开发板重置成功并且应用程序上传成功,打印信息: -
- ```sh Erase : [====================] 100.0% Program: [====================] 100.0%