Gazebo | Ignition | Community
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

gz-physics dartsim assertion failed during px4 simulation

Hello! When starting a simulation through px4 like shown below, gazebo stops and prints a stacktrace to the console. There seems to be an assertion error - not sure why? Is this a bug in the gz-physics software or more like an issue with my setup? I'm running gazebo garden (7.4.0) on ArchLinux.

[Dbg] [SystemManager.cc:74] Loaded system [gz::sim::systems::MulticopterMotorModel] for entity [10]
[Dbg] [UserCommands.cc:1263] Created entity [10] named [x500_0]
/usr/include/c++/12.2.1/bits/stl_vector.h:1123: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](size_type) [with _Tp = dart::dynamics::Skeleton::DataCache; _Alloc = Eigen::aligned_allocator<dart::dynamics::Skeleton::DataCache>; reference = dart::dynamics::Skeleton::DataCache&; size_type = long unsigned int]: Assertion '__n < this->size()' failed.
Stack trace (most recent call last):
#31   Object "/usr/lib/libruby.so.3.0", at 0x7f631584760e, in
#30   Object "/usr/lib/libruby.so.3.0", at 0x7f6315844829, in
#29   Object "/usr/lib/libruby.so.3.0", at 0x7f631583b57c, in
#28   Object "/usr/lib/ruby/3.0.0/x86_64-linux/fiddle.so", at 0x7f6315b96acc, in
#27   Object "/usr/lib/libruby.so.3.0", at 0x7f631580e0f5, in rb_nogvl
#26   Object "/usr/lib/ruby/3.0.0/x86_64-linux/fiddle.so", at 0x7f6315b963bc, in
#25   Object "/usr/lib/libffi.so.8", at 0x7f631537cb72, in ffi_call
#24   Object "/usr/lib/libffi.so.8", at 0x7f6315379f5d, in
#23   Object "/usr/lib/libffi.so.8", at 0x7f631537d4f5, in
#22   Object "/usr/lib/libgz-sim7-gz.so.7.4.0", at 0x7f6311a70940, in runServer
#21   Object "/usr/lib/libgz-sim7.so.7", at 0x7f63109f09c2, in
#20   Object "/usr/lib/libgz-sim7.so.7", at 0x7f6310a0438b, in gz::sim::v7::SimulationRunner::Run(unsigned long)
#19   Object "/usr/lib/libgz-sim7.so.7", at 0x7f6310a03a28, in gz::sim::v7::SimulationRunner::Step(gz::sim::v7::UpdateInfo const&)
#18   Object "/usr/lib/libgz-sim7.so.7", at 0x7f63109f8d91, in gz::sim::v7::SimulationRunner::UpdateSystems()
#17   Object "/usr/lib/gz-sim-7/plugins/libgz-sim-physics-system.so", at 0x7f62fc520a6b, in gz::sim::v7::systems::Physics::Update(gz::sim::v7::UpdateInfo const&, gz::sim::v7::EntityComponentManager&)
#16   Object "/usr/lib/gz-sim-7/plugins/libgz-sim-physics-system.so", at 0x7f62fc50cce6, in gz::sim::v7::systems::PhysicsPrivate::CreatePhysicsEntities(gz::sim::v7::EntityComponentManager const&, bool)
#15   Object "/usr/lib/gz-sim-7/plugins/libgz-sim-physics-system.so", at 0x7f62fc50bd0e, in gz::sim::v7::systems::PhysicsPrivate::CreateModelEntities(gz::sim::v7::EntityComponentManager const&, bool)
#14   Object "/usr/lib/gz-sim-7/plugins/libgz-sim-physics-system.so", at 0x7f62fc597f10, in void gz::sim::v7::EntityComponentManager::EachNew<gz::sim::v7::components::Component<std::add_lvalue_reference<void>, gz::sim::v7::components::ModelTag, gz::sim::v7::serializers::DefaultSerializer<std::add_lvalue_reference<void> > >, gz::sim::v7::components::Component<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, gz::sim::v7::components::NameTag, gz::sim::v7::serializers::StringSerializer>, gz::sim::v7::components::Component<gz::math::v7::Pose3<double>, gz::sim::v7::components::PoseTag, gz::sim::v7::serializers::DefaultSerializer<gz::math::v7::Pose3<double> > >, gz::sim::v7::components::Component<unsigned long, gz::sim::v7::components::ParentEntityTag, gz::sim::v7::serializers::DefaultSerializer<unsigned long> > >(gz::sim::v7::EntityComponentManager::identity<std::function<bool (unsigned long const&, gz::sim::v7::components::Component<std::add_lvalue_reference<void>, gz::sim::v7::components::ModelTag, gz::sim::v7::serializers::DefaultSerializer<std::add_lvalue_reference<void> > > const*, gz::sim::v7::components::Component<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, gz::sim::v7::components::NameTag, gz::sim::v7::serializers::StringSerializer> const*, gz::sim::v7::components::Component<gz::math::v7::Pose3<double>, gz::sim::v7::components::PoseTag, gz::sim::v7::serializers::DefaultSerializer<gz::math::v7::Pose3<double> > > const*, gz::sim::v7::components::Component<unsigned long, gz::sim::v7::components::ParentEntityTag, gz::sim::v7::serializers::DefaultSerializer<unsigned long> > const*)> >::type) const
#13   Object "/usr/lib/gz-sim-7/plugins/libgz-sim-physics-system.so", at 0x7f62fc514315, in
#12   Object "/usr/lib/gz-sim-7/plugins/libgz-sim-physics-system.so", at 0x7f62fc54a7d5, in gz::physics::sdf::ConstructSdfModel::World<gz::physics::FeaturePolicy<double, 3ul>, gz::sim::v7::systems::PhysicsPrivate::MinimumFeatureList>::ConstructModel(sdf::v13::Model const&)
#11   Object "/usr/lib/gz-physics-6/engine-plugins/libgz-physics-dartsim-plugin.so", at 0x7f62ea57fbb4, in virtual thunk to gz::physics::dartsim::SDFFeatures::ConstructSdfModel(gz::physics::Identity const&, sdf::v13::Model const&)
#10   Object "/usr/lib/gz-physics-6/engine-plugins/libgz-physics-dartsim-plugin.so", at 0x7f62ea57e2b3, in gz::physics::dartsim::SDFFeatures::ConstructSdfModelImpl(unsigned long, sdf::v13::Model const&)
#9    Object "/usr/lib/gz-physics-6/engine-plugins/libgz-physics-dartsim-plugin.so", at 0x7f62ea57d1c3, in gz::physics::dartsim::SDFFeatures::ConstructSdfJoint(gz::physics::dartsim::ModelInfo const&, sdf::v13::Joint const&, dart::dynamics::BodyNode*, dart::dynamics::BodyNode*)
#8    Object "/usr/lib/gz-physics-6/engine-plugins/libgz-physics-dartsim-plugin.so", at 0x7f62ea571279, in dart::dynamics::RevoluteJoint* dart::dynamics::BodyNode::moveTo<dart::dynamics::RevoluteJoint>(dart::dynamics::BodyNode*, dart::dynamics::RevoluteJoint::Properties const&)
#7    Object "/usr/lib/gz-physics-6/engine-plugins/libgz-physics-dartsim-plugin.so", at 0x7f62ea5710fc, in dart::dynamics::RevoluteJoint* dart::dynamics::Skeleton::moveBodyNodeTree<dart::dynamics::RevoluteJoint>(dart::dynamics::BodyNode*, std::shared_ptr<dart::dynamics::Skeleton> const&, dart::dynamics::BodyNode*, dart::dynamics::RevoluteJoint::Properties const&)
#6    Object "/usr/lib/libdart.so.6.12", at 0x7f62ea081ef6, in dart::dynamics::Skeleton::moveBodyNodeTree(dart::dynamics::Joint*, dart::dynamics::BodyNode*, std::shared_ptr<dart::dynamics::Skeleton>, dart::dynamics::BodyNode*)
#5    Object "/usr/lib/libdart.so.6.12", at 0x7f62e9f3794d, in dart::dynamics::Entity::changeParentFrame(dart::dynamics::Frame*)
#4    Object "/usr/lib/libdart.so.6.12", at 0x7f62e9f08f0f, in dart::dynamics::BodyNode::dirtyTransform()
#3    Object "/usr/lib/libstdc++.so.6", at 0x7f63118d30e1, in std::__glibcxx_assert_fail(char const*, int, char const*, char const*)
#2    Object "/usr/lib/libc.so.6", at 0x7f631543b53c, in abort
#1    Object "/usr/lib/libc.so.6", at 0x7f6315451ea7, in gsignal
#0    Object "/usr/lib/libc.so.6", at 0x7f63154a08ec, in
Aborted (Signal sent by tkill() 23169 1000)
ERROR [gz_bridge] timed out waiting for clock message
ERROR [gz_bridge] Task start failed (-1)
ERROR [init] gz_bridge failed to start
ERROR [px4] Startup script returned with return value: 256

The command I used to to start the px4 simulation is make px4_sitl gz_x500

Under the hood this launches gazebo and loads a world and a drone model. According to the stacktrace, the problem has something to do with the joints, how can I identify the issue?