utiasSTARS / PX4-PhoenixDrone

PX4 Source Code for Phoenix Tail-sitter
Other
7 stars 10 forks source link

make errors #7

Closed zhenfu128 closed 1 year ago

zhenfu128 commented 4 years ago

Hello, I want to use your PhoenixDrone PX4 code to control my tailsitter. When I executemake nuttx_px4fmu-v4_tailsitter I encounter an error that

`-- nuttx-px4fmu-v4-tailsitter -- CMAKE_INSTALL_PREFIX: -- cmake module path: /home/zhenfu/src/PX4-PhoenixDrone/cmake -- Nuttx build for px4fmu-v4 on m4 hardware, using nsh with ROMFS on px4fmu_common CMake Deprecation Warning at /usr/share/cmake-3.10/Modules/CMakeForceCompiler.cmake:69 (message): The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set CMAKE_C_COMPILER and allow CMake to identify the compiler. Call Stack (most recent call first): cmake/toolchains/Toolchain-arm-none-eabi.cmake:31 (cmake_force_c_compiler) /usr/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:94 (include) CMakeLists.txt:235 (project)

CMake Deprecation Warning at /usr/share/cmake-3.10/Modules/CMakeForceCompiler.cmake:83 (message): The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set CMAKE_CXX_COMPILER and allow CMake to identify the compiler. Call Stack (most recent call first): cmake/toolchains/Toolchain-arm-none-eabi.cmake:37 (cmake_force_cxx_compiler) /usr/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:94 (include) CMakeLists.txt:235 (project)

CMake Deprecation Warning at /usr/share/cmake-3.10/Modules/CMakeForceCompiler.cmake:69 (message): The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set CMAKE_C_COMPILER and allow CMake to identify the compiler. Call Stack (most recent call first): cmake/toolchains/Toolchain-arm-none-eabi.cmake:31 (cmake_force_c_compiler) build_nuttx_px4fmu-v4_tailsitter/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include) CMakeLists.txt:235 (project)

CMake Deprecation Warning at /usr/share/cmake-3.10/Modules/CMakeForceCompiler.cmake:83 (message): The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set CMAKE_CXX_COMPILER and allow CMake to identify the compiler. Call Stack (most recent call first): cmake/toolchains/Toolchain-arm-none-eabi.cmake:37 (cmake_force_cxx_compiler) build_nuttx_px4fmu-v4_tailsitter/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include) CMakeLists.txt:235 (project)

-- The ASM compiler identification is GNU -- Found assembler: /opt/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc CMake Deprecation Warning at CMakeLists.txt:239 (cmake_policy): The OLD behavior for policy CMP0025 will be removed from a future version of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD.

-- Found PythonInterp: /usr/bin/python (found version "2.7.17") -- NuttX patch: nuttx-patches/Fixed-Shadow-wanings.patch -- NuttX patch: nuttx-patches/c++11.patch -- NuttX patch: nuttx-patches/ctypecctype.patch -- NuttX patch: nuttx-patches/export_insitu.patch -- NuttX patch: nuttx-patches/fixStdint.patch -- NuttX patch: nuttx-patches/fix_CRTSCTS-define.patch -- NuttX patch: nuttx-patches/math.h.patch -- NuttX patch: nuttx-patches/nsh_parse.patch -- NuttX patch: nuttx-patches/serial_dma_hotfix.patch -- NuttX patch: nuttx-patches/silence-jobserver-warnings.patch -- NuttX patch: nuttx-patches/static_asset-fix.patch -- NuttX patch: nuttx-patches/wip_inflight_to_upstream.patch -- Using C++03 -- Release build type: RelWithDebInfo -- Adding UAVCAN STM32 platform driver -- Adding ROMFS on px4fmu-v4 -- Configuring done -- Generating done -- Build files have been written to: /home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter PX4 CONFIG: /home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter ninja: Entering directory '/home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter' [29/632] Building NuttX for px4fmu-v4 with nsh FAILED: px4fmu-v4/NuttX/nuttx/nuttx-export/include/nuttx/config.h cd /home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter && /bin/rm -rf /home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx/nuttx-export && /usr/bin/make --no-print-directory --quiet -C /home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx -r CONFIG_ARCH_BOARD=px4fmu-v4 export > nuttx_build.log stdio/lib_sscanf.c: In function 'vsscanf': stdio/lib_sscanf.c:419:28: error: this statement may fall through [-Werror=implicit-fallthrough=] sign = true; ^ stdio/lib_sscanf.c:420:21: note: here case 'u': ^~~~ cc1: all warnings being treated as errors make[2]: [bin/lib_sscanf.o] Error 1 make[1]: [libc/libc.a] Error 2 ninja: build stopped: subcommand failed. Makefile:140: recipe for target 'nuttx_px4fmu-v4_tailsitter' failed make: *** [nuttx_px4fmu-v4_tailsitter] Error 1`

Could you please tell me what's wrong with it?

davidefolli93 commented 4 years ago

Hi,

also the recipe for target posix_sitl_tailsitter gazebo_STARS_TS is failing during compilations

