Cmake error in px4

hey guys , I’m beginner in this community . i recently installed gazebo fortress in my ubuntu 22.04 ,using ros2 humble and now i faced a big issue :

– Checking for module ‘gstreamer-app-1.0’
– Found gstreamer-app-1.0, version 1.20.1
– Found Java: /usr/bin/java (found version “11.0.28”)
– ROMFS: ROMFS/px4fmu_common
Architecture: amd64
==> CPACK_INSTALL_PREFIX = @DEB_INSTALL_PREFIX@
– Configuring done
CMake Error at cmake/px4_add_library.cmake:42 (add_library):
Cannot find source file:

heatshrink/heatshrink_decoder.c

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
Call Stack (most recent call first):
src/lib/heatshrink/CMakeLists.txt:36 (px4_add_library)

CMake Error at cmake/px4_add_module.cmake:151 (add_library):
Cannot find source file:

devices/src/crc.cpp

Tried extensions .c .C .c++ .cc .cpp .cxx .cu .mpp .m .M .mm .ixx .cppm .h
.hh .h++ .hm .hpp .hxx .in .txx .f .F .for .f77 .f90 .f95 .f03 .hip .ispc
Call Stack (most recent call first):
src/drivers/gps/CMakeLists.txt:36 (px4_add_module)

CMake Error at cmake/px4_add_library.cmake:42 (add_library):
No SOURCES given to target: heatshrink
Call Stack (most recent call first):
src/lib/heatshrink/CMakeLists.txt:36 (px4_add_library)

CMake Error at cmake/px4_add_module.cmake:151 (add_library):
No SOURCES given to target: drivers__gps
Call Stack (most recent call first):
src/drivers/gps/CMakeLists.txt:36 (px4_add_module)

CMake Generate step failed. Build files cannot be regenerated correctly.
Error: /home/mamad/PX4-Autopilot/build/px4_sitl_default is not a directory
make: *** [Makefile:227: px4_sitl] Error 1

i tried this command : mamad@mamadPC:~/Desktop$ ros2 launch px4_offboard offboard_velocity_control.launch.py
by a tutorial on YT , and it showed me the rviz simulation but not the gazebo sim (unlike the tutorial!) i have faced this error in downloading px4 but i ignored it . what to do now?

1 Like

Missing git submodules maybe?

I’m not sure .. i just followed the
GitHub - artastier/PX4_Swarm_Controller: The aim of this ROS2 package is to facilitate the implementation of a drone swarm controller through simulation on Gazebo. GitHub - artastier/PX4_Swarm_Controller: The aim of this ROS2 package is to facilitate the implementation of a drone swarm controller through simulation on Gazebo. instructions
And chatgpt and other Ai tools didn’t help me thou🥲

Well, try git submodule update --init --recursive within the PX4-Autopilot folder.

1 Like

thanks a lot . i could finally run this with vpn . otherwise i faced error 403 .. i tried other way

[quote=“JulianOes, post:4, topic:46712”]

On branch main
Your branch is behind ‘origin/main’ by 22 commits, and can be fast-forwarded.
(use “git pull” to update your local branch)

Changes not staged for commit:
(use “git add …” to update what will be committed)
(use “git restore …” to discard changes in working directory)
(commit or discard the untracked or modified content in submodules)
modified: Tools/simulation/flightgear/flightgear_bridge (modified content)
modified: Tools/simulation/gazebo-classic/sitl_gazebo-classic (modified content)
modified: Tools/simulation/jmavsim/jMAVSim (modified content)
modified: platforms/nuttx/NuttX/apps (modified content)
modified: platforms/nuttx/NuttX/nuttx (modified content)
modified: src/drivers/actuators/vertiq_io/iq-module-communication-cpp (modified content)
modified: src/drivers/gps/devices (modified content)
modified: src/drivers/uavcan/libdronecan/dsdl (modified content)
modified: src/lib/crypto/monocypher (modified content)
modified: src/lib/events/libevents (modified content)
modified: src/lib/heatshrink/heatshrink (modified content)
modified: src/modules/mavlink/mavlink (modified content)
modified: src/modules/uxrce_dds_client/Micro-XRCE-DDS-Client (modified content)

no changes added to commit (use “git add” and/or “git commit -a”)

Blockquote
i think my problem is somehow related to this part and again i couldn’t fix it It’s been days since i work on this error i should give up..whatever ,thanks a lot for your time spending at this :))

I think your error was caused by git. Maybe you can download PX4 code again, and delete the former code.
try the command

git clone https://github.com/PX4/PX4-Autopilot.git
git submodule update --init --recursive
cd ./PX4-Autopilot/Tools/setup
./ubuntu.sh --no-nuttx