Gazebo model plugins in sphinx


I would like to insert different objects into my sphinx environment along with the drone and have them interact with each other via code.
To do this I am trying to add a gazebo model plugin to a cube object. I started by following the gazebo hello world plugin tutorial. This worked as expected by running sphinx <path/to/> <path/to/my.drone>.

Now I am trying to implement the model push tutorial, but when running sphinx, it crashes producing the following warnings/errors and a long backtrace (not included):

[Msg] World params for 'default':
[Wrn] [] Warning: Deleteing a connection right after creation. Make sure to save the   ConnectionPtr from a Connect call
[libprotobuf FATAL ./google/protobuf/repeated_field.h:1575] CHECK failed: (n) >= (0): 
terminate called after throwing an instance of 'google::protobuf::FatalException'
  what():  CHECK failed: (n) >= (0): 
*** Aborted
Register dump:

 RAX: 0000000000000000   RBX: 00007f23940cde20   RCX: 00007f24095f6e97
 RDX: 0000000000000000   RSI: 00007f23a37fc170   RDI: 0000000000000002
 RBP: 00007f24099a4840   R8 : 0000000000000000   R9 : 00007f23a37fc170
 R10: 0000000000000008   R11: 0000000000000246   R12: 00007f23940cdb00
 R13: 00007f23a37fc520   R14: 000000000000000d   R15: 00007f23940cddc0
 RSP: 00007f23a37fc170

 RIP: 00007f24095f6e97   EFLAGS: 00000246

 CS: 0033   FS: 0000   GS: 0000

 Trap: 00000000   Error: 00000000   OldMask: 00000000   CR2: 00000000

 FPUCW: 0000037f   FPUSW: 00000000   TAG: 00007f24
 RIP: 09c7cf00   RDP: 00000000

 ST(0) 0000 0000000000000000   ST(1) 0000 0000000000000000
 ST(2) 0000 0000000000000000   ST(3) 0000 0000000000000000
 ST(4) 0000 0000000000000000   ST(5) ffff 8000000000000000
 ST(6) ffff 8000000000000000   ST(7) a000 a000000000000000
 mxcsr: 1fa2
 XMM0:  000000000000000000000000ffffffff XMM1:  000000000000000000000000ffffffff
 XMM2:  000000000000000000000000ffffffff XMM3:  000000000000000000000000ffffffff
 XMM4:  000000000000000000000000ffffffff XMM5:  000000000000000000000000ffffffff
 XMM6:  000000000000000000000000ffffffff XMM7:  000000000000000000000000ffffffff
 XMM8:  000000000000000000000000ffffffff XMM9:  000000000000000000000000ffffffff
 XMM10: 000000000000000000000000ffffffff XMM11: 000000000000000000000000ffffffff
 XMM12: 000000000000000000000000ffffffff XMM13: 000000000000000000000000ffffffff
 XMM14: 000000000000000000000000ffffffff XMM15: 000000000000000000000000ffffffff

Could you please tell me why it is crashing? I used the exact same code as in the gazebo tutorial. Or what other methods do you use to move objects in sphinx? (I am using olympe to control the drone.)
Any help is much appreciated!


To ensure compatibility with Sphinx, you must build your shared library with the same version of Gazebo. Sphinx requires libgazebo7-dev.