ninja: Entering directory `/home/dave/src/PhoenixDrone/PX4-PhoenixDrone/build_posix_sitl_tailsitter' [128/519] Building C object src/drivers/boards/sitl/CMakeFiles/driversboardssitl.dir/sitl_led.c.o FAILED: src/drivers/boards/sitl/CMakeFiles/driversboardssitl.dir/sitl_led.c.o /usr/bin/cc -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"driversboardssitl\" -DDF_LINUX -D__PX4_LINUX -DPX4_POSIX -DSTDC_FORMAT_MACROS -Dnoreturn_function="attribute((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -std=gnu99 -fno-common -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -fvisibility=hidden -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/drivers/boards/sitl/CMakeFiles/driversboardssitl.dir/sitl_led.c.o -MF src/drivers/boards/sitl/CMakeFiles/driversboardssitl.dir/sitl_led.c.o.d -o src/drivers/boards/sitl/CMakeFiles/driversboards__sitl.dir/sitl_led.c.o -c ../src/drivers/boards/sitl/sitl_led.c cc1: error: ‘-Werror=’ argument ‘-Werror=reorder’ is not valid for C [-Werror] compilation terminated due to -Wfatal-errors. cc1: all warnings being treated as errors [133/519] Performing configure step for 'sitl_gazebo'

Trying again to compile, new errors appears:

X4 CONFIG: /home/dave/src/PhoenixDrone/PX4-PhoenixDrone/build_posix_sitl_tailsitter ninja: Entering directory `/home/dave/src/PhoenixDrone/PX4-PhoenixDrone/build_posix_sitl_tailsitter' [1/383] Building C object src/drivers/boards/sitl/CMakeFiles/driversboardssitl.dir/sitl_led.c.o FAILED: src/drivers/boards/sitl/CMakeFiles/driversboardssitl.dir/sitl_led.c.o /usr/bin/cc -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"driversboardssitl\" -DDF_LINUX -D__PX4_LINUX -DPX4_POSIX -DSTDC_FORMAT_MACROS -Dnoreturn_function="attribute((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -std=gnu99 -fno-common -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -fvisibility=hidden -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/drivers/boards/sitl/CMakeFiles/driversboardssitl.dir/sitl_led.c.o -MF src/drivers/boards/sitl/CMakeFiles/driversboardssitl.dir/sitl_led.c.o.d -o src/drivers/boards/sitl/CMakeFiles/driversboardssitl.dir/sitl_led.c.o -c ../src/drivers/boards/sitl/sitl_led.c cc1: error: ‘-Werror=’ argument ‘-Werror=reorder’ is not valid for C [-Werror] compilation terminated due to -Wfatal-errors. cc1: all warnings being treated as errors [4/383] Building CXX object src/drivers/gps/CMakeFiles/driversgps.dir/gps.cpp.o FAILED: src/drivers/gps/CMakeFiles/driversgps.dir/gps.cpp.o /usr/bin/c++ -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"gps\" -DPX4_MAIN=gps_app_main -DDF_LINUX -DPX4_LINUX -D__PX4_POSIX -DSTDC_FORMAT_MACROS -Dnoreturn_function="attribute((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -fno-exceptions -fno-rtti -std=gnu++0x -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -DCUSTOM_FILE_IO -fcheck-new -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wno-missing-field-initializers -fvisibility=hidden -include visibility.h -pthread -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/drivers/gps/CMakeFiles/driversgps.dir/gps.cpp.o -MF src/drivers/gps/CMakeFiles/driversgps.dir/gps.cpp.o.d -o src/drivers/gps/CMakeFiles/drivers__gps.dir/gps.cpp.o -c ../src/drivers/gps/gps.cpp ../src/drivers/gps/gps.cpp: In member function ‘void GPS::task_main()’: ../src/drivers/gps/gps.cpp:720:11: error: this statement may fall through [-Werror=implicit-fallthrough=] _mode = GPS_DRIVER_MODE_UBX;


compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[6/383] Building CXX object src/drivers/gps/CMakeFiles/drivers__gps.dir/devices/src/ashtech.cpp.o
ninja: build stopped: subcommand failed.
Makefile:140: recipe for target 'posix_sitl_tailsitter' failed
make: *** [posix_sitl_tailsitter] Error 1

