mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-11-09 18:21:35 +08:00
WIP
This commit is contained in:
@@ -8,10 +8,7 @@
|
||||
"program": "${command:cmake.launchTargetPath}",
|
||||
"args": [
|
||||
"${workspaceFolder}/ROMFS/px4fmu_common",
|
||||
"-s",
|
||||
"etc/init.d-posix/rcS",
|
||||
"-t",
|
||||
"${workspaceFolder}/test_data"
|
||||
"-s", "etc/init.d-posix/rcS"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${command:cmake.buildDirectory}/tmp",
|
||||
|
||||
@@ -7,9 +7,7 @@
|
||||
"request": "launch",
|
||||
"program": "${command:cmake.launchTargetPath}",
|
||||
"args": [
|
||||
"${workspaceFolder}/ROMFS/px4fmu_common",
|
||||
"-s", "etc/init.d-posix/rcS",
|
||||
"-t", "${workspaceFolder}/test_data"
|
||||
"${workspaceFolder}/ROMFS/px4fmu_common"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${command:cmake.buildDirectory}/tmp",
|
||||
@@ -48,52 +46,7 @@
|
||||
]
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "SITL (jmavsim iris)",
|
||||
"type": "cppdbg",
|
||||
"request": "launch",
|
||||
"program": "${command:cmake.launchTargetPath}",
|
||||
"args": [
|
||||
"${workspaceFolder}/ROMFS/px4fmu_common",
|
||||
"-s", "etc/init.d-posix/rcS",
|
||||
"-t", "${workspaceFolder}/test_data"
|
||||
],
|
||||
"stopAtEntry": false,
|
||||
"cwd": "${command:cmake.buildDirectory}/tmp",
|
||||
"environment": [
|
||||
{
|
||||
"name": "PX4_SIM_MODEL",
|
||||
"value": "iris"
|
||||
}
|
||||
],
|
||||
"preLaunchTask": "jmavsim",
|
||||
"postDebugTask": "jmavsim kill",
|
||||
"linux": {
|
||||
"MIMode": "gdb",
|
||||
"externalConsole": false,
|
||||
"setupCommands": [
|
||||
{
|
||||
"description": "Enable pretty-printing for gdb",
|
||||
"text": "-enable-pretty-printing",
|
||||
"ignoreFailures": true
|
||||
},
|
||||
{
|
||||
"description": "PX4 ignore wq signals",
|
||||
"text": "handle SIGCONT nostop noprint nopass",
|
||||
"ignoreFailures": true
|
||||
}
|
||||
]
|
||||
},
|
||||
"osx": {
|
||||
"MIMode": "lldb",
|
||||
"externalConsole": true,
|
||||
"setupCommands": [
|
||||
{
|
||||
"text": "pro hand -p true -s false -n false SIGCONT",
|
||||
}
|
||||
]
|
||||
}
|
||||
},
|
||||
|
||||
{
|
||||
"name": "SITL (shell)",
|
||||
"type": "cppdbg",
|
||||
@@ -145,18 +98,9 @@
|
||||
"id": "PX4_SIM_MODEL",
|
||||
"description": "PX4_SIM_MODEL",
|
||||
"options": [
|
||||
"iris",
|
||||
"typhoon_h480",
|
||||
"plane",
|
||||
"plane_catapult",
|
||||
"plane_lidar",
|
||||
"standard_vtol",
|
||||
"tailsitter",
|
||||
"tiltrotor",
|
||||
"r1_rover",
|
||||
"boat"
|
||||
"x4",
|
||||
],
|
||||
"default": "iris"
|
||||
"default": "x4"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -53,7 +53,7 @@ if(parallel_jobs LESS 1)
|
||||
endif()
|
||||
|
||||
message(DEBUG "${NUMBER_OF_LOGICAL_CORES} logical cores detected and ${AVAILABLE_PHYSICAL_MEMORY} megabytes of memory available.
|
||||
Limiting sitl_gazebo and simulation-ignition concurrent jobs to ${parallel_jobs}")
|
||||
Limiting sitl_gazebo concurrent jobs to ${parallel_jobs}")
|
||||
|
||||
# project to build sitl_gazebo if necessary
|
||||
px4_add_git_submodule(TARGET git_gazebo PATH "${PX4_SOURCE_DIR}/Tools/sitl_gazebo")
|
||||
@@ -73,20 +73,6 @@ ExternalProject_Add(sitl_gazebo
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> -- -j ${parallel_jobs}
|
||||
)
|
||||
|
||||
px4_add_git_submodule(TARGET git_ign_gazebo PATH "${PX4_SOURCE_DIR}/Tools/simulation-ignition")
|
||||
ExternalProject_Add(simulation-ignition
|
||||
SOURCE_DIR ${PX4_SOURCE_DIR}/Tools/simulation-ignition
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
|
||||
BINARY_DIR ${PX4_BINARY_DIR}/build_ign_gazebo
|
||||
INSTALL_COMMAND ""
|
||||
DEPENDS git_ign_gazebo
|
||||
USES_TERMINAL_CONFIGURE true
|
||||
USES_TERMINAL_BUILD true
|
||||
EXCLUDE_FROM_ALL true
|
||||
BUILD_ALWAYS 1
|
||||
BUILD_COMMAND ${CMAKE_COMMAND} --build <BINARY_DIR> -- -j ${parallel_jobs}
|
||||
)
|
||||
|
||||
ExternalProject_Add(mavsdk_tests
|
||||
SOURCE_DIR ${PX4_SOURCE_DIR}/test/mavsdk_tests
|
||||
CMAKE_ARGS -DCMAKE_INSTALL_PREFIX=${CMAKE_INSTALL_PREFIX}
|
||||
@@ -129,7 +115,6 @@ set(viewers
|
||||
none
|
||||
jmavsim
|
||||
gazebo
|
||||
ignition
|
||||
)
|
||||
|
||||
set(debuggers
|
||||
@@ -222,8 +207,6 @@ foreach(viewer ${viewers})
|
||||
add_dependencies(${_targ_name} px4 sitl_gazebo)
|
||||
elseif(viewer STREQUAL "jmavsim")
|
||||
add_dependencies(${_targ_name} px4 git_jmavsim)
|
||||
elseif(viewer STREQUAL "ignition")
|
||||
add_dependencies(${_targ_name} px4 simulation-ignition)
|
||||
endif()
|
||||
else()
|
||||
if(viewer STREQUAL "gazebo")
|
||||
@@ -413,6 +396,16 @@ if(ENABLE_LOCKSTEP_SCHEDULER STREQUAL "no")
|
||||
endforeach()
|
||||
endif()
|
||||
|
||||
|
||||
# Ignition Gazebo
|
||||
add_custom_target(ignition_x4
|
||||
COMMAND ${PX4_SOURCE_DIR}/Tools/sitl_run.sh $<TARGET_FILE:px4> none ignition x4 none ${PX4_SOURCE_DIR} ${PX4_BINARY_DIR}
|
||||
WORKING_DIRECTORY ${SITL_WORKING_DIR}
|
||||
USES_TERMINAL
|
||||
DEPENDS logs_symlink
|
||||
)
|
||||
|
||||
|
||||
string(REPLACE ";" "," posix_vmd_make_target_list "${all_posix_vmd_make_targets}")
|
||||
|
||||
add_custom_target(list_vmd_make_targets
|
||||
|
||||
@@ -34,7 +34,6 @@ foreach(test_name ${tests})
|
||||
add_test(NAME ${test_name_prefix}
|
||||
COMMAND $<TARGET_FILE:px4>
|
||||
-s ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_${test_name}_generated
|
||||
-t ${PX4_SOURCE_DIR}/test_data
|
||||
${PX4_SOURCE_DIR}/ROMFS/px4fmu_test
|
||||
WORKING_DIRECTORY ${SITL_WORKING_DIR}
|
||||
)
|
||||
@@ -62,7 +61,6 @@ foreach(test_name ${cmd_tests})
|
||||
add_test(NAME ${test_name_prefix}
|
||||
COMMAND $<TARGET_FILE:px4>
|
||||
-s ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_${test_name}_generated
|
||||
-t ${PX4_SOURCE_DIR}/test_data
|
||||
${PX4_SOURCE_DIR}/ROMFS/px4fmu_test
|
||||
WORKING_DIRECTORY ${SITL_WORKING_DIR}
|
||||
)
|
||||
@@ -79,7 +77,6 @@ endforeach()
|
||||
add_test(NAME sitl-mavlink
|
||||
COMMAND $<TARGET_FILE:px4>
|
||||
-s ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_mavlink
|
||||
-t ${PX4_SOURCE_DIR}/test_data
|
||||
${PX4_SOURCE_DIR}/ROMFS/px4fmu_test
|
||||
WORKING_DIRECTORY ${SITL_WORKING_DIR}
|
||||
)
|
||||
@@ -93,7 +90,6 @@ sanitizer_fail_test_on_error(sitl-mavlink)
|
||||
add_test(NAME sitl-imu_filtering
|
||||
COMMAND $<TARGET_FILE:px4>
|
||||
-s ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_imu_filtering
|
||||
-t ${PX4_SOURCE_DIR}/test_data
|
||||
${PX4_SOURCE_DIR}/ROMFS/px4fmu_test
|
||||
WORKING_DIRECTORY ${SITL_WORKING_DIR}
|
||||
)
|
||||
@@ -108,7 +104,6 @@ sanitizer_fail_test_on_error(sitl-imu_filtering)
|
||||
# add_test(NAME sitl-shutdown
|
||||
# COMMAND $<TARGET_FILE:px4>
|
||||
# -s ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/test_shutdown
|
||||
# -t ${PX4_SOURCE_DIR}/test_data
|
||||
# ${PX4_SOURCE_DIR}/ROMFS/px4fmu_test
|
||||
# WORKING_DIRECTORY ${SITL_WORKING_DIR}
|
||||
# )
|
||||
@@ -149,7 +144,6 @@ foreach(cmd_name ${test_cmds})
|
||||
COMMAND $<TARGET_FILE:px4>
|
||||
${PX4_SOURCE_DIR}/ROMFS/px4fmu_test
|
||||
-s ${PX4_SOURCE_DIR}/posix-configs/SITL/init/test/cmd_${cmd_name}_generated
|
||||
-t ${PX4_SOURCE_DIR}/test_data
|
||||
WORKING_DIRECTORY ${SITL_WORKING_DIR}
|
||||
)
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/****************************************************************************
|
||||
*
|
||||
* Copyright (C) 2015-2018 PX4 Development Team. All rights reserved.
|
||||
* Copyright (C) 2015-2022 PX4 Development Team. All rights reserved.
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
@@ -197,8 +197,7 @@ int main(int argc, char **argv)
|
||||
/* Server/daemon apps need to parse the command line arguments. */
|
||||
|
||||
std::string data_path{};
|
||||
std::string commands_file = "etc/init.d/rcS";
|
||||
std::string test_data_path{};
|
||||
std::string commands_file = "etc/init.d-posix/rcS";
|
||||
std::string working_directory{};
|
||||
int instance = 0;
|
||||
|
||||
@@ -206,7 +205,7 @@ int main(int argc, char **argv)
|
||||
int ch;
|
||||
const char *myoptarg = nullptr;
|
||||
|
||||
while ((ch = px4_getopt(argc, argv, "hdt:s:i:w:", &myoptind, &myoptarg)) != EOF) {
|
||||
while ((ch = px4_getopt(argc, argv, "hds:i:w:", &myoptind, &myoptarg)) != EOF) {
|
||||
switch (ch) {
|
||||
case 'h':
|
||||
print_usage();
|
||||
@@ -216,10 +215,6 @@ int main(int argc, char **argv)
|
||||
pxh_off = true;
|
||||
break;
|
||||
|
||||
case 't':
|
||||
test_data_path = myoptarg;
|
||||
break;
|
||||
|
||||
case 's':
|
||||
commands_file = myoptarg;
|
||||
break;
|
||||
@@ -270,18 +265,6 @@ int main(int argc, char **argv)
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (test_data_path != "") {
|
||||
const std::string required_test_data_path = "./test_data";
|
||||
|
||||
if (!dir_exists(required_test_data_path)) {
|
||||
ret = symlink(test_data_path.c_str(), required_test_data_path.c_str());
|
||||
|
||||
if (ret != PX4_OK) {
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!file_exists(commands_file)) {
|
||||
PX4_ERR("Error opening startup file, does not exist: %s", commands_file.c_str());
|
||||
return -1;
|
||||
@@ -550,7 +533,7 @@ void print_usage()
|
||||
{
|
||||
printf("Usage for Server/daemon process: \n");
|
||||
printf("\n");
|
||||
printf(" px4 [-h|-d] [-s <startup_file>] [-t <test_data_directory>] [<rootfs_directory>] [-i <instance>] [-w <working_directory>]\n");
|
||||
printf(" px4 [-h|-d] [-s <startup_file>] [<rootfs_directory>] [-i <instance>] [-w <working_directory>]\n");
|
||||
printf("\n");
|
||||
printf(" -s <startup_file> shell script to be used as startup (default=etc/init.d/rcS)\n");
|
||||
printf(" <rootfs_directory> directory where startup files and mixers are located,\n");
|
||||
|
||||
Reference in New Issue
Block a user