P.s. tried to put in your PX4-Autopilot-AAM repo but you have not enabled Issues!
So trying to build inside a dockerfile and things are just not building!
Context (docker file):
FROM px4io/px4-dev-simulation-focal AS px4builder
# Fetch the PX4 code
COPY PX4-Autopilot-AAM /src/PX4-Autopilot
WORKDIR /src/PX4-Autopilot
RUN make px4_sitl
Problem 1
Running the dockerfile you get the following output
...
-- Found JSONCPP: TRUE
-- Checking for module 'yaml-0.1'
-- Found yaml-0.1, version 0.2.2
-- Found YAML: TRUE
-- Checking for module 'libzip'
-- Found libzip, version 1.5.1
-- Found ZIP: TRUE
-- Looking for ignition-common3 -- found version 3.17.0
-- Looking for ignition-math6 -- found version 6.15.1
-- Looking for ignition-msgs5 -- found version 5.11.0
-- Found gazebo-classic 11.14.0, including sitl_gazebo-classic simulator and gazebo-classic targets
CMake Warning at src/modules/simulation/simulator_mavlink/sitl_targets_gazebo-classic.cmake:155 (message):
model directory
/src/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models/quadtailsitter
not found
Call Stack (most recent call first):
src/modules/simulation/simulator_mavlink/CMakeLists.txt:59 (include)
-- Found Java: /usr/bin/java (found version "1.8.0_402")
-- ROMFS: ROMFS/px4fmu_common
Architecture: amd64
==> CPACK_INSTALL_PREFIX = @DEB_INSTALL_PREFIX@
-- Configuring done
-- Generating done
-- Build files have been written to: /src/PX4-Autopilot/build/px4_sitl_default
[0/977] git submodule src/modules/uxrce_dds_client/Micro-XRCE-DDS-Client
[2/977] git submodule src/drivers/gps/devices
[7/977] git submodule src/modules/mavlink/mavlink
[11/977] Generating combined event json file
FAILED: events/common_with_enums.json
cd /src/PX4-Autopilot/src/lib/events && /usr/bin/cmake -E make_directory /src/PX4-Autopilot/build/px4_sitl_default/events && /usr/bin/python3 libevents/scripts/combine.py enums.json libevents/events/common.json --output /src/PX4-Autopilot/build/px4_sitl_default/events/common_with_enums.json
Traceback (most recent call last):
File "libevents/scripts/combine.py", line 99, in <module>
main()
File "libevents/scripts/combine.py", line 35, in main
assert new_events["version"] == 1
AssertionError
[14/977] Generating Mavlink uAvionix: src/modules/mavlink/mavlink/message_definitions/v1.0/uAvionix.xml
WARNING: Failed to import lxml module etree. Are lxml, libxml2 and libxslt installed? XML validation will not be performed
[19/977] Generating uORB topic ucdr headers
ninja: build stopped: subcommand failed.
make: *** [Makefile:232: px4_sitl] Error 1
In this we can see two issues
The SITL seems to be missing the quadtailsitter model (though its just a warning)
Something is going on with events/common_with_enums.json
For the second issue, this stems from a submodule called libevents (https://github.com/mavlink/libevents) which does stuff with events. For configuration the combine script combines enums.json and common.json. However the combine script only works with version 1 of the json type.
Unfortunately enums.json is of version 2 and that trips the assertion.
Solution If libevents is updated manually to latest version, it no longer trips this error.
Weirdness The .gitmodules already asks for the main branch of libevents. I don't know why it is not being grabbed.
Problem 2
Once that is now running (after the weird test for libevents), there seem to be a heck of a lot of merge conflicts
CMake Warning at src/modules/simulation/simulator_mavlink/sitl_targets_gazebo-classic.cmake:155 (message):
model directory
/src/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models/quadtailsitter
not found
Call Stack (most recent call first):
src/modules/simulation/simulator_mavlink/CMakeLists.txt:59 (include)
-- Found Java: /usr/bin/java (found version "1.8.0_402")
Checked src/lib/events/libevents submodule, ACTION REQUIRED:
Different commits:
* src/lib/events/libevents 8d9c555...7c17207 (24):
> remove nlohmann json submodule and add header directly instead
> Fix cmake_minimum_required
> cmake: add namespaced target & installation include dir
> CMakeLists: set CMAKE_CXX_STANDARD if not set
> parser.h: use std::vector<EventArgumentDefinition>::size_type
> fix parser: avoid signed to unsigned conversion
> cpp: only enable Wall and others for GCC
> cpp/parse: mark navigationModeGroups as const
> README: add docs how to use the c++ library
> cpp: add ENABLE_TESTING option
> cpp: restructure cmake & headers to make it easier to use
> cpp/parse: avoid using ssize_t as it's not available on Windows
> cpp: enable Werror, Wall, Wextra, Wconversion, Wpedantic & fix
> refactor python/parser: some whitespace & formatting updates
> python/parse: add callback to escape message & description
> cpp/parse: add callback to escape message & description
> refactor tests/parser: move tests to method
> run_ci.sh: ensure cmake uses unix makefiles
> refactor parser tests: use gtest
> README: update link to initial design doc
> pylint: fix 'Raising too general exception' errors
> Unused content variable fix
> json: add translation support
> Changed nlohman_json library orignal and bumped up version
*******************************************************************************
* IF YOU DID NOT CHANGE THIS FILE (OR YOU DON'T KNOW WHAT A SUBMODULE IS): *
* Hit 'u' and <ENTER> to update ALL submodules and resolve this. *
* (performs git submodule sync --recursive *
* and git submodule update --init --recursive ) *
*******************************************************************************
Only for EXPERTS:
src/lib/events/libevents submodule is not in the recommended version.
Hit 'y' and <ENTER> to continue the build with this version. Hit <ENTER> to resolve manually.
Use git add src/lib/events/libevents && git commit -m 'Updated src/lib/events/libevents' to choose this version (careful!)
Build aborted.
-- ROMFS: ROMFS/px4fmu_common
Architecture: amd64
==> CPACK_INSTALL_PREFIX = @DEB_INSTALL_PREFIX@
-- Configuring done
-- Generating done
-- Build files have been written to: /src/PX4-Autopilot/build/px4_sitl_default
[0/977] git submodule src/modules/uxrce_dds_client/Micro-XRCE-DDS-Client
[3/977] git submodule src/drivers/gps/devices
[7/977] git submodule src/modules/mavlink/mavlink
[16/977] Generating Mavlink uAvionix: src/modules/mavlink/mavlink/message_definitions/v1.0/uAvionix.xml
WARNING: Failed to import lxml module etree. Are lxml, libxml2 and libxslt installed? XML validation will not be performed
[17/977] Generating Mavlink development: src/modules/mavlink/mavlink/message_definitions/v1.0/development.xml
WARNING: Failed to import lxml module etree. Are lxml, libxml2 and libxslt installed? XML validation will not be performed
[54/977] Performing configure step for 'libmicroxrceddsclient_project'
-- libmicroxrceddsclient_project configure command succeeded. See also /src/PX4-Autopilot/build/px4_sitl_default/src/modules/uxrce_dds_client/src/libmicroxrceddsclient_project-stamp/libmicroxrceddsclient_project-configure-*.log
[83/977] Building CXX object src/lib/drivers/gyroscope/CMakeFiles/drivers_gyroscope.dir/PX4Gyroscope.cpp.o
FAILED: src/lib/drivers/gyroscope/CMakeFiles/drivers_gyroscope.dir/PX4Gyroscope.cpp.o
/usr/lib/ccache/c++ -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -DMODULE_NAME=\"drivers_gyroscope\" -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I../../boards/px4/sitl/src -I../../platforms/posix/src/px4/common/include -I. -Isrc/lib -I../../platforms/posix/src/px4/generic/generic/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/posix/include -Iexternal/Install/include -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -O2 -std=gnu++14 -MD -MT src/lib/drivers/gyroscope/CMakeFiles/drivers_gyroscope.dir/PX4Gyroscope.cpp.o -MF src/lib/drivers/gyroscope/CMakeFiles/drivers_gyroscope.dir/PX4Gyroscope.cpp.o.d -o src/lib/drivers/gyroscope/CMakeFiles/drivers_gyroscope.dir/PX4Gyroscope.cpp.o -c ../../src/lib/drivers/gyroscope/PX4Gyroscope.cpp
In file included from ../../src/lib/drivers/device/Device.hpp:52,
from ../../src/lib/drivers/gyroscope/PX4Gyroscope.cpp:37:
../../src/drivers/drv_sensor.h:83:1: error: version control conflict marker in file
83 | <<<<<<< HEAD
| ^~~~~~~
compilation terminated due to -Wfatal-errors.
[84/977] Building CXX object src/lib/drivers/accelerometer/CMakeFiles/drivers_accelerometer.dir/PX4Accelerometer.cpp.o
FAILED: src/lib/drivers/accelerometer/CMakeFiles/drivers_accelerometer.dir/PX4Accelerometer.cpp.o
/usr/lib/ccache/c++ -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -DMODULE_NAME=\"drivers_accelerometer\" -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I../../boards/px4/sitl/src -I../../platforms/posix/src/px4/common/include -I. -Isrc/lib -I../../platforms/posix/src/px4/generic/generic/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/posix/include -Iexternal/Install/include -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -O2 -std=gnu++14 -MD -MT src/lib/drivers/accelerometer/CMakeFiles/drivers_accelerometer.dir/PX4Accelerometer.cpp.o -MF src/lib/drivers/accelerometer/CMakeFiles/drivers_accelerometer.dir/PX4Accelerometer.cpp.o.d -o src/lib/drivers/accelerometer/CMakeFiles/drivers_accelerometer.dir/PX4Accelerometer.cpp.o -c ../../src/lib/drivers/accelerometer/PX4Accelerometer.cpp
In file included from ../../src/lib/drivers/device/Device.hpp:52,
from ../../src/lib/drivers/accelerometer/PX4Accelerometer.cpp:37:
../../src/drivers/drv_sensor.h:83:1: error: version control conflict marker in file
83 | <<<<<<< HEAD
| ^~~~~~~
compilation terminated due to -Wfatal-errors.
[87/977] Building CXX object src/lib/drivers/magnetometer/CMakeFiles/drivers_magnetometer.dir/PX4Magnetometer.cpp.o
FAILED: src/lib/drivers/magnetometer/CMakeFiles/drivers_magnetometer.dir/PX4Magnetometer.cpp.o
/usr/lib/ccache/c++ -DCONFIG_ARCH_BOARD_PX4_SITL -DENABLE_LOCKSTEP_SCHEDULER -DMODULE_NAME=\"drivers_magnetometer\" -D__CUSTOM_FILE_IO__ -D__PX4_LINUX -D__PX4_POSIX -D__STDC_FORMAT_MACROS -Dnoreturn_function="__attribute__((noreturn))" -I../../boards/px4/sitl/src -I../../platforms/posix/src/px4/common/include -I. -Isrc/lib -I../../platforms/posix/src/px4/generic/generic/include -I../../platforms/common -I../../platforms/common/include -I../../src -I../../src/include -I../../src/lib -I../../src/lib/matrix -I../../src/modules -I../../platforms/posix/include -Iexternal/Install/include -O2 -g -DNDEBUG -fPIC -g -fdata-sections -ffunction-sections -fomit-frame-pointer -fmerge-all-constants -fno-signed-zeros -fno-trapping-math -freciprocal-math -fno-math-errno -fno-strict-aliasing -fvisibility=hidden -include visibility.h -Wall -Wextra -Werror -Warray-bounds -Wcast-align -Wdisabled-optimization -Wdouble-promotion -Wfatal-errors -Wfloat-equal -Wformat-security -Winit-self -Wlogical-op -Wpointer-arith -Wshadow -Wuninitialized -Wunknown-pragmas -Wunused-variable -Wno-missing-field-initializers -Wno-missing-include-dirs -Wno-unused-parameter -fdiagnostics-color=always -Wno-stringop-truncation -fno-builtin-printf -fno-strength-reduce -Wformat=1 -Wunused-but-set-variable -Wno-format-truncation -fcheck-new -Wreorder -Wno-overloaded-virtual -std=gnu++14 -MD -MT src/lib/drivers/magnetometer/CMakeFiles/drivers_magnetometer.dir/PX4Magnetometer.cpp.o -MF src/lib/drivers/magnetometer/CMakeFiles/drivers_magnetometer.dir/PX4Magnetometer.cpp.o.d -o src/lib/drivers/magnetometer/CMakeFiles/drivers_magnetometer.dir/PX4Magnetometer.cpp.o -c ../../src/lib/drivers/magnetometer/PX4Magnetometer.cpp
In file included from ../../src/lib/drivers/device/Device.hpp:52,
from ../../src/lib/drivers/magnetometer/PX4Magnetometer.cpp:37:
../../src/drivers/drv_sensor.h:83:1: error: version control conflict marker in file
83 | <<<<<<< HEAD
| ^~~~~~~
compilation terminated due to -Wfatal-errors.
[99/977] Performing build step for 'libmicroxrceddsclient_project'
-- libmicroxrceddsclient_project build command succeeded. See also /src/PX4-Autopilot/build/px4_sitl_default/src/modules/uxrce_dds_client/src/libmicroxrceddsclient_project-stamp/libmicroxrceddsclient_project-build-*.log
[100/977] Generating uORB topic ucdr headers
ninja: build stopped: subcommand failed.
make: *** [Makefile:232: px4_sitl] Error 1
... Searching there seem to be a looot of them...
so.... no offense but... how did your students manage to get this to build 😂😂😂
---EDIT2--
Luckily its only drv_sensor.h which messed up so I got rid of the version control markers and it moved on Failing to build a couple of modules
16.15 FAILED: src/modules/ekf2/CMakeFiles/modules__ekf2.dir/EKF/control.cpp.o
... <lots of errors>
Which is hopefully again because of version control markers left in the file!
---EDIT2---
Now we're getting to bits that might involve knowledge fothe code base:
Hi!
So trying to build inside a dockerfile and things are just not building!
Context (docker file):
Problem 1
Running the dockerfile you get the following output
In this we can see two issues
For the second issue, this stems from a submodule called libevents (https://github.com/mavlink/libevents) which does stuff with events. For configuration the combine script combines enums.json and common.json. However the combine script only works with version 1 of the json type.
Unfortunately enums.json is of version 2 and that trips the assertion.
Solution If libevents is updated manually to latest version, it no longer trips this error.
Weirdness The .gitmodules already asks for the main branch of libevents. I don't know why it is not being grabbed.
Problem 2
Once that is now running (after the weird test for libevents), there seem to be a heck of a lot of merge conflicts
... Searching there seem to be a looot of them...
so.... no offense but... how did your students manage to get this to build 😂😂😂
---EDIT2--
Luckily its only drv_sensor.h which messed up so I got rid of the version control markers and it moved on Failing to build a couple of modules
Which is hopefully again because of version control markers left in the file!
---EDIT2---
Now we're getting to bits that might involve knowledge fothe code base: