gazebosim / gz-sim

Open source robotics simulator. The latest version of Gazebo.
https://gazebosim.org
Apache License 2.0
719 stars 272 forks source link

Crash after adding plugin MulticopterMotorModel #2646

Closed gzfuzz closed 1 month ago

gzfuzz commented 1 month ago

Environment

Description

Steps to reproduce

  1. gz sim examples/worlds/shapes.sdf -r &
  2. call /world/shapes/entity/system/add service to add a MulticopterMotorModel, with
gz service --timeout 10000 -s /world/shapes/entity/system/add --reptype gz.msgs.Boolean --reqtype gz.msgs.EntityPlugin_V --req 'entity {
  id: 8
}
plugins {
  name: "gz::sim::systems::MulticopterMotorModel"
  filename: "gz-sim-multicopter-motor-model-system"
  innerxml: "<jointName>rotor_puller_joint</jointName>\n<linkName>rotor_puller</linkName>\n<turningDirection>cw</turningDirection>\n<timeConstantUp>0.0125</timeConstantUp>\n<timeConstantDown>0.025</timeConstantDown>\n<maxRotVelocity>3500</maxRotVelocity>\n<motorConstant>8.54858e-06</motorConstant>\n<momentConstant>0.01</momentConstant>\n<commandSubTopic>command/motor_speed</commandSubTopic>\n<motorNumber>0</motorNumber>\n<rotorDragCoefficient>8.06428e-05</rotorDragCoefficient>\n<rollingMomentCoefficient>1e-06</rollingMomentCoefficient>\n<rotorVelocitySlowdownSim>10</rotorVelocitySlowdownSim>\n<motorType>velocity</motorType>"
}'

The plugin is from examples/worlds/advanced_lift_drag_system.sdf

Output

Stack trace (most recent call last):
#31   Object "gz sim server", at 0x5c3c9b8041d4, in _start
#30   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x775204a2a28a, in __libc_start_main
#29   Object "/lib/x86_64-linux-gnu/libc.so.6", at 0x775204a2a1c9, in 
#28   Object "gz sim server", at 0x5c3c9b804186, in 
#27   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x775204eb9192, in ruby_run_node
#26   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x775204eb4e5b, in 
#25   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x775205057b39, in rb_vm_exec
#24   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x7752050545db, in 
#23   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x7752050500fe, in 
#22   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x77520504d8ef, in 
#21   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x775204f8e099, in 
#20   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x775204eb7216, in rb_protect
#19   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x77520505c2c9, in rb_yield
#18   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x775205057b39, in rb_vm_exec
#17   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x7752050545db, in 
#16   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x7752050500fe, in 
#15   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x77520504d8ef, in 
#14   Object "/usr/lib/x86_64-linux-gnu/ruby/3.2.0/fiddle.so", at 0x775204c27b13, in 
#13   Object "/lib/x86_64-linux-gnu/libruby-3.2.so.3.2", at 0x7752050163bb, in rb_nogvl
#12   Object "/usr/lib/x86_64-linux-gnu/ruby/3.2.0/fiddle.so", at 0x775204c2743b, in 
#11   Object "/lib/x86_64-linux-gnu/libffi.so.8", at 0x775204c1b0bd, in ffi_call
#10   Object "/lib/x86_64-linux-gnu/libffi.so.8", at 0x775204c183ee, in 
#9    Object "/lib/x86_64-linux-gnu/libffi.so.8", at 0x775204c1bb15, in 
#8    Object "/data/play/robot/workspace/install/lib/libgz-sim9-gz.so.9.0.0", at 0x7751fe4bdc83, in runServer
#7    Object "/data/play/robot/workspace/install/lib/libgz-sim9.so.9", at 0x7751fcde1707, in gz::sim::v9::Server::Run(bool, unsigned long, bool)
#6    Object "/data/play/robot/workspace/install/lib/libgz-sim9.so.9", at 0x7751fce51bda, in 
#5    Object "/data/play/robot/workspace/install/lib/libgz-sim9.so.9", at 0x7751fce835f3, in gz::sim::v9::SimulationRunner::Run(unsigned long)
#4    Object "/data/play/robot/workspace/install/lib/libgz-sim9.so.9", at 0x7751fce845f8, in gz::sim::v9::SimulationRunner::Step(gz::sim::v9::UpdateInfo const&)
#3    Object "/data/play/robot/workspace/install/lib/libgz-sim9.so.9", at 0x7751fce8082a, in gz::sim::v9::SimulationRunner::UpdateSystems()
#2    Object "/data/play/robot/workspace/install/lib/gz-sim-9/plugins/libgz-sim-multicopter-motor-model-system.so", at 0x7751e56d5585, in 
#1    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7751ff36330c, in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::operator=(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
#0    Object "/lib/x86_64-linux-gnu/libstdc++.so.6", at 0x7751ff362ddc, in std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::_M_assign(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)
Segmentation fault (Address not mapped to object [0x10])
iche033 commented 1 month ago

fix in #2653