PX4-Autopilot: Fail to simulate with gazebo on Ubuntu 20.04: Segmentation fault (core dumped) gzserver $verbose $world_path $ros_args

Describe the bug

I’m trying to run make px4_sitl gazebo but get the ‘core dumped’ error: image I tried to fix it by make distclean and git submodule update --init --recursive , and it succeeded twice by accident, but running SITL again gave the same failed result with the same error information. The gazebo can run perfectly standalone.

To Reproduce

I followed the instructions of the PX4 User Guide to install and configure, but got the error as described above. All px4 commands starting SITL with gazebo-classic fail with the same core dumped error.

Expected behavior

I expect PX4 to connect to gazebo normally and successfully run SITL.

Screenshot / Media

No response

Flight Log

lw@lw-System-Product-Name:~/PX4-Autopilot$ make px4_sitl gazebo [0/4] Performing build step for ‘sitl_gazebo-classic’ ninja: no work to do. [3/4] cd /home/lw/PX4-Autopilot/build/px4_sitl_default/src/modules…ome/lw/PX4-Autopilot /home/lw/PX4-Autopilot/build/px4_sitl_default SITL ARGS sitl_bin: /home/lw/PX4-Autopilot/build/px4_sitl_default/bin/px4 debugger: none model: iris world: none src_path: /home/lw/PX4-Autopilot build_path: /home/lw/PX4-Autopilot/build/px4_sitl_default GAZEBO_PLUGIN_PATH :/home/lw/PX4-Autopilot/build/px4_sitl_default/build_gazebo-classic GAZEBO_MODEL_PATH :/home/lw/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models LD_LIBRARY_PATH /home/lw/catkin_ws/devel/lib:/opt/ros/noetic/lib:/opt/ros/noetic/lib/x86_64-linux-gnu:/home/lw/PX4-Autopilot/build/px4_sitl_default/build_gazebo-classic empty world, setting empty.world as default Using: /home/lw/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_gazebo-classic/models/iris/iris.sdf Warning [parser.cc:833] XML Attribute[version] in element[sdf] not defined in SDF, ignoring. /home/lw/PX4-Autopilot/Tools/simulation/gazebo-classic/sitl_run.sh: line 147: 267253 Segmentation fault (core dumped) gzserver $verbose $world_path $ros_args SITL COMMAND: “/home/lw/PX4-Autopilot/build/px4_sitl_default/bin/px4” “/home/lw/PX4-Autopilot/build/px4_sitl_default”/etc


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

px4 starting.

INFO [px4] startup script: /bin/sh etc/init.d-posix/rcS 0 INFO [init] found model autostart file as SYS_AUTOSTART=10015 INFO [param] selected parameter default file parameters.bson INFO [param] selected parameter backup file parameters_backup.bson SYS_AUTOCONFIG: curr: 0 -> new: 1 SYS_AUTOSTART: curr: 0 -> new: 10015 CAL_ACC0_ID: curr: 0 -> new: 1310988 CAL_GYRO0_ID: curr: 0 -> new: 1310988 CAL_ACC1_ID: curr: 0 -> new: 1310996 CAL_GYRO1_ID: curr: 0 -> new: 1310996 CAL_ACC2_ID: curr: 0 -> new: 1311004 CAL_GYRO2_ID: curr: 0 -> new: 1311004 CAL_MAG0_ID: curr: 0 -> new: 197388 CAL_MAG0_PRIO: curr: -1 -> new: 50 CAL_MAG1_ID: curr: 0 -> new: 197644 CAL_MAG1_PRIO: curr: -1 -> new: 50 SENS_BOARD_X_OFF: curr: 0.0000 -> new: 0.0000 SENS_DPRES_OFF: curr: 0.0000 -> new: 0.0010 INFO [dataman] data manager file ‘./dataman’ size is 7872608 bytes INFO [init] PX4_SIM_HOSTNAME: localhost INFO [simulator_mavlink] Waiting for simulator to accept connection on TCP port 4560 Gazebo multi-robot simulator, version 11.14.0 Copyright © 2012 Open Source Robotics Foundation. Released under the Apache 2 License. http://gazebosim.org

[Msg] Waiting for master. [Err] [ConnectionManager.cc:121] Failed to connect to master in 30 seconds. [Err] [gazebo_shared.cc:78] Unable to initialize transport. [Err] [gazebo_client.cc:56] Unable to setup Gazebo

Software Version

Gazebo 11.14.0, Ubuntu 20.04

Flight controller

None

Vehicle type

None

How are the different components wired up (including port information)

No response

Additional context

No response

About this issue

  • Original URL
  • State: open
  • Created 3 months ago
  • Comments: 23 (8 by maintainers)

Most upvoted comments

Yes, I built it from the latest source code and then installed by sudo make install. It’s also the latest Gazebo 11.14.0 version.

I uninstalled Gazebo 11, which was installed using sudo apt-get install (by ubuntu.sh ), and then reinstalled Gazebo 11 from the source code following the official instructions https://classic.gazebosim.org/tutorials?tut=install_from_source&cat=install . Now, the SITL succefully runs smoothly and stably!