Unable to Run Gazebo SITL macOS

I’m having trouble running Gazebo SITL on macOS. It seems to get hung up here with no obvious errors. This is a fresh clone of v1.9.2 master and using Gazebo 7. Any guidance is appreciated!

Last login: Mon Aug 19 16:24:54 on ttys000
        Louiss-MacBook-Pro-2:~ louismueller$ cd Firmware/
        Louiss-MacBook-Pro-2:Firmware louismueller$ HEADLESS=1 make px4_sitl gazebo_plane
        [2/6] Performing configure step for 'sitl_gazebo'
        -- install-prefix: /usr/local
        -- Using C++17 compiler
        -- Found Boost: /usr/local/include (found suitable version "1.70.0", minimum required is "1.58") found components:  system thread filesystem chrono date_time atomic 
        -- Found Boost: /usr/local/include (found version "1.70.0")  
        -- Building klt_feature_tracker without catkin
        -- Building OpticalFlow with OpenCV
        -- catkin DISABLED
        Gazebo version: 7.15
        -- Configuring done
        -- Generating done
        -- Build files have been written to: /Users/louismueller/Firmware/build/px4_sitl_default/build_gazebo
        [3/6] Performing build step for 'sitl_gazebo'
        [1/63] Building CXX object CMakeFiles/nav_msgs.dir/Odometry.pb.cc.o
        [2/63] Building CXX object CMakeFiles/std_msgs.dir/Int32.pb.cc.o
        [3/63] Building CXX object CMakeFiles/gazebo_sonar_plugin.dir/src/gazebo_sonar_plugin.cpp.o
        [4/63] Building CXX object CMakeFiles/LiftDragPlugin.dir/src/liftdrag_plugin/liftdrag_plugin.cpp.o
        [5/63] Building CXX object CMakeFiles/gazebo_barometer_plugin.dir/src/gazebo_barometer_plugin.cpp.o
        [6/63] Building CXX object CMakeFiles/gazebo_vision_plugin.dir/src/gazebo_vision_plugin.cpp.o
        [7/63] Building CXX object CMakeFiles/gazebo_multirotor_base_plugin.dir/src/gazebo_multirotor_base_plugin.cpp.o
        [8/63] Building CXX object CMakeFiles/gazebo_gps_plugin.dir/src/gazebo_gps_plugin.cpp.o
        [9/63] Building CXX object CMakeFiles/gazebo_motor_model.dir/src/gazebo_motor_model.cpp.o
        [10/63] Building CXX object CMakeFiles/gazebo_irlock_plugin.dir/src/gazebo_irlock_plugin.cpp.o
        [11/63] Building CXX object CMakeFiles/sensor_msgs.dir/Float.pb.cc.o
        [12/63] Building CXX object CMakeFiles/mav_msgs.dir/CommandMotorSpeed.pb.cc.o
        [13/63] Building CXX object CMakeFiles/mav_msgs.dir/MotorSpeed.pb.cc.o
        [14/63] Linking CXX shared library libmav_msgs.dylib
        [15/63] Building CXX object CMakeFiles/gazebo_lidar_plugin.dir/src/gazebo_lidar_plugin.cpp.o
        [16/63] Building CXX object CMakeFiles/sensor_msgs.dir/SITLGps.pb.cc.o
        [17/63] Building CXX object CMakeFiles/sensor_msgs.dir/Groundtruth.pb.cc.o
        [18/63] Building CXX object CMakeFiles/sensor_msgs.dir/Range.pb.cc.o
        [19/63] Building CXX object CMakeFiles/gazebo_mavlink_interface.dir/src/gazebo_mavlink_interface.cpp.o
        /Users/louismueller/Firmware/Tools/sitl_gazebo/src/gazebo_mavlink_interface.cpp:335:36: warning: result of comparison of constant 4294967295 with expression of type 'in_port_t' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare]
              if (local_qgc_addr_.sin_port == INADDR_NONE) {
                  ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
        /Users/louismueller/Firmware/Tools/sitl_gazebo/src/gazebo_mavlink_interface.cpp:350:36: warning: result of comparison of constant 4294967295 with expression of type 'in_port_t' (aka 'unsigned short') is always false [-Wtautological-constant-out-of-range-compare]
              if (local_sdk_addr_.sin_port == INADDR_NONE) {
                  ~~~~~~~~~~~~~~~~~~~~~~~~ ^  ~~~~~~~~~~~
        2 warnings generated.
        [20/63] Building CXX object CMakeFiles/sensor_msgs.dir/OpticalFlow.pb.cc.o
        [21/63] Linking CXX shared library libstd_msgs.dylib
        [22/63] Building CXX object CMakeFiles/sensor_msgs.dir/Pressure.pb.cc.o
        [23/63] Building CXX object CMakeFiles/sensor_msgs.dir/MagneticField.pb.cc.o
        [24/63] Building CXX object CMakeFiles/sensor_msgs.dir/IRLock.pb.cc.o
        [25/63] Building CXX object CMakeFiles/sensor_msgs.dir/Imu.pb.cc.o
        [26/63] Linking CXX shared library libnav_msgs.dylib
        [27/63] Linking CXX shared library libsensor_msgs.dylib
        [28/63] Building CXX object CMakeFiles/physics_msgs.dir/Wind.pb.cc.o
        [29/63] Linking CXX shared library libphysics_msgs.dylib
        [30/63] Linking CXX shared library libLiftDragPlugin.dylib
        [31/63] Linking CXX shared library libgazebo_multirotor_base_plugin.dylib
        [32/63] Linking CXX shared library libgazebo_motor_model.dylib
        [33/63] Linking CXX shared library libgazebo_vision_plugin.dylib
        [34/63] Linking CXX shared library libgazebo_barometer_plugin.dylib
        [35/63] Linking CXX shared library libgazebo_mavlink_interface.dylib
        [36/63] Linking CXX shared library libgazebo_irlock_plugin.dylib
        [37/63] Linking CXX shared library libgazebo_lidar_plugin.dylib
        [38/63] Linking CXX shared library libgazebo_sonar_plugin.dylib
        [39/63] Linking CXX shared library libgazebo_gps_plugin.dylib
        [40/63] Building CXX object OpticalFlow/CMakeFiles/OpticalFlow.dir/src/optical_flow.cpp.o
        [41/63] Building CXX object OpticalFlow/CMakeFiles/OpticalFlow.dir/src/px4flow.cpp.o
        [42/63] Building CXX object OpticalFlow/CMakeFiles/OpticalFlow.dir/src/flow_px4.cpp.o
        [43/63] Building CXX object CMakeFiles/gazebo_gimbal_controller_plugin.dir/src/gazebo_gimbal_controller_plugin.cpp.o
        [44/63] Linking CXX shared library libgazebo_gimbal_controller_plugin.dylib
        [45/63] Building CXX object CMakeFiles/gazebo_uuv_plugin.dir/src/gazebo_uuv_plugin.cpp.o
        [46/63] Building CXX object CMakeFiles/gazebo_imu_plugin.dir/src/gazebo_imu_plugin.cpp.o
        [47/63] Linking CXX shared library libgazebo_uuv_plugin.dylib
        [48/63] Linking CXX shared library libgazebo_imu_plugin.dylib
        [49/63] Building CXX object OpticalFlow/klt_feature_tracker/CMakeFiles/klt_feature_tracker.dir/src/trackFeatures.cpp.o
        [50/63] Linking CXX static library OpticalFlow/klt_feature_tracker/libklt_feature_tracker.a
        [51/63] Building CXX object OpticalFlow/CMakeFiles/OpticalFlow.dir/src/flow_opencv.cpp.o
        [52/63] Linking CXX shared library OpticalFlow/libOpticalFlow.dylib
        [53/63] Building CXX object CMakeFiles/gazebo_controller_interface.dir/src/gazebo_controller_interface.cpp.o
        [54/63] Linking CXX shared library libgazebo_controller_interface.dylib
        [55/63] Building CXX object CMakeFiles/gazebo_magnetometer_plugin.dir/src/geo_mag_declination.cpp.o
        [56/63] Building CXX object CMakeFiles/gazebo_magnetometer_plugin.dir/src/gazebo_magnetometer_plugin.cpp.o
        [57/63] Linking CXX shared library libgazebo_magnetometer_plugin.dylib
        [58/63] Building CXX object CMakeFiles/gazebo_wind_plugin.dir/src/gazebo_wind_plugin.cpp.o
        [59/63] Linking CXX shared library libgazebo_wind_plugin.dylib
        [60/63] Building CXX object CMakeFiles/gazebo_geotagged_images_plugin.dir/src/gazebo_geotagged_images_plugin.cpp.o
        [61/63] Linking CXX shared library libgazebo_geotagged_images_plugin.dylib
        [62/63] Building CXX object CMakeFiles/gazebo_opticalflow_plugin.dir/src/gazebo_opticalflow_plugin.cpp.o
        [63/63] Linking CXX shared library libgazebo_opticalflow_plugin.dylib
        [5/6] cd /Users/louismueller/Firmware/...ueller/Firmware/build/px4_sitl_default
        SITL ARGS
        sitl_bin: /Users/louismueller/Firmware/build/px4_sitl_default/bin/px4
        debugger: none
        program: gazebo
        model: plane
        src_path: /Users/louismueller/Firmware
        build_path: /Users/louismueller/Firmware/build/px4_sitl_default
        GAZEBO_PLUGIN_PATH :/Users/louismueller/Firmware/build/px4_sitl_default/build_gazebo
        GAZEBO_MODEL_PATH :/Users/louismueller/Firmware/Tools/sitl_gazebo/models
        LD_LIBRARY_PATH :/Users/louismueller/Firmware/build/px4_sitl_default/build_gazebo
        not running gazebo gui
        SITL COMMAND: "/Users/louismueller/Firmware/build/px4_sitl_default/bin/px4" "/Users/louismueller/Firmware"/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t "/Users/louismueller/Firmware"/test_data
        INFO  [px4] Creating symlink /Users/louismueller/Firmware/ROMFS/px4fmu_common -> /Users/louismueller/Firmware/build/px4_sitl_default/tmp/rootfs/etc

        ______  __   __    ___ 
        | ___ \ \ \ / /   /   |
        | |_/ /  \ V /   / /| |
        |  __/   /   \  / /_| |
        | |     / /^\ \ \___  |
        \_|     \/   \/     |_/

        px4 starting.

        INFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
          SYS_AUTOSTART: curr: 0 -> new: 1030
          BAT_N_CELLS: curr: 0 -> new: 3
          CAL_ACC0_ID: curr: 0 -> new: 1311244
          CAL_ACC_PRIME: curr: 0 -> new: 1311244
        Gazebo multi-robot simulator, version 7.15.0
        Copyright (C) 2012 Open Source Robotics Foundation.
        Released under the Apache 2 License.
        http://gazebosim.org

        [Msg] Waiting for master.
          CAL_GYRO0_ID: curr: 0 -> new: 2294028
          CAL_GYRO_PRIME: curr: 0 -> new: 2294028
          CAL_MAG0_ID: curr: 0 -> new: 197388
        [Msg] Connected to gazebo master @ http://127.0.0.1:11345
        [Msg] Publicized address: 172.25.0.187
          CAL_MAG_PRIME: curr: 0 -> new: 197388
          CAL_BARO_PRIME: curr: 0 -> new: 6620172
          COM_DISARM_LAND: curr: 2.0000 -> new: 0.1000
          COM_OBL_ACT: curr: 0 -> new: 2
          COM_OF_LOSS_T: curr: 0.0000 -> new: 5.0000
          COM_RC_IN_MODE: curr: 0 -> new: 1
          EKF2_ANGERR_INIT: curr: 0.1000 -> new: 0.0100
          EKF2_GBIAS_INIT: curr: 0.1000 -> new: 0.0100
          EKF2_REQ_GPS_H: curr: 10.0000 -> new: 0.5000
          MC_PITCH_P: curr: 6.5000 -> new: 6.0000
          MC_PITCHRATE_P: curr: 0.1500 -> new: 0.2000
          MC_ROLL_P: curr: 6.5000 -> new: 6.0000
          MC_ROLLRATE_P: curr: 0.1500 -> new: 0.2000
          MPC_HOLD_MAX_Z: curr: 0.6000 -> new: 2.0000
          MPC_Z_VEL_I: curr: 0.1000 -> new: 0.1500
          MPC_Z_VEL_P: curr: 0.2000 -> new: 0.6000
          MPC_XY_P: curr: 0.9500 -> new: 0.8000
          MPC_XY_VEL_P: curr: 0.0900 -> new: 0.2000
          MPC_XY_VEL_D: curr: 0.0100 -> new: 0.0160
          MPC_JERK_MIN: curr: 8.0000 -> new: 10.0000
          MPC_ACC_HOR_MAX: curr: 5.0000 -> new: 3.0000
          NAV_ACC_RAD: curr: 10.0000 -> new: 2.0000
          NAV_DLL_ACT: curr: 0 -> new: 2
          RTL_DESCEND_ALT: curr: 30.0000 -> new: 5.0000
          RTL_LAND_DELAY: curr: -1.0000 -> new: 5.0000
          RTL_RETURN_ALT: curr: 60.0000 -> new: 30.0000
          SDLOG_MODE: curr: 0 -> new: 1
          SDLOG_PROFILE: curr: 3 -> new: 131
          SDLOG_DIRS_MAX: curr: 0 -> new: 7
          SENS_BOARD_X_OFF: curr: 0.0000 -> new: 0.0000
          SENS_DPRES_OFF: curr: 0.0000 -> new: 0.0010
          TRIG_INTERFACE: curr: 4 -> new: 3
          COM_POS_FS_DELAY: curr: 1 -> new: 5
          COM_POS_FS_EPH: curr: 5.0000 -> new: 15.0000
          COM_POS_FS_EPV: curr: 10.0000 -> new: 30.0000
          COM_POS_FS_GAIN: curr: 10 -> new: 0
          COM_POS_FS_PROB: curr: 30 -> new: 1
          COM_VEL_FS_EVH: curr: 1.0000 -> new: 5.0000
          EKF2_ARSP_THR: curr: 0.0000 -> new: 8.0000
          EKF2_FUSE_BETA: curr: 0 -> new: 1
          EKF2_GPS_CHECK: curr: 245 -> new: 21
          EKF2_MAG_ACCLIM: curr: 0.5000 -> new: 0.0000
          EKF2_MAG_YAWLIM: curr: 0.2500 -> new: 0.0000
          EKF2_REQ_EPH: curr: 3.0000 -> new: 10.0000
          EKF2_REQ_EPV: curr: 5.0000 -> new: 10.0000
          EKF2_REQ_HDRIFT: curr: 0.1000 -> new: 0.5000
          EKF2_REQ_SACC: curr: 0.5000 -> new: 1.0000
          EKF2_REQ_VDRIFT: curr: 0.2000 -> new: 1.0000
        * RTL_RETURN_ALT: curr: 30.0000 -> new: 100.0000
        * RTL_DESCEND_ALT: curr: 5.0000 -> new: 100.0000
        * RTL_LAND_DELAY: curr: 5.0000 -> new: -1.0000
        * NAV_ACC_RAD: curr: 2.0000 -> new: 10.0000
          MIS_LTRMIN_ALT: curr: -1.0000 -> new: 25.0000
          MIS_TAKEOFF_ALT: curr: 2.5000 -> new: 25.0000
          PWM_RATE: curr: 400 -> new: 50
          GPS_UBX_DYNMODEL: curr: 7 -> new: 8
          FW_LND_AIRSPD_SC: curr: 1.3000 -> new: 1.0000
          FW_LND_ANG: curr: 5.0000 -> new: 8.0000
          FW_THR_LND_MAX: curr: 1.0000 -> new: 0.0000
          FW_P_TC: curr: 0.4000 -> new: 0.5000
          FW_PR_FF: curr: 0.5000 -> new: 0.4000
          FW_PR_I: curr: 0.1000 -> new: 0.0500
          FW_PR_P: curr: 0.0800 -> new: 0.0500
          FW_R_TC: curr: 0.4000 -> new: 0.7000
          FW_RR_FF: curr: 0.5000 -> new: 0.2000
          FW_RR_I: curr: 0.1000 -> new: 0.0200
          FW_RR_P: curr: 0.0500 -> new: 0.2200
          FW_W_EN: curr: 0 -> new: 1
        * MIS_LTRMIN_ALT: curr: 25.0000 -> new: 30.0000
        * MIS_TAKEOFF_ALT: curr: 25.0000 -> new: 30.0000
        * NAV_ACC_RAD: curr: 10.0000 -> new: 15.0000
          RWTO_TKOFF: curr: 0 -> new: 1
        INFO  [dataman] Unknown restart, data manager file './dataman' size is 11798680 bytes
        INFO  [simulator] Waiting for simulator to connect on TCP port 4560
        ERROR [px4_work_queue] setting stack size for wq:hp_default failed (22)
        INFO  [px4_work_queue] creating: wq:hp_default, priority: 35, stack: 11192 bytes
        ERROR [px4_work_queue] setting stack size for wq:att_pos_ctrl failed (22)
        INFO  [px4_work_queue] creating: wq:att_pos_ctrl, priority: 36, stack: 22192 bytes
        ERROR [px4_work_queue] setting stack size for wq:rate_ctrl failed (22)
        INFO  [px4_work_queue] creating: wq:rate_ctrl, priority: 47, stack: 11392 bytes
          MAV_TYPE: curr: 2 -> new: 1
        INFO  [init] Mixer: etc/mixers-sitl/plane_sitl.main.mix on /dev/pwm_output0
        ERROR [px4_work_queue] setting stack size for wq:lp_default failed (22)
        INFO  [px4_work_queue] creating: wq:lp_default, priority: -3, stack: 11592 bytes
        INFO  [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 14570 remote port 14550
        INFO  [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540
        INFO  [logger] logger started (mode=all)
        INFO  [logger] Start file log (type: full)
        INFO  [logger] Opened full log file: ./log/2019-08-19/21_52_33.ulg
        INFO  [mavlink] MAVLink only on localhost (set param MAV_BROADCAST = 1 to enable network)
        INFO  [px4] Startup script returned successfully
        pxh>

It looks like it started correctly. How do you know it hangs? The thing is that you set HEADLESS=1 so the Gazebo GUI won’t actually start.

Thanks for the quick reply. Using HEADLESS=1, the simulation does not return any EKF updates or respond to commands such as

pxh> commander takeoff
ERROR [commander] rejecting takeoff, no position lock yet. Please retry..
Command 'commander' failed, returned 1.

When using just make px4_sitl gazebo_plane, receive this error after INFO [px4] Startup script returned successfully and gazebo does not launch:

[Err] [ConnectionManager.cc:119] Failed to connect to master in 30 seconds.
[Err] [gazebo_shared.cc:83] Unable to initialize transport.
[Err] [gazebo_client.cc:62] Unable to setup Gazebo

Aha. Does make px4_sitl gazebo work?

Here’s the result, seems to be the same.

Louiss-MacBook-Pro-2:Firmware louismueller$ make px4_sitl gazebo
[3/7] Performing configure step for 'sitl_gazebo'
-- install-prefix: /usr/local
-- Using C++17 compiler
-- Found Boost: /usr/local/include (found suitable version "1.70.0", minimum required is "1.58") found components:  system thread filesystem chrono date_time atomic 
-- Found Boost: /usr/local/include (found version "1.70.0")  
-- Building klt_feature_tracker without catkin
-- Building OpticalFlow with OpenCV
-- catkin DISABLED
Gazebo version: 7.15
-- Configuring done
-- Generating done
-- Build files have been written to: /Users/louismueller/Firmware/build/px4_sitl_default/build_gazebo
[4/7] Performing build step for 'sitl_gazebo'
ninja: no work to do.
[6/7] cd /Users/louismueller/Firmware/...ueller/Firmware/build/px4_sitl_default
SITL ARGS
sitl_bin: /Users/louismueller/Firmware/build/px4_sitl_default/bin/px4
debugger: none
program: gazebo
model: none
src_path: /Users/louismueller/Firmware
build_path: /Users/louismueller/Firmware/build/px4_sitl_default
empty model, setting iris as default
GAZEBO_PLUGIN_PATH :/Users/louismueller/Firmware/build/px4_sitl_default/build_gazebo
GAZEBO_MODEL_PATH :/Users/louismueller/Firmware/Tools/sitl_gazebo/models
LD_LIBRARY_PATH :/Users/louismueller/Firmware/build/px4_sitl_default/build_gazebo
Gazebo multi-robot simulator, version 7.15.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
[Msg] Connected to gazebo master @ http://127.0.0.1:11345
[Msg] Publicized address: 172.25.0.187
/Users/louismueller/Firmware/Tools/sitl_run.sh: line 93: 76608 Segmentation fault: 11  gzserver --verbose "${src_path}/Tools/sitl_gazebo/worlds/${model}.world"
SITL COMMAND: "/Users/louismueller/Firmware/build/px4_sitl_default/bin/px4" "/Users/louismueller/Firmware"/ROMFS/px4fmu_common -s etc/init.d-posix/rcS -t "/Users/louismueller/Firmware"/test_data
INFO  [px4] Creating symlink /Users/louismueller/Firmware/ROMFS/px4fmu_common -> /Users/louismueller/Firmware/build/px4_sitl_default/tmp/rootfs/etc

______  __   __    ___ 
| ___ \ \ \ / /   /   |
| |_/ /  \ V /   / /| |
|  __/   /   \  / /_| |
| |     / /^\ \ \___  |
\_|     \/   \/     |_/

px4 starting.

INFO  [px4] Calling startup script: /bin/sh etc/init.d-posix/rcS 0
  SYS_AUTOSTART: curr: 0 -> new: 10016
  BAT_N_CELLS: curr: 0 -> new: 3
  CAL_ACC0_ID: curr: 0 -> new: 1311244
Gazebo multi-robot simulator, version 7.15.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org

[Msg] Waiting for master.
  CAL_ACC_PRIME: curr: 0 -> new: 1311244
  CAL_GYRO0_ID: curr: 0 -> new: 2294028
  CAL_GYRO_PRIME: curr: 0 -> new: 2294028
  CAL_MAG0_ID: curr: 0 -> new: 197388
  CAL_MAG_PRIME: curr: 0 -> new: 197388
  CAL_BARO_PRIME: curr: 0 -> new: 6620172
  COM_DISARM_LAND: curr: 2.0000 -> new: 0.1000
  COM_OBL_ACT: curr: 0 -> new: 2
  COM_OF_LOSS_T: curr: 0.0000 -> new: 5.0000
  COM_RC_IN_MODE: curr: 0 -> new: 1
  EKF2_ANGERR_INIT: curr: 0.1000 -> new: 0.0100
  EKF2_GBIAS_INIT: curr: 0.1000 -> new: 0.0100
  EKF2_REQ_GPS_H: curr: 10.0000 -> new: 0.5000
  MC_PITCH_P: curr: 6.5000 -> new: 6.0000
  MC_PITCHRATE_P: curr: 0.1500 -> new: 0.2000
  MC_ROLL_P: curr: 6.5000 -> new: 6.0000
  MC_ROLLRATE_P: curr: 0.1500 -> new: 0.2000
  MPC_HOLD_MAX_Z: curr: 0.6000 -> new: 2.0000
  MPC_Z_VEL_I: curr: 0.1000 -> new: 0.1500
  MPC_Z_VEL_P: curr: 0.2000 -> new: 0.6000
  MPC_XY_P: curr: 0.9500 -> new: 0.8000
  MPC_XY_VEL_P: curr: 0.0900 -> new: 0.2000
  MPC_XY_VEL_D: curr: 0.0100 -> new: 0.0160
  MPC_JERK_MIN: curr: 8.0000 -> new: 10.0000
  MPC_ACC_HOR_MAX: curr: 5.0000 -> new: 3.0000
  NAV_ACC_RAD: curr: 10.0000 -> new: 2.0000
  NAV_DLL_ACT: curr: 0 -> new: 2
  RTL_DESCEND_ALT: curr: 30.0000 -> new: 5.0000
  RTL_LAND_DELAY: curr: -1.0000 -> new: 5.0000
  RTL_RETURN_ALT: curr: 60.0000 -> new: 30.0000
  SDLOG_MODE: curr: 0 -> new: 1
  SDLOG_PROFILE: curr: 3 -> new: 131
  SDLOG_DIRS_MAX: curr: 0 -> new: 7
  SENS_BOARD_X_OFF: curr: 0.0000 -> new: 0.0000
  SENS_DPRES_OFF: curr: 0.0000 -> new: 0.0010
  TRIG_INTERFACE: curr: 4 -> new: 3
* RTL_DESCEND_ALT: curr: 5.0000 -> new: 10.0000
* RTL_LAND_DELAY: curr: 5.0000 -> new: 0.0000
  PWM_MAX: curr: 2000 -> new: 1950
  PWM_MIN: curr: 1000 -> new: 1075
INFO  [dataman] Unknown restart, data manager file './dataman' size is 11798680 bytes
INFO  [simulator] Waiting for simulator to connect on TCP port 4560
ERROR [px4_work_queue] setting stack size for wq:hp_default failed (22)
INFO  [px4_work_queue] creating: wq:hp_default, priority: 35, stack: 11192 bytes
ERROR [px4_work_queue] setting stack size for wq:att_pos_ctrl failed (22)
INFO  [px4_work_queue] creating: wq:att_pos_ctrl, priority: 36, stack: 22192 bytes
ERROR [px4_work_queue] setting stack size for wq:rate_ctrl failed (22)
INFO  [px4_work_queue] creating: wq:rate_ctrl, priority: 47, stack: 11392 bytes
INFO  [init] Mixer: etc/mixers/quad_w.main.mix on /dev/pwm_output0
INFO  [mavlink] mode: Normal, data rate: 4000000 B/s on udp port 14570 remote port 14550
INFO  [mavlink] mode: Onboard, data rate: 4000000 B/s on udp port 14580 remote port 14540
INFO  [logger] logger started (mode=all)
INFO  [logger] Start file log (type: full)
INFO  [logger] Opened full log file: ./log/2019-08-21/14_59_24.ulg
INFO  [mavlink] MAVLink only on localhost (set param MAV_BROADCAST = 1 to enable network)
INFO  [px4] Startup script returned successfully
pxh> [Err] [ConnectionManager.cc:119] Failed to connect to master in 30 seconds.
[Err] [gazebo_shared.cc:83] Unable to initialize transport.
[Err] [gazebo_client.cc:62] Unable to setup Gazebo

Can you start Gazebo on its own? Try starting it with the “verbose” argument.

I think OSRF stopped supporting macOS for Gazebo 7 and possibly 8. I’ve had the best luck with Gazebo 9 but it runs terribly if I’m not running it headless.

I have had better luck just using a dedicated linux machine for running SITL, unfortunately.

Both Gazebo 7 and 9 run fine on their own. I originally tried with Gazebo 9 but was unable to completely build.

Louiss-MacBook-Pro-2:Firmware louismueller$ HEADLESS=1 make px4_sitl gazebo

[0/11] git submodule Tools/sitl_gazebo

[7/11] Performing configure step for 'sitl_gazebo'

FAILED: external/Stamp/sitl_gazebo/sitl_gazebo-configure 

cd /Users/louismueller/src/Firmware/build/px4_sitl_default/build_gazebo && /usr/local/Cellar/cmake/3.15.2/bin/cmake -DCMAKE_INSTALL_PREFIX=/usr/local -DSEND_VISION_ESTIMATION_DATA=ON -GNinja /Users/louismueller/src/Firmware/Tools/sitl_gazebo && /usr/local/Cellar/cmake/3.15.2/bin/cmake -E touch /Users/louismueller/src/Firmware/build/px4_sitl_default/external/Stamp/sitl_gazebo/sitl_gazebo-configure

-- install-prefix: /usr/local

-- The C compiler identification is AppleClang 10.0.1.10010046

-- The CXX compiler identification is AppleClang 10.0.1.10010046

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++

-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Performing Test COMPILER_SUPPORTS_CXX17

-- Performing Test COMPILER_SUPPORTS_CXX17 - Success

-- Performing Test COMPILER_SUPPORTS_CXX14

-- Performing Test COMPILER_SUPPORTS_CXX14 - Success

-- Performing Test COMPILER_SUPPORTS_CXX11

-- Performing Test COMPILER_SUPPORTS_CXX11 - Success

-- Performing Test COMPILER_SUPPORTS_CXX0X

-- Performing Test COMPILER_SUPPORTS_CXX0X - Success

-- Using C++17 compiler

-- Looking for pthread.h

-- Looking for pthread.h - found

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success

-- Found Threads: TRUE  

-- Found Boost: /usr/local/include (found suitable version "1.70.0", minimum required is "1.58") found components: system thread filesystem chrono date_time atomic 

-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") 

-- Checking for module 'bullet>=2.82'

-- Found bullet, version 2.88

-- Found fcl: /usr/local/Cellar/fcl/0.5.0_1/include (found suitable version "0.5.0", minimum required is "0.3.2") 

-- Found assimp: /usr/local/Cellar/assimp/4.1.0/include (found version "4.1.0") 

-- Found DART: /usr/local/include (Required is at least version "6") found components: dart 

-- Found Boost: /usr/local/include (found suitable version "1.70.0", minimum required is "1.40.0") found components: thread system filesystem program_options regex iostreams date_time chrono atomic 

-- Found Protobuf: /usr/local/lib/libprotobuf.dylib (found version "3.7.1") 

-- Found Boost: /usr/local/include (found version "1.70.0")  

-- Looking for OGRE...

-- OGRE_PREFIX_WATCH changed.

-- Checking for module 'OGRE'

-- Found OGRE, version 1.9.0

-- Found Ogre Ghadamon (1.9.0)

-- Found OGRE: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreMain.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreMain.dylib

-- Looking for OGRE_Paging...

-- Found OGRE_Paging: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgrePaging.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgrePaging.dylib

-- Looking for OGRE_Terrain...

-- Found OGRE_Terrain: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreTerrain.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreTerrain.dylib

-- Looking for OGRE_Property...

-- Found OGRE_Property: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreProperty.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreProperty.dylib

-- Looking for OGRE_RTShaderSystem...

-- Found OGRE_RTShaderSystem: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreRTShaderSystem.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreRTShaderSystem.dylib

-- Looking for OGRE_Volume...

-- Found OGRE_Volume: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreVolume.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreVolume.dylib

-- Looking for OGRE_Overlay...

-- Found OGRE_Overlay: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreOverlay.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreOverlay.dylib

-- Found Protobuf: /usr/local/lib/libprotobuf.dylib (found suitable version "3.7.1", minimum required is "2.3.0") 

CMake Error at /anaconda3/share/cmake/ZeroMQ/ZeroMQConfig.cmake:44 (include):

include could not find load file:

/anaconda3/share/cmake/ZeroMQ/ZeroMQTargets.cmake

Call Stack (most recent call first):

/usr/local/lib/cmake/ignition-cmake0/cmake0/FindZeroMQ.cmake:62 (find_package)

/usr/local/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)

/usr/local/lib/cmake/ignition-transport4/ignition-transport4-config.cmake:97 (find_dependency)

/usr/local/lib/cmake/gazebo/gazebo-config.cmake:197 (find_package)

CMakeLists.txt:34 (find_package)

CMake Error at /anaconda3/share/cmake/ZeroMQ/ZeroMQConfig.cmake:46 (get_target_property):

get_target_property() called with non-existent target "libzmq".

Call Stack (most recent call first):

/usr/local/lib/cmake/ignition-cmake0/cmake0/FindZeroMQ.cmake:62 (find_package)

/usr/local/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)

/usr/local/lib/cmake/ignition-transport4/ignition-transport4-config.cmake:97 (find_dependency)

/usr/local/lib/cmake/gazebo/gazebo-config.cmake:197 (find_package)

CMakeLists.txt:34 (find_package)

CMake Error at /anaconda3/share/cmake/ZeroMQ/ZeroMQConfig.cmake:47 (get_target_property):

get_target_property() called with non-existent target "libzmq".

Call Stack (most recent call first):

/usr/local/lib/cmake/ignition-cmake0/cmake0/FindZeroMQ.cmake:62 (find_package)

/usr/local/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)

/usr/local/lib/cmake/ignition-transport4/ignition-transport4-config.cmake:97 (find_dependency)

/usr/local/lib/cmake/gazebo/gazebo-config.cmake:197 (find_package)

CMakeLists.txt:34 (find_package)

CMake Error at /anaconda3/share/cmake/ZeroMQ/ZeroMQConfig.cmake:48 (get_target_property):

get_target_property() called with non-existent target "libzmq-static".

Call Stack (most recent call first):

/usr/local/lib/cmake/ignition-cmake0/cmake0/FindZeroMQ.cmake:62 (find_package)

/usr/local/share/cmake/Modules/CMakeFindDependencyMacro.cmake:47 (find_package)

/usr/local/lib/cmake/ignition-transport4/ignition-transport4-config.cmake:97 (find_dependency)

/usr/local/lib/cmake/gazebo/gazebo-config.cmake:197 (find_package)

CMakeLists.txt:34 (find_package)

-- Checking for module 'uuid'

-- Found uuid, version 1.6.2

-- Found UUID: TRUE  

-- Checking for module 'tinyxml2'

-- Found tinyxml2, version 7.1.0

-- Looking for dlfcn.h - found

-- Looking for libdl - found

-- Found DL: TRUE  

-- FreeImage.pc not found, we will search for FreeImage_INCLUDE_DIRS and FreeImage_LIBRARIES

-- Found UUID: TRUE  

-- Checking for module 'gts'

-- Found gts, version 0.7.6

-- Found GTS: TRUE  

-- Checking for module 'libswscale'

-- Found libswscale, version 5.3.100

-- Found SWSCALE: TRUE  

-- Checking for module 'libavdevice >= 56.4.100'

-- Found libavdevice , version 58.5.100

-- Found AVDEVICE: TRUE (Required is at least version "56.4.100") 

-- Checking for module 'libavformat'

-- Found libavformat, version 58.20.100

-- Found AVFORMAT: TRUE  

-- Checking for module 'libavcodec'

-- Found libavcodec, version 58.35.100

-- Found AVCODEC: TRUE  

-- Checking for module 'libavutil'

-- Found libavutil, version 56.22.100

-- Found AVUTIL: TRUE  

-- Found CURL: /usr/lib/libcurl.dylib (found version "7.54.0")  

-- Checking for module 'jsoncpp'

-- Found jsoncpp, version 1.9.0

-- 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.2

-- Found ZIP: TRUE  

-- Found PythonInterp: /anaconda3/bin/python (found version "3.6.4") 

-- Found OpenCV: /usr/local (found version "4.1.0") 

-- Found TinyXML: /usr/local/lib/libtinyxml.dylib  

-- Checking for module 'OGRE'

-- Found OGRE, version 1.9.0

-- Building klt_feature_tracker without catkin

-- Building OpticalFlow with OpenCV

-- Found MAVLink: /Users/louismueller/src/Firmware/mavlink/include (found version "2.0") 

-- catkin DISABLED

-- Found Protobuf: /usr/local/lib/libprotobuf.dylib (found version "3.7.1") 

-- Checking for module 'protobuf'

-- Found protobuf, version 3.7.1

Gazebo version: 9.10

-- Configuring incomplete, errors occurred!

See also "/Users/louismueller/src/Firmware/build/px4_sitl_default/build_gazebo/CMakeFiles/CMakeOutput.log".

ninja: build stopped: subcommand failed.

make: *** [px4_sitl] Error 1

I moved to Gazebo 7 because it seemed to get a little further.

I would recommend Gazebo 9 as well. Do you have the libzmq dependency?

I do have zmq installed, here is what is listed as Gazebo dependencies:

Louiss-MacBook-Pro-2:~ louismueller$ brew deps gazebo

aom

boost

bullet

cairo

cmake

cppzmq

doxygen

ffmpeg

flac

fontconfig

freeimage

freetype

frei0r

fribidi

gd

gdbm

gettext

giflib

glib

gmp

gnutls

graphite2

graphviz

gts

harfbuzz

icu4c

ignition-math3

ignition-msgs0

ignition-tools

ignition-transport3

jasper

jpeg

lame

leptonica

libass

libbluray

libevent

libffi

libidn2

libogg

libpng

libsamplerate

libsndfile

libsoxr

libtar

libtasn1

libtiff

libtool

libunistring

libvorbis

libvpx

libzzip

little-cms2

lzo

netpbm

nettle

ogre1.9

opencore-amr

openjpeg

openssl

opus

ossp-uuid

p11-kit

pcre

pixman

pkg-config

protobuf

protobuf-c

python

qt

qwt

readline

rtmpdump

rubberband

sdformat5

sdl2

simbody

snappy

speex

sqlite

tbb

tesseract

theora

tinyxml

tinyxml2

unbound

webp

x264

x265

xvid

xz

zeromq

I was able to get this going with Gazebo 8 from the px4 tap like this:

brew upgrade
brew uninstall sdformat5 gazebo boost ogre1.9
brew cleanup
brew install px4/px4/px4-sim

Also see:

After performing those commands and installing Gazebo 8, I get a similar segmentation fault. Quick note: when I installed px4-sim I had to then either uninstall or unlink Gazebo 9 to use Gazebo 8 as Gazebo 9 was automatically installed.

Louiss-MacBook-Pro-2:Firmware louismueller$ HEADLESS=1 make px4_sitl gazebo

[3/7] Performing configure step for 'sitl_gazebo'

-- install-prefix: /usr/local

-- Using C++17 compiler

-- Found Boost: /usr/local/include (found suitable version "1.70.0", minimum required is "1.58") found components: system thread filesystem chrono date_time atomic 

-- Found Boost: /usr/local/include (found suitable version "1.70.0", minimum required is "1.40.0") found components: thread system filesystem program_options regex iostreams date_time chrono atomic 

-- Found Boost: /usr/local/include (found version "1.70.0")  

-- Looking for OGRE...

-- Found Ogre Ghadamon (1.9.0)

-- Looking for OGRE_Paging...

-- Found OGRE_Paging: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgrePaging.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgrePaging.dylib

-- Looking for OGRE_Terrain...

-- Found OGRE_Terrain: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreTerrain.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreTerrain.dylib

-- Looking for OGRE_Property...

-- Found OGRE_Property: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreProperty.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreProperty.dylib

-- Looking for OGRE_RTShaderSystem...

-- Found OGRE_RTShaderSystem: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreRTShaderSystem.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreRTShaderSystem.dylib

-- Looking for OGRE_Volume...

-- Found OGRE_Volume: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreVolume.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreVolume.dylib

-- Looking for OGRE_Overlay...

-- Found OGRE_Overlay: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreOverlay.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreOverlay.dylib

-- Checking for module 'libzmq>=3.2.0'

-- Found libzmq, version 4.3.2

-- Looking for zmq pkgconfig file - found

-- Checking for module 'uuid'

-- Found uuid, version 1.6.2

-- Looking for ignition-msgs - found

-- Building klt_feature_tracker without catkin

-- Building OpticalFlow with OpenCV

-- catkin DISABLED

Gazebo version: 8.6

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/louismueller/src/Firmware/build/px4_sitl_default/build_gazebo

[4/7] Performing build step for 'sitl_gazebo'

FAILED: external/Stamp/sitl_gazebo/sitl_gazebo-build 

cd /Users/louismueller/src/Firmware/build/px4_sitl_default/build_gazebo && /usr/local/Cellar/cmake/3.15.2/bin/cmake --build . && /usr/local/Cellar/cmake/3.15.2/bin/cmake -E touch /Users/louismueller/src/Firmware/build/px4_sitl_default/external/Stamp/sitl_gazebo/sitl_gazebo-build

[1/86] Running cpp protocol buffer compiler on msgs/CommandMotorSpeed.proto

[2/86] Running cpp protocol buffer compiler on msgs/MotorSpeed.proto

[3/86] Running cpp protocol buffer compiler on msgs/Groundtruth.proto

[4/86] Running cpp protocol buffer compiler on msgs/IRLock.proto

[5/86] Running cpp protocol buffer compiler on msgs/Float.proto

[6/86] Running cpp protocol buffer compiler on msgs/Imu.proto

[7/86] Running cpp protocol buffer compiler on msgs/Range.proto

[8/86] Running cpp protocol buffer compiler on msgs/SITLGps.proto

[9/86] Running cpp protocol buffer compiler on msgs/OpticalFlow.proto

[10/86] Running cpp protocol buffer compiler on msgs/MagneticField.proto

[11/86] Running cpp protocol buffer compiler on msgs/Int32.proto

[12/86] Running cpp protocol buffer compiler on msgs/Pressure.proto

[13/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag-gen.sdf

/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag.sdf.jinja -> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag-gen.sdf

[14/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/c920/c920-gen.sdf

/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/c920/c920.sdf.jinja -> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/c920/c920-gen.sdf

[15/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk-gen.sdf

/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk.sdf.jinja -> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk-gen.sdf

[16/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100-gen.sdf

/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100.sdf.jinja -> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100-gen.sdf

[17/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4-gen.sdf

/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4.sdf.jinja -> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4-gen.sdf

[18/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf

FAILED: /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf 

cd /Users/louismueller/src/Firmware/Tools/sitl_gazebo && rm -f /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf && /anaconda3/bin/python /Users/louismueller/src/Firmware/Tools/sitl_gazebo/scripts/xacro.py -o /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.urdf /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.xacro enable_mavlink_interface:=true enable_ground_truth:=false enable_wind:=false enable_logging:=false rotors_description_dir:=/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description send_vision_estimation:=true send_odometry:=false && gz sdf -p /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.urdf >> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf && rm -f /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.urdf

/bin/sh: line 1: 82503 Segmentation fault: 11 gz sdf -p /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.urdf >> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf

[19/86] Building CXX object CMakeFiles/mav_msgs.dir/CommandMotorSpeed.pb.cc.o

[20/86] Building CXX object CMakeFiles/mav_msgs.dir/MotorSpeed.pb.cc.o

[21/86] Building CXX object CMakeFiles/std_msgs.dir/Int32.pb.cc.o

[22/86] Building CXX object CMakeFiles/sensor_msgs.dir/OpticalFlow.pb.cc.o

[23/86] Building CXX object CMakeFiles/sensor_msgs.dir/Float.pb.cc.o

[24/86] Building CXX object CMakeFiles/sensor_msgs.dir/IRLock.pb.cc.o

[25/86] Building CXX object CMakeFiles/sensor_msgs.dir/Groundtruth.pb.cc.o

[26/86] Building CXX object CMakeFiles/sensor_msgs.dir/SITLGps.pb.cc.o

[27/86] Building CXX object CMakeFiles/sensor_msgs.dir/Range.pb.cc.o

ninja: build stopped: subcommand failed.

ninja: build stopped: subcommand failed.

make: *** [px4_sitl] Error 1

Louiss-MacBook-Pro-2:Firmware louismueller$ make clean

Louiss-MacBook-Pro-2:Firmware louismueller$ make distclean

Cleared directory 'Tools/jMAVSim'

Submodule 'Tools/jMAVSim' (https://github.com/PX4/jMAVSim.git) unregistered for path 'Tools/jMAVSim'

Cleared directory 'Tools/sitl_gazebo'

Submodule 'Tools/sitl_gazebo' (https://github.com/PX4/sitl_gazebo.git) unregistered for path 'Tools/sitl_gazebo'

Cleared directory 'boards/atlflight/cmake_hexagon'

Cleared directory 'cmake/configs/uavcan_board_ident'

Cleared directory 'mavlink/include/mavlink/v2.0'

Submodule 'mavlink/include/mavlink/v2.0' (https://github.com/mavlink/c_library_v2.git) unregistered for path 'mavlink/include/mavlink/v2.0'

Cleared directory 'msg/tools/gencpp'

Submodule 'msg/tools/gencpp' (https://github.com/PX4/gencpp.git) unregistered for path 'msg/tools/gencpp'

Cleared directory 'msg/tools/genmsg'

Submodule 'msg/tools/genmsg' (https://github.com/PX4/genmsg.git) unregistered for path 'msg/tools/genmsg'

Cleared directory 'platforms/nuttx/NuttX/apps'

Cleared directory 'platforms/nuttx/NuttX/nuttx'

Cleared directory 'src/drivers/gps/devices'

Submodule 'src/drivers/gps/devices' (https://github.com/PX4/GpsDrivers.git) unregistered for path 'src/drivers/gps/devices'

Cleared directory 'src/drivers/uavcan/libuavcan'

Cleared directory 'src/lib/DriverFramework'

Submodule 'src/lib/DriverFramework' (https://github.com/PX4/DriverFramework.git) unregistered for path 'src/lib/DriverFramework'

Cleared directory 'src/lib/ecl'

Submodule 'src/lib/ecl' (https://github.com/PX4/ecl.git) unregistered for path 'src/lib/ecl'

Cleared directory 'src/lib/matrix'

Submodule 'src/lib/matrix' (https://github.com/PX4/Matrix.git) unregistered for path 'src/lib/matrix'

Cleared directory 'src/modules/micrortps_bridge/micro-CDR'

Removing CMakeLists.txt.user

Removing msg/tools/__pycache__/

Removing src/lib/parameters/px4params/__pycache__/

Louiss-MacBook-Pro-2:Firmware louismueller$ HEADLESS=1 make px4_sitl gazebo

-- PX4 config file: /Users/louismueller/src/Firmware/boards/px4/sitl/default.cmake

-- PX4 config: px4_sitl_default

-- PX4 platform: posix

-- PX4 lockstep: enabled

-- PX4 version: v1.9.0-698-g950dbc1d2e

-- cmake build type: RelWithDebInfo

-- The CXX compiler identification is AppleClang 10.0.1.10010046

-- The C compiler identification is AppleClang 10.0.1.10010046

-- The ASM compiler identification is AppleClang

-- Found assembler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc

-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++

-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/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: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Found PythonInterp: /anaconda3/bin/python (found version "3.6.4") 

-- Found PY_jinja2: /anaconda3/lib/python3.6/site-packages/jinja2  

-- PX4 ECL: Very lightweight Estimation & Control Library v1.9.0-rc1-21-g62fa464

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/louismueller/src/Firmware/build/px4_sitl_default

[10/688] git submodule src/drivers/gps/devices

[19/688] git submodule src/lib/ecl

[24/688] git submodule mavlink/include/mavlink/v2.0

[26/688] git submodule Tools/sitl_gazebo

[372/688] Performing configure step for 'sitl_gazebo'

-- install-prefix: /usr/local

-- The C compiler identification is AppleClang 10.0.1.10010046

-- The CXX compiler identification is AppleClang 10.0.1.10010046

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc

-- Check for working C compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/cc -- works

-- Detecting C compiler ABI info

-- Detecting C compiler ABI info - done

-- Detecting C compile features

-- Detecting C compile features - done

-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++

-- Check for working CXX compiler: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/c++ -- works

-- Detecting CXX compiler ABI info

-- Detecting CXX compiler ABI info - done

-- Detecting CXX compile features

-- Detecting CXX compile features - done

-- Performing Test COMPILER_SUPPORTS_CXX17

-- Performing Test COMPILER_SUPPORTS_CXX17 - Success

-- Performing Test COMPILER_SUPPORTS_CXX14

-- Performing Test COMPILER_SUPPORTS_CXX14 - Success

-- Performing Test COMPILER_SUPPORTS_CXX11

-- Performing Test COMPILER_SUPPORTS_CXX11 - Success

-- Performing Test COMPILER_SUPPORTS_CXX0X

-- Performing Test COMPILER_SUPPORTS_CXX0X - Success

-- Using C++17 compiler

-- Looking for pthread.h

-- Looking for pthread.h - found

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD

-- Performing Test CMAKE_HAVE_LIBC_PTHREAD - Success

-- Found Threads: TRUE  

-- Found Boost: /usr/local/include (found suitable version "1.70.0", minimum required is "1.58") found components: system thread filesystem chrono date_time atomic 

-- Found PkgConfig: /usr/local/bin/pkg-config (found version "0.29.2") 

-- Checking for module 'bullet>=2.82'

-- Found bullet, version 2.88

-- Found Boost: /usr/local/include (found suitable version "1.70.0", minimum required is "1.40.0") found components: thread system filesystem program_options regex iostreams date_time chrono atomic 

-- Found Protobuf: /usr/local/lib/libprotobuf.dylib (found version "3.7.1") 

-- Found Boost: /usr/local/include (found version "1.70.0")  

-- Looking for OGRE...

-- OGRE_PREFIX_WATCH changed.

-- Checking for module 'OGRE'

-- Found OGRE, version 1.9.0

-- Found Ogre Ghadamon (1.9.0)

-- Found OGRE: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreMain.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreMain.dylib

-- Looking for OGRE_Paging...

-- Found OGRE_Paging: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgrePaging.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgrePaging.dylib

-- Looking for OGRE_Terrain...

-- Found OGRE_Terrain: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreTerrain.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreTerrain.dylib

-- Looking for OGRE_Property...

-- Found OGRE_Property: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreProperty.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreProperty.dylib

-- Looking for OGRE_RTShaderSystem...

-- Found OGRE_RTShaderSystem: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreRTShaderSystem.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreRTShaderSystem.dylib

-- Looking for OGRE_Volume...

-- Found OGRE_Volume: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreVolume.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreVolume.dylib

-- Looking for OGRE_Overlay...

-- Found OGRE_Overlay: optimized;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreOverlay.dylib;debug;/usr/local/Cellar/ogre1.9/1.9-20160714-108ab0bcc69603dba32c0ffd4bbbc39051f421c9_8/lib/libOgreOverlay.dylib

-- Checking for module 'libzmq>=3.2.0'

-- Found libzmq, version 4.3.2

-- Looking for zmq pkgconfig file - found

-- Checking for module 'uuid'

-- Found uuid, version 1.6.2

-- Looking for ignition-msgs - found

-- Found PythonInterp: /anaconda3/bin/python (found version "3.6.4") 

-- Found OpenCV: /usr/local (found version "4.1.0") 

-- Found TinyXML: /usr/local/lib/libtinyxml.dylib  

-- Checking for module 'OGRE'

-- Found OGRE, version 1.9.0

-- Building klt_feature_tracker without catkin

-- Building OpticalFlow with OpenCV

-- Found MAVLink: /Users/louismueller/src/Firmware/mavlink/include (found version "2.0") 

-- catkin DISABLED

-- Checking for module 'protobuf'

-- Found protobuf, version 3.7.1

Gazebo version: 8.6

-- Configuring done

-- Generating done

-- Build files have been written to: /Users/louismueller/src/Firmware/build/px4_sitl_default/build_gazebo

[565/688] Performing build step for 'sitl_gazebo'

FAILED: external/Stamp/sitl_gazebo/sitl_gazebo-build 

cd /Users/louismueller/src/Firmware/build/px4_sitl_default/build_gazebo && /usr/local/Cellar/cmake/3.15.2/bin/cmake --build . && /usr/local/Cellar/cmake/3.15.2/bin/cmake -E touch /Users/louismueller/src/Firmware/build/px4_sitl_default/external/Stamp/sitl_gazebo/sitl_gazebo-build

[1/86] Running cpp protocol buffer compiler on msgs/CommandMotorSpeed.proto

[2/86] Running cpp protocol buffer compiler on msgs/Int32.proto

[3/86] Running cpp protocol buffer compiler on msgs/Pressure.proto

[4/86] Running cpp protocol buffer compiler on msgs/MotorSpeed.proto

[5/86] Running cpp protocol buffer compiler on msgs/Imu.proto

[6/86] Running cpp protocol buffer compiler on msgs/IRLock.proto

[7/86] Running cpp protocol buffer compiler on msgs/Groundtruth.proto

[8/86] Running cpp protocol buffer compiler on msgs/Float.proto

[9/86] Running cpp protocol buffer compiler on msgs/Range.proto

[10/86] Running cpp protocol buffer compiler on msgs/MagneticField.proto

[11/86] Running cpp protocol buffer compiler on msgs/SITLGps.proto

[12/86] Running cpp protocol buffer compiler on msgs/OpticalFlow.proto

[13/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk-gen.sdf

/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk.sdf.jinja -> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/pixhawk/pixhawk-gen.sdf

[14/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag-gen.sdf

/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag.sdf.jinja -> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/3DR_gps_mag/3DR_gps_mag-gen.sdf

[15/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/c920/c920-gen.sdf

/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/c920/c920.sdf.jinja -> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/c920/c920-gen.sdf

[16/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4-gen.sdf

/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4.sdf.jinja -> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/mb1240-xl-ez4/mb1240-xl-ez4-gen.sdf

[17/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100-gen.sdf

/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100.sdf.jinja -> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/matrice_100/matrice_100-gen.sdf

[18/86] Generating /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf

FAILED: /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf 

cd /Users/louismueller/src/Firmware/Tools/sitl_gazebo && rm -f /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf && /anaconda3/bin/python /Users/louismueller/src/Firmware/Tools/sitl_gazebo/scripts/xacro.py -o /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.urdf /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.xacro enable_mavlink_interface:=true enable_ground_truth:=false enable_wind:=false enable_logging:=false rotors_description_dir:=/Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description send_vision_estimation:=true send_odometry:=false && gz sdf -p /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.urdf >> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf && rm -f /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.urdf

/bin/sh: line 1: 86070 Segmentation fault: 11 gz sdf -p /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/rotors_description/urdf/iris_base.urdf >> /Users/louismueller/src/Firmware/Tools/sitl_gazebo/models/iris/iris.sdf

[19/86] Building CXX object CMakeFiles/mav_msgs.dir/MotorSpeed.pb.cc.o

[20/86] Building CXX object CMakeFiles/std_msgs.dir/Int32.pb.cc.o

[21/86] Building CXX object CMakeFiles/mav_msgs.dir/CommandMotorSpeed.pb.cc.o

[22/86] Building CXX object CMakeFiles/sensor_msgs.dir/Groundtruth.pb.cc.o

[23/86] Building CXX object CMakeFiles/sensor_msgs.dir/Float.pb.cc.o

[24/86] Building CXX object CMakeFiles/sensor_msgs.dir/IRLock.pb.cc.o

[25/86] Building CXX object CMakeFiles/sensor_msgs.dir/OpticalFlow.pb.cc.o

[26/86] Building CXX object CMakeFiles/sensor_msgs.dir/Range.pb.cc.o

[27/86] Building CXX object CMakeFiles/sensor_msgs.dir/MagneticField.pb.cc.o

ninja: build stopped: subcommand failed.

[566/688] Linking CXX static library src/lib/cdev/libcdev.a

ninja: build stopped: subcommand failed.

make: *** [px4_sitl] Error 1

For me the segfault went away with these steps so I’m not sure what to advise. I tried to debug the gz call with lldb but at that point it didn’t happen anymore.

Another thing to try is to clean everything and the submodules:
Attention: use -n to first check what is going to be deleted.

git clean -dfx
git submodule foreach git clean -dfx