### and trying again new errors
PX4 CONFIG: /home/dave/src/PhoenixDrone/PX4-PhoenixDrone/build_posix_sitl_tailsitter
ninja: Entering directory `/home/dave/src/PhoenixDrone/PX4-PhoenixDrone/build_posix_sitl_tailsitter'
[1/376] Building C object src/drivers/boards/sitl/CMakeFiles/drivers__boards__sitl.dir/sitl_led.c.o
FAILED: src/drivers/boards/sitl/CMakeFiles/drivers__boards__sitl.dir/sitl_led.c.o 
/usr/bin/cc -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"drivers__boards__sitl\" -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -std=gnu99 -fno-common -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -fvisibility=hidden -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/drivers/boards/sitl/CMakeFiles/drivers__boards__sitl.dir/sitl_led.c.o -MF src/drivers/boards/sitl/CMakeFiles/drivers__boards__sitl.dir/sitl_led.c.o.d -o src/drivers/boards/sitl/CMakeFiles/drivers__boards__sitl.dir/sitl_led.c.o   -c ../src/drivers/boards/sitl/sitl_led.c
cc1: error: ‘-Werror=’ argument ‘-Werror=reorder’ is not valid for C [-Werror]
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
[3/376] Building CXX object src/drivers/vmount/CMakeFiles/drivers__vmount.dir/input_mavlink.cpp.o
FAILED: src/drivers/vmount/CMakeFiles/drivers__vmount.dir/input_mavlink.cpp.o 
/usr/bin/c++  -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"vmount\" -DPX4_MAIN=vmount_app_main -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -fno-exceptions -fno-rtti -std=gnu++0x -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wno-missing-field-initializers -fvisibility=hidden -include visibility.h -pthread -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/drivers/vmount/CMakeFiles/drivers__vmount.dir/input_mavlink.cpp.o -MF src/drivers/vmount/CMakeFiles/drivers__vmount.dir/input_mavlink.cpp.o.d -o src/drivers/vmount/CMakeFiles/drivers__vmount.dir/input_mavlink.cpp.o -c ../src/drivers/vmount/input_mavlink.cpp
../src/drivers/vmount/input_mavlink.cpp: In member function ‘virtual int vmount::InputMavlinkCmdMount::update_impl(unsigned int, vmount::ControlData**)’:
../src/drivers/vmount/input_mavlink.cpp:267:43: error: this statement may fall through [-Werror=implicit-fallthrough=]
      _control_data.gimbal_shutter_retract = true;
      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[4/376] Building CXX object src/drivers/gps/CMakeFiles/drivers__gps.dir/gps.cpp.o
FAILED: src/drivers/gps/CMakeFiles/drivers__gps.dir/gps.cpp.o 
/usr/bin/c++  -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"gps\" -DPX4_MAIN=gps_app_main -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -fno-exceptions -fno-rtti -std=gnu++0x -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wno-missing-field-initializers -fvisibility=hidden -include visibility.h -pthread -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/drivers/gps/CMakeFiles/drivers__gps.dir/gps.cpp.o -MF src/drivers/gps/CMakeFiles/drivers__gps.dir/gps.cpp.o.d -o src/drivers/gps/CMakeFiles/drivers__gps.dir/gps.cpp.o -c ../src/drivers/gps/gps.cpp
../src/drivers/gps/gps.cpp: In member function ‘void GPS::task_main()’:
../src/drivers/gps/gps.cpp:720:11: error: this statement may fall through [-Werror=implicit-fallthrough=]
     _mode = GPS_DRIVER_MODE_UBX;
     ~~~~~~^~~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[5/376] Building CXX object src/drivers/pwm_out_sim/CMakeFiles/drivers__pwm_out_sim.dir/pwm_out_sim.cpp.o
FAILED: src/drivers/pwm_out_sim/CMakeFiles/drivers__pwm_out_sim.dir/pwm_out_sim.cpp.o 
/usr/bin/c++  -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"pwm_out_sim\" -DPX4_MAIN=pwm_out_sim_app_main -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -fno-exceptions -fno-rtti -std=gnu++0x -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wno-missing-field-initializers -fvisibility=hidden -include visibility.h -pthread -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/drivers/pwm_out_sim/CMakeFiles/drivers__pwm_out_sim.dir/pwm_out_sim.cpp.o -MF src/drivers/pwm_out_sim/CMakeFiles/drivers__pwm_out_sim.dir/pwm_out_sim.cpp.o.d -o src/drivers/pwm_out_sim/CMakeFiles/drivers__pwm_out_sim.dir/pwm_out_sim.cpp.o -c ../src/drivers/pwm_out_sim/pwm_out_sim.cpp
../src/drivers/pwm_out_sim/pwm_out_sim.cpp: In member function ‘int PWMSim::pwm_ioctl(device::file_t*, int, long unsigned int)’:
../src/drivers/pwm_out_sim/pwm_out_sim.cpp:728:3: error: this statement may fall through [-Werror=implicit-fallthrough=]
   if (_num_outputs < 8) {
   ^~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[6/376] Building CXX object src/drivers/vmount/CMakeFiles/drivers__vmount.dir/output.cpp.o
ninja: build stopped: subcommand failed.
Makefile:140: recipe for target 'posix_sitl_tailsitter' failed
make: *** [posix_sitl_tailsitter] Error 1

### Looking here
https://github.com/PX4/Firmware/issues/9863#issuecomment-414814528
and here
https://github.com/PX4/windows-toolchain/issues/19#issuecomment-613744954
it looks like that we may have some compatibility problem beetwen the PX4 code and the toolchain used to build the code.

How did you installed the toolchain? 
I used the scripts from the page
https://dev.px4.io/v1.9.0/en/setup/dev_env_linux.html
but it is possible that we have to install an older toolchain to make stuff to compile successfully
davidefolli93 commented 4 years ago

Hi @yilun-wu ,

I see that last commit has been made by you. Can you tell us which versions of toolchain softwares should be used to build these sources?

Thank you!

Vuwij commented 4 years ago

Hi, Ubuntu 16.04. Also, the repository is currently being fixed and cleaned up in a few month with updated toolchain, Ubuntu 18.04 and a reliable PX4 version and there will be a new version soon. What is your project about?

If you want to still try this go to each module which has an error and add the cmake arguments to ignore these issues. (If the error is Werror=implicit-fallthrough, then add the argument -Wno-implicit-fallthrough

zhenfu128 commented 4 years ago

@Vuwij Hi, what is the current version of the PX4 version used in this repository? I have tried Ubuntu 18.04 and PX4 master version. And it is not worked.

Vuwij commented 4 years ago

Hi this repository uses 16.04. There is no PX4 version, you just compile the PX4 version used in the repository. An update to 18.04 will be made in a future release to be announced

davidefolli93 commented 4 years ago

Hi @Vuwij thank you for your quick response and sorry for my delay.

Here a quick intro. My project is a common tailsitter: prior to the lockdown here in Italy I was playing around with it, trying to configure it in the correct way and making it flying. Actually, I have not been so much lucky :D

Being not anymore able to fly, I started to search for some simulation strategies and I found very impressive tools and performances of your team's video https://www.youtube.com/watch?v=VSAk3Z0G08Q and I decided to try them.

In my first comment to this thread my machine was running Ubuntu 18.04 but i decided to go back to ubuntu 16.04 to reduce unknown factors and eventually unknown troubles. Now I'm running ubuntu 16.04 and I installed the toolchain with the oldest available toolchain installations guide from PX4 dev guide https://dev.px4.io/v1.8.0/en/setup/dev_env_linux_ubuntu.html#convenience-bash-scripts using the scripts https://raw.githubusercontent.com/PX4/Devguide/v1.8.0/build_scripts/ubuntu_sim_nuttx.sh https://raw.githubusercontent.com/PX4/Devguide/v1.8.0/build_scripts/ubuntu_sim_ros_gazebo.sh

After upgrading ROS gpg key I managed to install all the packages running successfully both the scripts, but unfortunately I'm still facing compilations errors, like this one [29/632] Building NuttX for px4fmu-v4 with nsh FAILED: cd /home/ultra/src/PhoenixDrone/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter && /bin/rm -rf /home/ultra/src/PhoenixDrone/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx/nuttx-export && /usr/bin/make --no-print-directory --quiet -C /home/ultra/src/PhoenixDrone/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx -r CONFIG_ARCH_BOARD=px4fmu-v4 export > nuttx_build.log stdio/lib_sscanf.c: In function 'vsscanf': stdio/lib_sscanf.c:419:28: error: this statement may fall through [-Werror=implicit-fallthrough=] sign = true; ^ stdio/lib_sscanf.c:420:21: note: here case 'u': ^~~~ cc1: all warnings being treated as errors Searching around the web some hypothesys are made about ccache tool but I had no luck neither with the proposed version.

Do you have any suggestions about the toolchain installation? Should we consider not anymore supported this version of your repos and should we instead wait for the new version based on ubuntu 18.04?

Thank you!

Vuwij commented 4 years ago

Hi, I'll make a quick fix in a few days so you can play with it for now. But in 2 months I'll try and release the 18.04 updates for the tailsitter.

davidefolli93 commented 4 years ago

Hi @Vuwij

Thank you for your willingness! Actually, in the past night I managed to successfully compile the target nuttx_px4fmu-v4_tailsitter I have to check sitl target and if I can minimize the patched files. After these two operations, I will share with you the diff needed to compile. Maybe it can be useful to ensure some kind of "legacy support" for this firmware version :)

Vuwij commented 4 years ago

No worries that sounds good. If you have a fork of the repository you can just send a pull request and I'll do the merge for the fixes that got it to work

davidefolli93 commented 4 years ago

Hi @Vuwij ,

I noticed that PX4-PhoenixDrone repo is based on submodules from the original PX4 projects. As you can see from the patches that I attached, I have modified also some of the submodules' files, therefore a pull request on this repo would be not enough.

I did not succeded at compiling posix_sitl_tailsitter gazebo_STARS_TS target The toolchain ubuntu_sim_nuttx.sh installs gazebo9. Using aptitude I managed to fix conflicts and to install gazebo7. Unfortunately this did not solved compilation errors

LOG_make_posix_sitl_tailsitter.txt

LOG_make_nuttx_px4fmu-v4_tailsitter.txt

patch.tar.gz

zhenfu128 commented 4 years ago

@Vuwij hello, I have make nuttx_px4fmu-v4_tailsitter and upload to my pixracer successfully in Ubuntu 16.04. And I want to connect the pixracer to QGC. But the QGC cannot detect the pixracer. Do you know why? What QGC version do you use? Thank you for helping. By the way, do you use Wechat app? Could you please add my Wechat ID for more disscussion? Thank you very much. My wechat ID: captain_fu

davidefolli93 commented 4 years ago

Hi @zhenfu128 How did you managed to successfully compile the target nuttx_px4fmu-v4_tailsitter? Did you used the patch/modifications that I suggested in my patch.tar.gz?

In case that you did not need at all of my suggested patches, how did you managed to compile the target on ubuntu 16.04? how did you installed the PX4 dev toolchain?

Can you try to compile also the target posix_sitl_tailsitter gazebo_STARS_TS on your machine?

Thank you

zhenfu128 commented 4 years ago

Hi, @davidefolli93 I don't use your patch.

I built with this toolchain https://www.ncnynl.com/archives/201709/2009.html which is written in Chinese. And you can use pushd . cd ~ wget https://launchpad.net/gcc-arm-embedded/5.0/5-2016-q2-update/+download/gcc-arm-none-eabi-5_4-2016q2-20160622-linux.tar.bz2 tar -jxf gcc-arm-none-eabi-5_4-2016q2-20160622-linux.tar.bz2 exportline="export PATH=$HOME/gcc-arm-none-eabi-5_4-2016q2/bin:\$PATH" if grep -Fxq "$exportline" ~/.profile; then echo nothing to do ; else echo $exportline >> ~/.profile; fi . ~/.profile popd to install GCC 5.4 After you install the toolchain, you could dirictly run make nuttx_px4fmu-v4_tailsitter. But I have encounter a problem that QGC cannot connect to my vehicle.

I haven't try simulation with gazebo yet. But I will try it.

davidefolli93 commented 4 years ago

Hi @zhenfu128 ,

thank you for the guide that you shared. I finally managed to build the target nuttx_px4fmu-v4_tailsitter without modifications, warnings or errors! Thank you! @Vuwij do you think that it is possible to add to a readme file the toolchain installation guide described in the link provided by @zhenfu128 ?

@zhenfu128 I tried to navigate that website looking for gazebo and ros installation instructions but I had no luck using google translate :( Did you find any reference to gazebo and ros installation in that site? Thank you

zhenfu128 commented 4 years ago

Hi @zhenfu128 ,

thank you for the guide that you shared. I finally managed to build the target nuttx_px4fmu-v4_tailsitter without modifications, warnings or errors! Thank you! @Vuwij do you think that it is possible to add to a readme file the toolchain installation guide described in the link provided by @zhenfu128 ?

@zhenfu128 I tried to navigate that website looking for gazebo and ros installation instructions but I had no luck using google translate :( Did you find any reference to gazebo and ros installation in that site? Thank you

you can try this to install ros and gazebo https://github.com/ethz-asl/rotors_simulator

zouxu634866 commented 4 years ago

hi@davidefolli93, When I execute make posix_sitl_tailsitter gazebo_STARS I encounter an error that you also encountered.Have you managed to build the target posix_sitl_tailsitter gazebo_STARS ??Thank you

mohammadrezaaerospace commented 3 years ago

I used Ubuntu 16.04 and PX4 1.8.0 according to what compiling the code needed and also I checked and did web address you said (https://github.com/utiasSTARS/PX4-PhoenixDrone/issues/7) but still the code building makes errors that is: make nuttx_px4fmu-v4_tailsitter PX4 CONFIG: /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter ninja: Entering directory `/home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter' [2/605] Building NuttX for px4fmu-v4 with nsh FAILED: cd /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter && /bin/rm -rf /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx/nuttx-export && /usr/bin/make --no-print-directory --quiet -C /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx -r CONFIG_ARCH_BOARD=px4fmu-v4 export > nuttx_build.log stdio/lib_sscanf.c: In function 'vsscanf': stdio/lib_sscanf.c:419:28: error: this statement may fall through [-Werror=implicit-fallthrough=]                        sign = true;                             ^ stdio/lib_sscanf.c:420:21: note: here                      case 'u':                      ^~~~ cc1: all warnings being treated as errors make[2]: [bin/lib_sscanf.o] Error 1 make[1]: [libc/libc.a] Error 2 ninja: build stopped: subcommand failed. Makefile:140: recipe for target 'nuttx_px4fmu-v4_tailsitter' failed make: *** [nuttx_px4fmu-v4_tailsitter] Error 1

