ThunderFly-aerospace / PX4-Autopilot

PX4 Professional Autopilot Firmware
http://px4.io
BSD 3-Clause "New" or "Revised" License
4 stars 4 forks source link

No rule to make target `flightgear_tf-g2 #43

Open kaklik opened 1 year ago

kaklik commented 1 year ago

Running the make px4_sitl_nolockstep flightgear_tf-g2 or similar px4_sitl_nolockstep targets like flightgear_tf-g1 or flightgear_tf-rascal results in the following error in case the fgfs binary is not found by cmake:

PX4-Autopilot> make px4_sitl_nolockstep flightgear_tf-g2
make[1]: * No rule to make target `flightgear_tf-g2'.  Stop.
make: * [px4_sitl_nolockstep] Error 2

Issue is coused by uncath failure of find_program(FGFS_PATH "fgfs") in the file /src/modules/simulation/simulator_mavlink/sitl_targets_flightgear.cmake

Expected behavior

I suggest that cmake use the system variable from PX4-FlightGear-Bridge FG_BINARY (if it exists) and when it doesn't, use the current search function find_program(FGFS_PATH "fgfs"). If that doesn't work either, cmake should end with a clear error, not pretend that it's OK, and at the same time not prepare the target.

Temporary workaround

use the alias to FlightGear starting script (limited use)

alias fgfs=/home/[user]/flightgear/dnc-managed/run_fgfs.sh