Unable to run gazebo-classic simulation

It displays below error message when I try to run gazebo-classic simulation by make px4_sitl gazebo-classic.

ninja: error: unknown target 'gazebo-classic'
make: *** [Makefile:232: px4_sitl] Error 1
  1. Download PX4 Source Code:
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
  1. Then, run the ubunth.sh:
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
  1. Run the gazebo-classic simulation:
make px4_sitl gazebo-classic

Thank you in advance!

@Masashi try running the following lines in your PX4-Autopilot directory:

make px4_sitl_default gazebo-classic

If that doesn’t solve it, try running:

make clean
make distclean

Now make the target. I have faced a similar issue in the past i.e., with gazebo as the deprecated target. Hope this helps!

2 Likes

Thank you for your reply!
I tried per your advice. However same error message is displayed…

It seems the latest PX4 code requires using “make px4_sitl gazebo-classic_iris”.
Try this.

Here’s another course you might want to consider: Delete the repository and restart the system. Clone and install it again from source. DO NOT forget to restart your system again.

Thanks for your help. I tried your proposal but the problem is not solved…

Hey Hi. I’m facing the similar issue. cant able to enable the actuators in HITL mode.

Thank you again for your help, Sidu!
I did try as follows:

  1. Delete the repository from my laptop
  2. Restart the laptop
  3. Clone the repo from the source:
git clone https://github.com/PX4/PX4-Autopilot.git --recursive
  1. Then, run the ubunth.sh:
bash ./PX4-Autopilot/Tools/setup/ubuntu.sh
  1. Restart the laptop again.
  2. Run the gazebo-classic:
make px4_sitl gazebo-classic

However, the problem is not solved. After that, I did clean and distclean build environment as you proposed, the error messages is still indicated.

make clean
make distclean

Run

make px4_sitl gazebo-classic_iris

Thank you for your help, Lim.
I tried

make px4_sitl gazebo-classic_iris

Result:

-- PX4 version: v1.14.0-beta2-39-g94fb334d8f (1.14.0)
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.8.10", minimum required is "3") 
-- PX4 config file: /home/uavrd4/PX4-Autopilot/boards/px4/sitl/default.px4board
-- PLATFORM posix
-- ROMFSROOT px4fmu_common
-- ROOTFSDIR .
-- TESTING y
-- ETHERNET y
-- PX4 config: px4_sitl_default
-- PX4 platform: posix
-- PX4 lockstep: enabled
-- The CXX compiler identification is GNU 9.4.0
-- The C compiler identification is GNU 9.4.0
-- The ASM compiler identification is GNU
-- Found assembler: /usr/bin/cc
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Detecting CXX compile features
-- Detecting CXX compile features - done
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Detecting C compile features
-- Detecting C compile features - done
-- cmake build type: RelWithDebInfo
-- Looking for gz-transport12 -- found version 12.1.0
-- Searching for dependencies of gz-transport12
-- Found Protobuf: /usr/lib/x86_64-linux-gnu/libprotobuf.so;-lpthread (found suitable version "3.6.1", minimum required is "3") 
-- Config-file not installed for ZeroMQ -- checking for pkg-config
-- Checking for module 'libzmq >= 4'
--   Found libzmq , version 4.3.2
-- Found ZeroMQ: TRUE (Required is at least version "4") 
-- Checking for module 'uuid'
--   Found uuid, version 2.34.0
-- Found UUID: TRUE  
-- Looking for gz-utils2 -- found version 2.0.0
-- Searching for dependencies of gz-utils2
-- Searching for <gz-utils2> component [cli]
-- Looking for gz-utils2-cli -- found version 2.0.0
-- Searching for dependencies of gz-utils2-cli
-- Looking for gz-msgs9 -- found version 9.4.0
-- Searching for dependencies of gz-msgs9
-- Looking for gz-math7 -- found version 7.1.0
-- Searching for dependencies of gz-math7
-- Looking for gz-utils2 -- found version 2.0.0
-- Checking for module 'tinyxml2'
--   Found tinyxml2, version 6.2.0
-- Found Java: /usr/bin/java (found version "13.0.7") 
-- ROMFS: ROMFS/px4fmu_common
Architecture:  amd64
==> CPACK_INSTALL_PREFIX = @DEB_INSTALL_PREFIX@
-- Configuring done
-- Generating done
-- Build files have been written to: /home/uavrd4/PX4-Autopilot/build/px4_sitl_default
ninja: error: unknown target 'gazebo-classic_iris'
make: *** [Makefile:232: px4_sitl] Error 1

I fear you are using Ubuntu 22 with Gazebo Garden instead of Classic

what is the LINUX platform you are on .

Hi, thank you for your reply! Check results of my ubuntu version is attached below:

ubuntu_version

Hi, it is Ubuntu 20.04 as attached above.

Hi @Masashi , did you solve your issue?

No, it’s not solved yet.

Could you share the output of

./PX4-Autopilot/Tools/setup/ubuntu.sh

?

Hi I have the same problem
this is my output of ./PX4-Autopilot/Tools/setup/ubuntu.sh

  • os: Ubuntu 20.04.6 LTS
  • PX4 software version: V1.13.3




Thank you

Hi ,
Kindly do a git checkout with px4 v1.13.3 inside the same folder as PX4-Autopilot .
Then do the ubuntu.sh and then make px4-sitl gazebo_classic_typhoon_H460 ( need to check the exact name for avoiding typo errors )

1 Like

If you are using v1.13.3, then you need to use the documentation for v1.13:

For that version, the command to start the simulation is

make px4_sitl gazebo
2 Likes