mohammadrezaaerospace commented 3 years ago

Hi @zhenfu128 ,

thank you for the guide that you shared. I finally managed to build the target nuttx_px4fmu-v4_tailsitter without modifications, warnings or errors! Thank you! @Vuwij do you think that it is possible to add to a readme file the toolchain installation guide described in the link provided by @zhenfu128 ?

@zhenfu128 I tried to navigate that website looking for gazebo and ros installation instructions but I had no luck using google translate :( Did you find any reference to gazebo and ros installation in that site? Thank you

Hi, I used Ubuntu 16.04 and PX4 1.8.0 according to what compiling the code needed and also I checked and did web address you said (https://github.com/utiasSTARS/PX4-PhoenixDrone/issues/7) but still the code building makes errors that is: make nuttx_px4fmu-v4_tailsitter PX4 CONFIG: /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter ninja: Entering directory `/home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter' [2/605] Building NuttX for px4fmu-v4 with nsh FAILED: cd /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter && /bin/rm -rf /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx/nuttx-export && /usr/bin/make --no-print-directory --quiet -C /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx -r CONFIG_ARCH_BOARD=px4fmu-v4 export > nuttx_build.log stdio/lib_sscanf.c: In function 'vsscanf': stdio/lib_sscanf.c:419:28: error: this statement may fall through [-Werror=implicit-fallthrough=]                        sign = true;                             ^ stdio/lib_sscanf.c:420:21: note: here                      case 'u':                      ^~~~ cc1: all warnings being treated as errors make[2]: [bin/lib_sscanf.o] Error 1 make[1]: [libc/libc.a] Error 2 ninja: build stopped: subcommand failed. Makefile:140: recipe for target 'nuttx_px4fmu-v4_tailsitter' failed make: *** [nuttx_px4fmu-v4_tailsitter] Error 1

yilun-wu commented 3 years ago

I used Ubuntu 16.04 and PX4 1.8.0 according to what compiling the code needed and also I checked and did web address you said (#7) but still the code building makes errors that is: make nuttx_px4fmu-v4_tailsitter PX4 CONFIG: /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter ninja: Entering directory `/home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter' [2/605] Building NuttX for px4fmu-v4 with nsh FAILED: cd /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter && /bin/rm -rf /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx/nuttx-export && /usr/bin/make --no-print-directory --quiet -C /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx -r CONFIG_ARCH_BOARD=px4fmu-v4 export > nuttx_build.log stdio/lib_sscanf.c: In function 'vsscanf': stdio/lib_sscanf.c:419:28: error: this statement may fall through [-Werror=implicit-fallthrough=]                        sign = true;                             ^ stdio/lib_sscanf.c:420:21: note: here                      case 'u':                      ^~~~ cc1: all warnings being treated as errors make[2]: [bin/lib_sscanf.o] Error 1 make[1]: [libc/libc.a] Error 2 ninja: build stopped: subcommand failed. Makefile:140: recipe for target 'nuttx_px4fmu-v4_tailsitter' failed make: *** [nuttx_px4fmu-v4_tailsitter] Error 1

Hi, it seems this is a warning rather than an actual error. It is reported as an error because the compiler uses the flag 'Werror'. You can resolve this by turning it off in https://github.com/utiasSTARS/PX4-PhoenixDrone/blob/70af6cbc28ce4c2bcb72e085d2082147b92e9927/cmake/common/px4_base.cmake

Please note this repository uses an outdated PX4 base and you are probably using an updated GCC cross compiler. They probably have raised the standard for warning outputs since we developed the code.

mohammadrezaaerospace commented 3 years ago

I used Ubuntu 16.04 and PX4 1.8.0 according to what compiling the code needed and also I checked and did web address you said (#7) but still the code building makes errors that is: make nuttx_px4fmu-v4_tailsitter PX4 CONFIG: /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter ninja: Entering directory `/home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter' [2/605] Building NuttX for px4fmu-v4 with nsh FAILED: cd /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter && /bin/rm -rf /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx/nuttx-export && /usr/bin/make --no-print-directory --quiet -C /home/mohammadrezaaerospace/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx -r CONFIG_ARCH_BOARD=px4fmu-v4 export > nuttx_build.log stdio/lib_sscanf.c: In function 'vsscanf': stdio/lib_sscanf.c:419:28: error: this statement may fall through [-Werror=implicit-fallthrough=]                        sign = true;                             ^ stdio/lib_sscanf.c:420:21: note: here                      case 'u':                      ^~~~ cc1: all warnings being treated as errors make[2]: [bin/lib_sscanf.o] Error 1 make[1]: [libc/libc.a] Error 2 ninja: build stopped: subcommand failed. Makefile:140: recipe for target 'nuttx_px4fmu-v4_tailsitter' failed make: *** [nuttx_px4fmu-v4_tailsitter] Error 1

Hi, it seems this is a warning rather than an actual error. It is reported as an error because the compiler uses the flag 'Werror'. You can resolve this by turning it off in https://github.com/utiasSTARS/PX4-PhoenixDrone/blob/70af6cbc28ce4c2bcb72e085d2082147b92e9927/cmake/common/px4_base.cmake

Please note this repository uses an outdated PX4 base and you are probably using an updated GCC cross compiler. They probably have raised the standard for warning outputs since we developed the code.

hi, still I'm not able to compile code without error. How can I turn flag 'Werror' off?

mengchaoheng commented 3 years ago

Hello, I want to use your PhoenixDrone PX4 code to control my tailsitter. When I executemake nuttx_px4fmu-v4_tailsitter I encounter an error that

`-- nuttx-px4fmu-v4-tailsitter -- CMAKE_INSTALL_PREFIX: -- cmake module path: /home/zhenfu/src/PX4-PhoenixDrone/cmake -- Nuttx build for px4fmu-v4 on m4 hardware, using nsh with ROMFS on px4fmu_common CMake Deprecation Warning at /usr/share/cmake-3.10/Modules/CMakeForceCompiler.cmake:69 (message): The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set CMAKE_C_COMPILER and allow CMake to identify the compiler. Call Stack (most recent call first): cmake/toolchains/Toolchain-arm-none-eabi.cmake:31 (cmake_force_c_compiler) /usr/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:94 (include) CMakeLists.txt:235 (project)

CMake Deprecation Warning at /usr/share/cmake-3.10/Modules/CMakeForceCompiler.cmake:83 (message): The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set CMAKE_CXX_COMPILER and allow CMake to identify the compiler. Call Stack (most recent call first): cmake/toolchains/Toolchain-arm-none-eabi.cmake:37 (cmake_force_cxx_compiler) /usr/share/cmake-3.10/Modules/CMakeDetermineSystem.cmake:94 (include) CMakeLists.txt:235 (project)

CMake Deprecation Warning at /usr/share/cmake-3.10/Modules/CMakeForceCompiler.cmake:69 (message): The CMAKE_FORCE_C_COMPILER macro is deprecated. Instead just set CMAKE_C_COMPILER and allow CMake to identify the compiler. Call Stack (most recent call first): cmake/toolchains/Toolchain-arm-none-eabi.cmake:31 (cmake_force_c_compiler) build_nuttx_px4fmu-v4_tailsitter/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include) CMakeLists.txt:235 (project)

CMake Deprecation Warning at /usr/share/cmake-3.10/Modules/CMakeForceCompiler.cmake:83 (message): The CMAKE_FORCE_CXX_COMPILER macro is deprecated. Instead just set CMAKE_CXX_COMPILER and allow CMake to identify the compiler. Call Stack (most recent call first): cmake/toolchains/Toolchain-arm-none-eabi.cmake:37 (cmake_force_cxx_compiler) build_nuttx_px4fmu-v4_tailsitter/CMakeFiles/3.10.2/CMakeSystem.cmake:6 (include) CMakeLists.txt:235 (project)

-- The ASM compiler identification is GNU -- Found assembler: /opt/gcc-arm-none-eabi-7-2017-q4-major/bin/arm-none-eabi-gcc CMake Deprecation Warning at CMakeLists.txt:239 (cmake_policy): The OLD behavior for policy CMP0025 will be removed from a future version of CMake.

The cmake-policies(7) manual explains that the OLD behaviors of all policies are deprecated and that a policy should be set to OLD only under specific short-term circumstances. Projects should be ported to the NEW behavior and not rely on setting a policy to OLD.

-- Found PythonInterp: /usr/bin/python (found version "2.7.17") -- NuttX patch: nuttx-patches/Fixed-Shadow-wanings.patch -- NuttX patch: nuttx-patches/c++11.patch -- NuttX patch: nuttx-patches/ctypecctype.patch -- NuttX patch: nuttx-patches/export_insitu.patch -- NuttX patch: nuttx-patches/fixStdint.patch -- NuttX patch: nuttx-patches/fix_CRTSCTS-define.patch -- NuttX patch: nuttx-patches/math.h.patch -- NuttX patch: nuttx-patches/nsh_parse.patch -- NuttX patch: nuttx-patches/serial_dma_hotfix.patch -- NuttX patch: nuttx-patches/silence-jobserver-warnings.patch -- NuttX patch: nuttx-patches/static_asset-fix.patch -- NuttX patch: nuttx-patches/wip_inflight_to_upstream.patch -- Using C++03 -- Release build type: RelWithDebInfo -- Adding UAVCAN STM32 platform driver -- Adding ROMFS on px4fmu-v4 -- Configuring done -- Generating done -- Build files have been written to: /home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter PX4 CONFIG: /home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter ninja: Entering directory '/home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter' [29/632] Building NuttX for px4fmu-v4 with nsh FAILED: px4fmu-v4/NuttX/nuttx/nuttx-export/include/nuttx/config.h cd /home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter && /bin/rm -rf /home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx/nuttx-export && /usr/bin/make --no-print-directory --quiet -C /home/zhenfu/src/PX4-PhoenixDrone/build_nuttx_px4fmu-v4_tailsitter/px4fmu-v4/NuttX/nuttx -r CONFIG_ARCH_BOARD=px4fmu-v4 export > nuttx_build.log stdio/lib_sscanf.c: In function 'vsscanf': stdio/lib_sscanf.c:419:28: error: this statement may fall through [-Werror=implicit-fallthrough=] sign = true; ^ stdio/lib_sscanf.c:420:21: note: here case 'u': ^~~~ cc1: all warnings being treated as errors make[2]: [bin/lib_sscanf.o] Error 1 make[1]: [libc/libc.a] Error 2 ninja: build stopped: subcommand failed. Makefile:140: recipe for target 'nuttx_px4fmu-v4_tailsitter' failed make: *** [nuttx_px4fmu-v4_tailsitter] Error 1`

Could you please tell me what's wrong with it?

请问您解决编译问题了吗?

harshilairbound commented 1 year ago

Hello! Thanks to all for the above helpful comments. I am trying to use this repository on Ubuntu 20.04 for SITL Simulations. I am facing similar build issues with many Werrors. I would like to find the root of the issue itself instead of just turning off the Werrors. Any and all help is greatly appreciated!

Here is my terminal output when I use make posix_sitl_tailsitter gazebo_STARS_TS

airbound@airbound:~/PX4-PhoenixDrone$ make posix_sitl_tailsitter gazebo_STARS_TS
PX4 CONFIG: /home/airbound/PX4-PhoenixDrone/build_posix_sitl_tailsitter
ninja: Entering directory `/home/airbound/PX4-PhoenixDrone/build_posix_sitl_tailsitter'
[1/379] Building C object src/platforms...six__work_queue.dir/hrt_work_cancel.c.o
FAILED: src/platforms/posix/work_queue/CMakeFiles/platforms__posix__work_queue.dir/hrt_work_cancel.c.o 
/usr/bin/cc -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"platforms__posix__work_queue\" -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -std=gnu99 -fno-common -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -fvisibility=hidden -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/platforms/posix/work_queue/CMakeFiles/platforms__posix__work_queue.dir/hrt_work_cancel.c.o -MF src/platforms/posix/work_queue/CMakeFiles/platforms__posix__work_queue.dir/hrt_work_cancel.c.o.d -o src/platforms/posix/work_queue/CMakeFiles/platforms__posix__work_queue.dir/hrt_work_cancel.c.o   -c ../src/platforms/posix/work_queue/hrt_work_cancel.c
cc1: error: ‘-Werror=’ argument ‘-Werror=reorder’ is not valid for C [-Werror]
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
[2/379] Building C object src/platforms...__posix__work_queue.dir/work_thread.c.o
FAILED: src/platforms/posix/work_queue/CMakeFiles/platforms__posix__work_queue.dir/work_thread.c.o 
/usr/bin/cc -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"platforms__posix__work_queue\" -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -std=gnu99 -fno-common -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -fvisibility=hidden -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/platforms/posix/work_queue/CMakeFiles/platforms__posix__work_queue.dir/work_thread.c.o -MF src/platforms/posix/work_queue/CMakeFiles/platforms__posix__work_queue.dir/work_thread.c.o.d -o src/platforms/posix/work_queue/CMakeFiles/platforms__posix__work_queue.dir/work_thread.c.o   -c ../src/platforms/posix/work_queue/work_thread.c
cc1: error: ‘-Werror=’ argument ‘-Werror=reorder’ is not valid for C [-Werror]
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
[3/379] Building C object src/drivers/b.../drivers__boards__sitl.dir/sitl_led.c.o
FAILED: src/drivers/boards/sitl/CMakeFiles/drivers__boards__sitl.dir/sitl_led.c.o 
/usr/bin/cc -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"drivers__boards__sitl\" -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -std=gnu99 -fno-common -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -fvisibility=hidden -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/drivers/boards/sitl/CMakeFiles/drivers__boards__sitl.dir/sitl_led.c.o -MF src/drivers/boards/sitl/CMakeFiles/drivers__boards__sitl.dir/sitl_led.c.o.d -o src/drivers/boards/sitl/CMakeFiles/drivers__boards__sitl.dir/sitl_led.c.o   -c ../src/drivers/boards/sitl/sitl_led.c
cc1: error: ‘-Werror=’ argument ‘-Werror=reorder’ is not valid for C [-Werror]
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
[4/379] Building C object src/platforms...es/platforms__common.dir/px4_getopt.c.o
FAILED: src/platforms/common/CMakeFiles/platforms__common.dir/px4_getopt.c.o 
/usr/bin/cc -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"platforms__common\" -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -std=gnu99 -fno-common -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wbad-function-cast -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -fvisibility=hidden -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/platforms/common/CMakeFiles/platforms__common.dir/px4_getopt.c.o -MF src/platforms/common/CMakeFiles/platforms__common.dir/px4_getopt.c.o.d -o src/platforms/common/CMakeFiles/platforms__common.dir/px4_getopt.c.o   -c ../src/platforms/common/px4_getopt.c
cc1: error: ‘-Werror=’ argument ‘-Werror=reorder’ is not valid for C [-Werror]
compilation terminated due to -Wfatal-errors.
cc1: all warnings being treated as errors
[7/379] Building CXX object src/platfor...x__drivers__accelsim.dir/accelsim.cpp.o
FAILED: src/platforms/posix/drivers/accelsim/CMakeFiles/platforms__posix__drivers__accelsim.dir/accelsim.cpp.o 
/usr/bin/c++  -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"accelsim\" -DPX4_MAIN=accelsim_app_main -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -fno-exceptions -fno-rtti -std=gnu++0x -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wno-missing-field-initializers -fvisibility=hidden -include visibility.h -pthread -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/platforms/posix/drivers/accelsim/CMakeFiles/platforms__posix__drivers__accelsim.dir/accelsim.cpp.o -MF src/platforms/posix/drivers/accelsim/CMakeFiles/platforms__posix__drivers__accelsim.dir/accelsim.cpp.o.d -o src/platforms/posix/drivers/accelsim/CMakeFiles/platforms__posix__drivers__accelsim.dir/accelsim.cpp.o -c ../src/platforms/posix/drivers/accelsim/accelsim.cpp
In file included from ../src/platforms/posix/drivers/accelsim/accelsim.cpp:52:
../src/modules/simulator/simulator.h:63:10: fatal error: v1.0/mavlink_types.h: No such file or directory
   63 | #include <v1.0/mavlink_types.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[8/379] Building CXX object src/platfor...vers__airspeedsim.dir/airspeedsim.cpp.o
FAILED: src/platforms/posix/drivers/airspeedsim/CMakeFiles/platforms__posix__drivers__airspeedsim.dir/airspeedsim.cpp.o 
/usr/bin/c++  -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"measairspeedsim\" -DPX4_MAIN=measairspeedsim_app_main -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -fno-exceptions -fno-rtti -std=gnu++0x -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wno-missing-field-initializers -fvisibility=hidden -include visibility.h -pthread -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/platforms/posix/drivers/airspeedsim/CMakeFiles/platforms__posix__drivers__airspeedsim.dir/airspeedsim.cpp.o -MF src/platforms/posix/drivers/airspeedsim/CMakeFiles/platforms__posix__drivers__airspeedsim.dir/airspeedsim.cpp.o.d -o src/platforms/posix/drivers/airspeedsim/CMakeFiles/platforms__posix__drivers__airspeedsim.dir/airspeedsim.cpp.o -c ../src/platforms/posix/drivers/airspeedsim/airspeedsim.cpp
In file included from ../src/platforms/posix/drivers/airspeedsim/airspeedsim.cpp:70:
../src/modules/simulator/simulator.h:63:10: fatal error: v1.0/mavlink_types.h: No such file or directory
   63 | #include <v1.0/mavlink_types.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
[9/379] Building CXX object src/drivers...vers__pwm_out_sim.dir/pwm_out_sim.cpp.o
FAILED: src/drivers/pwm_out_sim/CMakeFiles/drivers__pwm_out_sim.dir/pwm_out_sim.cpp.o 
/usr/bin/c++  -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"pwm_out_sim\" -DPX4_MAIN=pwm_out_sim_app_main -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -fno-exceptions -fno-rtti -std=gnu++0x -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wno-missing-field-initializers -fvisibility=hidden -include visibility.h -pthread -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/drivers/pwm_out_sim/CMakeFiles/drivers__pwm_out_sim.dir/pwm_out_sim.cpp.o -MF src/drivers/pwm_out_sim/CMakeFiles/drivers__pwm_out_sim.dir/pwm_out_sim.cpp.o.d -o src/drivers/pwm_out_sim/CMakeFiles/drivers__pwm_out_sim.dir/pwm_out_sim.cpp.o -c ../src/drivers/pwm_out_sim/pwm_out_sim.cpp
../src/drivers/pwm_out_sim/pwm_out_sim.cpp: In member function ‘virtual int PWMSim::init()’:
../src/drivers/pwm_out_sim/pwm_out_sim.cpp:265:29: error: cast between incompatible function types from ‘void (*)(int, char**)’ to ‘px4_main_t’ {aka ‘int (*)(int, char**)’} [-Werror=cast-function-type]
  265 |        (px4_main_t)&PWMSim::task_main_trampoline,
      |                             ^~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[11/379] Building CXX object src/driver...drivers__vmount.dir/input_mavlink.cpp.o
FAILED: src/drivers/vmount/CMakeFiles/drivers__vmount.dir/input_mavlink.cpp.o 
/usr/bin/c++  -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"vmount\" -DPX4_MAIN=vmount_app_main -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -fno-exceptions -fno-rtti -std=gnu++0x -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wno-missing-field-initializers -fvisibility=hidden -include visibility.h -pthread -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/drivers/vmount/CMakeFiles/drivers__vmount.dir/input_mavlink.cpp.o -MF src/drivers/vmount/CMakeFiles/drivers__vmount.dir/input_mavlink.cpp.o.d -o src/drivers/vmount/CMakeFiles/drivers__vmount.dir/input_mavlink.cpp.o -c ../src/drivers/vmount/input_mavlink.cpp
../src/drivers/vmount/input_mavlink.cpp: In member function ‘virtual int vmount::InputMavlinkCmdMount::update_impl(unsigned int, vmount::ControlData**)’:
../src/drivers/vmount/input_mavlink.cpp:267:43: error: this statement may fall through [-Werror=implicit-fallthrough=]
  267 |      _control_data.gimbal_shutter_retract = true;
      |      ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[15/379] Building CXX object src/drivers/gps/CMakeFiles/drivers__gps.dir/gps.cpp.o
FAILED: src/drivers/gps/CMakeFiles/drivers__gps.dir/gps.cpp.o 
/usr/bin/c++  -DBUILD_URI=localhost -DCONFIG_ARCH_BOARD_SITL -DMODULE_NAME=\"gps\" -DPX4_MAIN=gps_app_main -D__DF_LINUX -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I. -Isrc -Isrc/modules -Isrc/modules/px4_messages -I../mavlink/include/mavlink -I../src -I../src/drivers/boards/sitl -I../src/include -I../src/lib -I../src/lib/DriverFramework/framework/include -I../src/modules -I../src/platforms -I../src/lib/matrix -I../src/modules/systemlib -I../src/lib/eigen -I../src/platforms/posix/include -Iexternal/Install/include -g -fno-exceptions -fno-rtti -std=gnu++0x -fno-threadsafe-statics -DCONFIG_WCHAR_BUILTIN -D__CUSTOM_FILE_IO__ -fcheck-new -Wall -Werror -Wextra -Wno-sign-compare -Wshadow -Wfloat-equal -Wpointer-arith -Wmissing-declarations -Wno-unused-parameter -Werror=format-security -Werror=array-bounds -Wfatal-errors -Werror=unused-variable -Werror=reorder -Werror=uninitialized -Werror=init-self -Werror=unused-but-set-variable -Wformat=1 -Wdouble-promotion -Werror=double-promotion -Wno-missing-field-initializers -fvisibility=hidden -include visibility.h -pthread -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf   -include visibility.h -O2 -fno-strict-aliasing -fomit-frame-pointer -funsafe-math-optimizations -ffunction-sections -fdata-sections -fno-strength-reduce -fno-builtin-printf -MD -MT src/drivers/gps/CMakeFiles/drivers__gps.dir/gps.cpp.o -MF src/drivers/gps/CMakeFiles/drivers__gps.dir/gps.cpp.o.d -o src/drivers/gps/CMakeFiles/drivers__gps.dir/gps.cpp.o -c ../src/drivers/gps/gps.cpp
../src/drivers/gps/gps.cpp: In member function ‘virtual int GPS::init()’:
../src/drivers/gps/gps.cpp:327:60: error: cast between incompatible function types from ‘void (*)(int, char**)’ to ‘px4_main_t’ {aka ‘int (*)(int, char**)’} [-Werror=cast-function-type]
  327 |        SCHED_PRIORITY_SLOW_DRIVER, 1400, (px4_main_t)&GPS::task_main_trampoline, args);
      |                                                            ^~~~~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.
cc1plus: all warnings being treated as errors
[18/379] Building CXX object src/driver...eFiles/drivers__vmount.dir/output.cpp.o
ninja: build stopped: subcommand failed.
make: *** [Makefile:140: posix_sitl_tailsitter] Error 1
mengchaoheng commented 1 year ago

@harshilairbound I advise you to give up, I think this code is not usable, at least the current version is far away from the original PX4 version, and it has not realized that the control surface can generate lift in the gazebo.

yilun-wu commented 1 year ago

I regret that these compile issues cannot be fixed promptly on our side. Right now there is minimum effort possible in maintaining the code. Given the development is already quite a few years back, I would suggest the prospective users adopt the latest PX4 firmware by porting the key changes related to tailsitter there. See the comment below for some suggestions. https://github.com/utiasSTARS/PX4-PhoenixDrone/issues/10#issuecomment-752335916