Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PX4 Models crash Gazebo #12314

Closed
capitalPSA opened this issue Jun 21, 2019 · 6 comments
Closed

PX4 Models crash Gazebo #12314

capitalPSA opened this issue Jun 21, 2019 · 6 comments

Comments

@capitalPSA
Copy link

capitalPSA commented Jun 21, 2019

Bug
When inserting the 3DR Iris model into Gazebo, the error "Aborted (core dumped)" occurs.

To Reproduce
Steps to reproduce the behavior:

  1. Launch PX4 SITL ("no_sim=1 make px4_sitl_default gazebo")
  2. Source the necessary directories (source Tools/setup_gazebo.bash $(pwd) $(pwd)/build/px4_sitl_default)
  3. Launch Gazebo (roslaunch gazebo_ros shapes_world.launch)
  4. Insert the 3DR Iris model into the environment.
  5. Error:
    Aborted (core dumped)
    [gazebo-2] process has died [pid 27778, exit code 134, cmd /opt/ros/melodic/lib/gazebo_ros/gzserver -e ode worlds/shapes.world __name:=gazebo __log:=/home/USER/.ros/log/166013cc-9452-11e9-87a5-7085c2c3fe67/gazebo-2.log].
    log file: /home/USER/.ros/log/166013cc-9452-11e9-87a5-7085c2c3fe67/gazebo-2*.log

System Information
Ubuntu: 18.04
ROS: Melodic
Gazebo: 9.0.0
PX4: 1.9.0
GPU: NVidia RTX 2070 (430.26)
CUDA: 10.2
Fresh Install: Yes.

@julianoes
Copy link
Contributor

julianoes commented Jun 21, 2019

Could you paste the output of the logfiles mentioned? Or alternatively start using gdbby adding _iris_gdb.

@capitalPSA
Copy link
Author

After some debugging, I am finding this error:
0x00007fff04f66285 in gazebo::GazeboMavlinkInterface::Load(boost::shared_ptr<gazebo::physics::Model>, std::shared_ptr<sdf::Element>) () at /home/....../PX4ws/PX4/Firmware/build/px4_sitl_default/build_gazebo/libgazebo_mavlink_interface.so

The other models, such as a ramp and shelves, can all be placed without any crashes. The models that require a MAVLINK interface (e.g. planes and multirotor platforms) are causing an Aborted (core dumped) with an error code of 134.

I will continue to look further for additional debug information / insights.

@Jaeyoung-Lim
Copy link
Member

Have you tried adding the model in the launchfile?

@capitalPSA
Copy link
Author

@Jaeyoung-Lim You are right. Running the px4.launch file will insert the Iris model into the world and there is no crash.

Is this the new preferred way? Add the model into the launch file instead of manually inserting the model after the world is loaded in Gazebo?

The error looks to be localized to adding a model (that requires MAVlink) after the world is loaded. If a model is spawned using the launch file, there is no crash. Additional models can be manually added if the first model is added using the launch file.

@Jaeyoung-Lim
Copy link
Member

@capitalPSA I am not sure adding a model in gazebo would result in desirable results. Last time I inserted multiple models with the gzclient, all models were run on a single px4 sitl plugin.

I recommend always using the launchfile as you have more control on the configuration of the model too

@capitalPSA
Copy link
Author

Revisiting this issue, the cause was that the following parameters were missing from the default .world files that come with the gazebo_ros pkg:
max_step_size
real_time_update_rate

For example, the shapes.world file does not contain the "physics" tags which are needed by the gazebo_mavlink_interface library and, as a result, aborts due to the check(s) in the gazebo_mavlink_interface.cpp file.

TL;DR: Add the "physics" xml tags from the "iris.world" in the PX4 repository to the .world files for gazebo, typically located in the "/usr/share/gazebo-7/worlds" directory, if the user wants to use the worlds from the gazebo package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants