* Add vitepress tree * Update existing workflows so they dont trigger on changes in the docs path * Add nojekyll, package.json, LICENCE etc * Add crowdin docs upload/download scripts * Add docs flaw checker workflows * Used docs prefix for docs workflows * Crowdin obvious fixes * ci: docs move to self hosted runner runs on a beefy server for faster builds Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: don't run build action for docs or ci changes Signed-off-by: Ramon Roche <mrpollo@gmail.com> * ci: update runners Signed-off-by: Ramon Roche <mrpollo@gmail.com> * Add docs/en * Add docs assets and scripts * Fix up editlinks to point to PX4 sources * Download just the translations that are supported * Add translation sources for zh, uk, ko * Update latest tranlsation and uorb graphs * update vitepress to latest --------- Signed-off-by: Ramon Roche <mrpollo@gmail.com> Co-authored-by: Ramon Roche <mrpollo@gmail.com>
6.8 KiB
Відлагодження симуляції
Поскільки симуляція виконується на машині-хості, всі інструменти розробки робочого стола доступні.
CLANG Address Sanitizer (Mac OS, Linux)
Засіб очищення адрес Clang може допомогти знайти помилки вирівнювання (шини) та інші помилки пам’яті, такі як помилки сегментації. Команда нижче встановлює правильні параметри компіляції.
make clean # only required on first address sanitizer run after a normal build
PX4_ASAN=1 make px4_sitl jmavsim
Valgrind
brew install valgrind
або
sudo apt-get install valgrind
Для використання valgrind під час симуляції SITL:
make px4_sitl_default jmavsim___valgrind
Запустіть Gazebo Classic SITL без відлагоджувача
За замовчуванням SITL запускається без приєднаного відлагоджувача при використанні будь-якого симулятора:
make px4_sitl_default gz
make px4_sitl_default gazebo-classic
make px4_sitl_default jmavsim
Для Gazebo Classic (тільки) ви також можете запустити симулятор з прикріпленим відладчиком. Зверніть увагу, що ви повинні вказати тип транспортного засобу в цільовому симуляторі, як показано нижче:
make px4_sitl_default gazebo-classic_iris_gdb
make px4_sitl_default gazebo-classic_iris_lldb
Це запустить відлагоджувач та запустить додаток SITL з Gazebo та симулятором Iris.
In order to break into the debugger shell and halt the execution, hit CTRL-C:
Process 16529 stopped
* thread #1: tid = 0x114e6d, 0x00007fff90f4430a libsystem_kernel.dylib`__read_nocancel + 10, name = 'px4', queue = 'com.apple.main-thread', stop reason = signal SIGSTOP
frame #0: 0x00007fff90f4430a libsystem_kernel.dylib`__read_nocancel + 10
libsystem_kernel.dylib`__read_nocancel:
-> 0x7fff90f4430a <+10>: jae 0x7fff90f44314 ; <+20>
0x7fff90f4430c <+12>: movq %rax, %rdi
0x7fff90f4430f <+15>: jmp 0x7fff90f3fc53 ; cerror_nocancel
0x7fff90f44314 <+20>: retq
(lldb)
In order to not have the DriverFrameworks scheduling interfere with the debugging session SIGCONT should be masked in LLDB and GDB:
(lldb) process handle SIGCONT -n false -p false -s false
Або у випадку GDB:
(gdb) обробка SIGCONT noprint nostop
Після цього оболонки lldb або gdb працюють як звичайні сеанси, будь ласка, зверніться до документації LLDB / GDB.
Останній параметр, триплет <viewer_model_debugger>, фактично передається make у каталозі збірки, отже
make px4_sitl_default gazebo-classic_iris_gdb
еквівалентний з
make px4_sitl_default # Configure with cmake
make -C build/px4_sitl_default classic_iris_gdb
Повний список доступних цілей make в каталозі збірки можна отримати за допомогою:
make help
Прикріплення GDB до запущеного SITL
You can also start your simulation, and then attach gdb:
-
У одному термінальному вікні введіть команду для запуску вашої симуляції:
make px4_sitl_default gazebo-classicAs the script runs, note the SITL COMMAND: output text located right above the large "PX4" text. Він перерахує місце розташування вашого файлу px4 bin для подальшого використання.
SITL COMMAND: "<px4 bin file>" "<build dir>"/etc ______ __ __ ___ | ___ \ \ \ / / / | | |_/ / \ V / / /| | | __/ / \ / /_| | | | / /^\ \ \___ | \_| \/ \/ |_/ px4 starting. INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0 INFO [init] found model autostart file as SYS_AUTOSTART=10015 -
Відкрийте ще один термінал та введіть:
ps -aВам слід зафіксувати PID процесу з назвою "PX4"
(У цьому прикладі це 14149)
atlas:~/px4/main/PX4-Autopilot$ ps -a PID TTY TIME CMD 1796 tty2 00:01:59 Xorg 1836 tty2 00:00:00 gnome-session-b 14027 pts/1 00:00:00 make 14077 pts/1 00:00:00 sh 14078 pts/1 00:00:00 cmake 14079 pts/1 00:00:00 ninja 14090 pts/1 00:00:00 sh 14091 pts/1 00:00:00 bash 14095 pts/1 00:01:23 gzserver 14149 pts/1 00:02:48 px4 14808 pts/2 00:00:00 ps -
Потім введіть у тому ж вікні
sudo gdb [px4 bin file path (from step 1) here]Наприклад,
sudo gdb /home/atlas/px4/base/PX4-Autopilot/build/px4_sitl_default/bin/px4Тепер ви можете прикріпитися до екземпляра PX4, введіть PID, вказаний у кроці 2.
attach [PID on px4]Тепер у вас повинен бути інтерфейс GDB для налагодження.
Оптимізація компілятора
It is possible to suppress compiler optimization for given executables and/or modules (as added by cmake with add_executable or add_library) when configuring
for posix_sitl_*.
Це може бути зручним, коли необхідно пройтися по коду з відлагоджувачем або роздрукувати змінні, які інакше були б оптимізовані.
To do so, set the environment variable PX4_NO_OPTIMIZATION to be a semi-colon separated list of regular expressions that match the targets that need to be compiled without optimization.
This environment variable is ignored when the configuration isn't posix_sitl_*.
Наприклад,
export PX4_NO_OPTIMIZATION='px4;^modules__uORB;^modules__systemlib$'
would suppress optimization of the targets: platforms__posix__px4_layer, modules__systemlib, modules__uORB, examples__px4_simple_app, modules__uORB__uORB_tests and px4.
Цілі, які можуть відповідати цим регулярним виразам, можна надрукувати за допомогою команди:
make -C build/posix_sitl_* list_cmake_targets