DART interface incompatibility and gazebo crashed after insert some model

Create issue
Issue #2443 new
Jack Liu created an issue

I run the gazebo 9 with DART physics engine (dart 6), and then insert the PR2 robot, the gazebo print some message and crashed

Msg [NameManager::issueNewName] (default) The name [root] is a duplicate, so it has been renamed to [root(1)]
Msg [NameManager::issueNewName] (default) The name [root] is a duplicate, so it has been renamed to [root(2)]
Msg [NameManager::issueNewName] (default) The name [root] is a duplicate, so it has been renamed to [root(3)]
Msg [NameManager::issueNewName] (default) The name [root] is a duplicate, so it has been renamed to [root(4)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(1)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(2)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(3)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(4)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(5)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(6)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(7)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(8)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(9)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(10)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(11)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(12)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(13)]
Msg [NameManager::issueNewName] (default) The name [BodyNode] is a duplicate, so it has been renamed to [BodyNode(14)]

After PR2 robot inserted, the PR2 robot can't show full-body, and then gazebo crashed.

Comments (5)

  1. mjbogusz

    I've encountered the same issue. After inserting a PR2 with simulation paused multiple errors showed up, and after resuming the simulation Gazebo became unresponsive and crashed/terminated after few seconds.

    Gazebo 9.2.0 (from branch gazebo9, changeset 37202:72786dfbd2cf), built with DART 6.5 as present in dartsim's PPA. Up-to-date Ubuntu 18.04.

    Full output of gazebo -e dart --verbose: https://pastebin.com/wsMW7M2Y

    Sidenote: inserting static objects (e.g. cube or gazebo) doesn't yield any errors at all and inserting a Cessna C172 yields only a handful of errors like this: [Err] [DARTJoint.cc:188] DARTJoint: SetAnchor is not implemented. Other objects that crashed Gazebo:

    • Polaris Ranger
    • Turtlebot (though Gazebo was responsive-ish before crashing)
  2. mjbogusz

    Just an additional note: I've prepared a catkin workspace with Dart and Gazebo and checked different versions in different combinations, all with the same result as above.

    Checked versions:

    • Dart: from 6.3 (the earliest available release from 6.x tree) up to 6.6 (prerelease)
    • Gazebo: 9.0.0, 9.1.1, 9.2.0 (from main gazebo9 branch). Default is not compiling for me.
  3. mjbogusz

    The problem is most likely related to the screw-type joint between the torso link and the torso motor screw link.

    I've simplified the PR2 model by removing the arms and the head. All that's left is the base, the wheels and the torso. Commenting out either the screw joint or even some of the wheels results in Gazebo not crashing anymore.

    Either it's the handling of screw-type joints itself or handling of circular joint dependencies - between the base link and torso motor screw there are 2 "paths": one direct via a revolute-type joint and one via prismatic-type joint, additional link (torso) and then screw-type joint:

         /----------(revolute)-----------\
        /                                 \
    base                                   torso_motor_screw
        \                                 /
         \--(prismatic)--torso--(screw)--/
    

    However, such a circular dependency is not invalid (or is it?) and it doesn't explain why the removal of wheels solves the crashes.

  4. mjbogusz

    After compilation with -DCMAKE_BUILD_TYPE=Debug Gazebo crashed with following message:

    gzserver: /home/konrad/gazebo-dart/src/dart/dart/dynamics/BodyNode.cpp:1900: void dart::dynamics::BodyNode::addConstraintImpulse(const Vector6d&): Assertion `!math::isNan(_constImp)' failed.
    

    Edit: full stacktrace from GDB (ignore the leading and misleading 2 entries):

    #0  0x00007ffff5cd9e97 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
    #1  0x00007ffff5cdb801 in __GI_abort () at abort.c:79
    #2  0x00007ffff5ccb39a in __assert_fail_base (fmt=0x7ffff5e527d8 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=assertion@entry=0x7fffe99fb9b6 "!math::isNan(_constImp)", file=file@entry=0x7fffe99fb290 "/home/konrad/gazebo-dart/src/dart/dart/dynamics/BodyNode.cpp", line=line@entry=1900, function=function@entry=0x7fffe9a09a40 <dart::dynamics::BodyNode::addConstraintImpulse(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)::__PRETTY_FUNCTION__> "void dart::dynamics::BodyNode::addConstraintImpulse(const Vector6d&)") at assert.c:92
    #3  0x00007ffff5ccb412 in __GI___assert_fail (assertion=0x7fffe99fb9b6 "!math::isNan(_constImp)", file=0x7fffe99fb290 "/home/konrad/gazebo-dart/src/dart/dart/dynamics/BodyNode.cpp", line=1900, function=0x7fffe9a09a40 <dart::dynamics::BodyNode::addConstraintImpulse(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&)::__PRETTY_FUNCTION__> "void dart::dynamics::BodyNode::addConstraintImpulse(const Vector6d&)") at assert.c:101
    #4  0x00007fffe94bf8df in dart::dynamics::BodyNode::addConstraintImpulse(Eigen::Matrix<double, 6, 1, 0, 6, 1> const&) (this=0x7ffedd261600, _constImp=...) at /home/konrad/gazebo-dart/src/dart/dart/dynamics/BodyNode.cpp:1900
    #5  0x00007fffe9962f5a in dart::constraint::WeldJointConstraint::applyImpulse(double*) (this=0x7ffede148a90, _lambda=0x55555699e7d0) at /home/konrad/gazebo-dart/src/dart/dart/constraint/WeldJointConstraint.cpp:342
    #6  0x00007fffe994c5a7 in dart::constraint::DantzigLCPSolver::solve(dart::constraint::ConstrainedGroup*) (this=0x555556b9d6d0, _group=0x7ffede238220) at /home/konrad/gazebo-dart/src/dart/dart/constraint/DantzigLCPSolver.cpp:175
    #7  0x00007fffe992e283 in dart::constraint::ConstraintSolver::solveConstrainedGroups() (this=0x555556a701f0) at /home/konrad/gazebo-dart/src/dart/dart/constraint/ConstraintSolver.cpp:601
    #8  0x00007fffe992cb97 in dart::constraint::ConstraintSolver::solve() (this=0x555556a701f0) at /home/konrad/gazebo-dart/src/dart/dart/constraint/ConstraintSolver.cpp:321
    #9  0x00007fffe996ab94 in dart::simulation::World::step(bool) (this=0x555555bad800, _resetCommand=true) at /home/konrad/gazebo-dart/src/dart/dart/simulation/World.cpp:175
    #10 0x00007ffff502294c in gazebo::physics::DARTPhysics::UpdatePhysics() (this=0x555556375a00) at /home/konrad/gazebo-dart/src/gazebo/gazebo/physics/dart/DARTPhysics.cc:426
    #11 0x00007ffff51ef090 in gazebo::physics::World::Update() (this=0x555556b95240) at /home/konrad/gazebo-dart/src/gazebo/gazebo/physics/World.cc:782
    #12 0x00007ffff51ee801 in gazebo::physics::World::Step() (this=0x555556b95240) at /home/konrad/gazebo-dart/src/gazebo/gazebo/physics/World.cc:671
    #13 0x00007ffff51edba5 in gazebo::physics::World::RunLoop() (this=0x555556b95240) at /home/konrad/gazebo-dart/src/gazebo/gazebo/physics/World.cc:519
    #14 0x00007ffff522154a in std::__invoke_impl<void, void (gazebo::physics::World::*&)(), gazebo::physics::World*&>(std::__invoke_memfun_deref, void (gazebo::physics::World::*&)(), gazebo::physics::World*&) (__f=@0x555556a6dd48: (void (gazebo::physics::World::*)(gazebo::physics::World * const)) 0x7ffff51ed844 <gazebo::physics::World::RunLoop()>, __t=@0x555556a6dd58: 0x555556b95240) at /usr/include/c++/7/bits/invoke.h:73
    #15 0x00007ffff521f63e in std::__invoke<void (gazebo::physics::World::*&)(), gazebo::physics::World*&>(void (gazebo::physics::World::*&)(), gazebo::physics::World*&) (__fn=@0x555556a6dd48: (void (gazebo::physics::World::*)(gazebo::physics::World * const)) 0x7ffff51ed844 <gazebo::physics::World::RunLoop()>, __args#0=@0x555556a6dd58: 0x555556b95240) at /usr/include/c++/7/bits/invoke.h:95
    #16 0x00007ffff521ba29 in std::_Bind<void (gazebo::physics::World::*(gazebo::physics::World*))()>::__call<void, , 0ul>(std::tuple<>&&, std::_Index_tuple<0ul>) (this=0x555556a6dd48, __args=...) at /usr/include/c++/7/functional:467
    #17 0x00007ffff5216df5 in std::_Bind<void (gazebo::physics::World::*(gazebo::physics::World*))()>::operator()<, void>() (this=0x555556a6dd48) at /usr/include/c++/7/functional:551
    #18 0x00007ffff5211e63 in std::__invoke_impl<void, std::_Bind<void (gazebo::physics::World::*(gazebo::physics::World*))()>>(std::__invoke_other, std::_Bind<void (gazebo::physics::World::*(gazebo::physics::World*))()>&&) (__f=...) at /usr/include/c++/7/bits/invoke.h:60
    #19 0x00007ffff520981a in std::__invoke<std::_Bind<void (gazebo::physics::World::*(gazebo::physics::World*))()>>(std::_Bind<void (gazebo::physics::World::*(gazebo::physics::World*))()>&&) (__fn=...) at /usr/include/c++/7/bits/invoke.h:95
    #20 0x00007ffff5227e1c in std::thread::_Invoker<std::tuple<std::_Bind<void (gazebo::physics::World::*(gazebo::physics::World*))()> > >::_M_invoke<0ul>(std::_Index_tuple<0ul>) (this=0x555556a6dd48) at /usr/include/c++/7/thread:234
    #21 0x00007ffff5226d4a in std::thread::_Invoker<std::tuple<std::_Bind<void (gazebo::physics::World::*(gazebo::physics::World*))()> > >::operator()() (this=0x555556a6dd48) at /usr/include/c++/7/thread:243
    #22 0x00007ffff5224fc0 in std::thread::_State_impl<std::thread::_Invoker<std::tuple<std::_Bind<void (gazebo::physics::World::*(gazebo::physics::World*))()> > > >::_M_run() (this=0x555556a6dd40) at /usr/include/c++/7/thread:186
    #23 0x00007ffff6700733 in  () at /usr/lib/x86_64-linux-gnu/libstdc++.so.6
    #24 0x00007ffff56c86db in start_thread (arg=0x7ffee2ffd700) at pthread_create.c:463
    #25 0x00007ffff5dbc88f in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
    

    Edit2: This might be related to this bug report: https://github.com/dartsim/dart/issues/892

    Edit3: This is most probably the solver issue, as changing the solver by specifying a world SDF with solver type set to pgs allowed the simulation to run even with a complete PR2 model. World SDF used:

    <?xml version="1.0" ?>
    <sdf version="1.6">
      <world name="world_dart_pgs">
        <physics name="dart_1ms" default="true" type="dart">
          <max_step_size>0.001</max_step_size>
          <dart>
            <solver>
              <solver_type>pgs</solver_type>
            </solver>
          </dart>
        </physics>
        <include>
          <uri>model://sun</uri>
        </include>
        <include>
          <uri>model://ground_plane</uri>
        </include>
      </world>
    </sdf>
    

    Edit4: After rebuilding with CMAKE_BUILD_TYPE=RelWithDebInfo it ran with reasonable speed (Real Time Factor about 0.5 on an i7-8700K) but crashed after a short while, however just before it crashed one arm of the robot suddenly revolved into a physically unattainable position which could be caused by something entirely different.

  5. Log in to comment