ros-simulation / gazebo_ros_pkgs

Wrappers, tools and additional API's for using ROS with Gazebo
http://wiki.ros.org/gazebo_ros_pkgs
754 stars 770 forks source link

When deleteing a robot model with gazebo_ros_camera gives Gazebo Aborts #595

Open RDaneelOlivav opened 7 years ago

RDaneelOlivav commented 7 years ago

When adding to a URDF the following code, and spawned all is OK.

<gazebo reference="camera_link">
    <sensor type="camera" name="camera1">
      <update_rate>10.0</update_rate>
      <camera name="head">

          <pose>0 0 0 0 0 1.57</pose>

        <horizontal_fov>1.3962634</horizontal_fov>
        <image>
          <width>400</width>
          <height>400</height>
          <format>R8G8B8</format>
        </image>
        <clip>
          <near>0.01</near>
          <far>100</far>
        </clip>
        <noise>
          <type>gaussian</type>
          <stddev>0.007</stddev>
        </noise>
      </camera>
      <plugin name="camera_controller" filename="libgazebo_ros_camera.so">
        <alwaysOn>true</alwaysOn>
        <updateRate>0.0</updateRate>
        <cameraName>myrobot/camera1</cameraName>
        <imageTopicName>image_raw</imageTopicName>
        <cameraInfoTopicName>camera_info</cameraInfoTopicName>
        <frameName>camera_link</frameName>
        <hackBaseline>0.07</hackBaseline>
        <distortionK1>0.0</distortionK1>
        <distortionK2>0.0</distortionK2>
        <distortionK3>0.0</distortionK3>
        <distortionT1>0.0</distortionT1>
        <distortionT2>0.0</distortionT2>
      </plugin>
    </sensor>
  </gazebo>

The problem comes when you delete the model while gazebo is still running. Makes Gazebo stop without finishing.

pure virtual method called terminate called without an active exception Aborted (core dumped) [gazebo-2] process has died [pid 14734, exit code 134, cmd /opt/ros/kinetic/lib/gazebo_ros/gzserver -e ode /home/rdaneel/catkin_ws/src/launch_worlds/worlds/urdf_demo.world __name:=gazebo

My theory is that maybe the plugin loses the link reffered to and breaks. Is there a way to indicate the plugin to stop or wait or even unload it so that the model can be repsawned?

Thankyou

MulixBF commented 6 years ago

I am struggling with this problem too. Were you able to find a workaround?

I run gazebo_ros with "debug" flag and collected a backtrace

#0  0x00007ffff6afa428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1  0x00007ffff6afc02a in __GI_abort () at abort.c:89
#2  0x00007ffff713484d in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#3  0x00007ffff71326b6 in ?? () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#4  0x00007ffff7132701 in std::terminate() () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#5  0x00007ffff713323f in __cxa_pure_virtual () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
#6  0x00007ffff76a14c6 in gazebo::event::Connection::~Connection() () from /usr/lib/x86_64-linux-gnu/libgazebo_common.so.7
#7  0x00007fffefd3bf22 in ?? () from /usr/lib/x86_64-linux-gnu/libgazebo_rendering.so.7
#8  0x00007fff5a869c9a in gazebo::CameraPlugin::~CameraPlugin() () from /usr/lib/x86_64-linux-gnu/gazebo-7/plugins/libCameraPlugin.so
#9  0x00007fff5b1c6ad9 in gazebo::GazeboRosCamera::~GazeboRosCamera() () from /opt/ros/kinetic/lib/libgazebo_ros_camera.so
#10 0x00007fff5b1c7029 in gazebo::GazeboRosCamera::~GazeboRosCamera() () from /opt/ros/kinetic/lib/libgazebo_ros_camera.so
#11 0x00007ffff685c38a in ?? () from /usr/lib/x86_64-linux-gnu/libgazebo_sensors.so.7
#12 0x00007ffff685cbc0 in gazebo::sensors::Sensor::Fini() () from /usr/lib/x86_64-linux-gnu/libgazebo_sensors.so.7
#13 0x00007ffff68247b8 in gazebo::sensors::CameraSensor::Fini() () from /usr/lib/x86_64-linux-gnu/libgazebo_sensors.so.7
#14 0x00007ffff68664c9 in gazebo::sensors::SensorManager::SensorContainer::RemoveSensor(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) () from /usr/lib/x86_64-linux-gnu/libgazebo_sensors.so.7
#15 0x00007ffff6867099 in gazebo::sensors::SensorManager::Update(bool) () from /usr/lib/x86_64-linux-gnu/libgazebo_sensors.so.7
#16 0x00007ffff7ba3ed0 in gazebo::Server::Run() () from /usr/lib/x86_64-linux-gnu/libgazebo.so.7
#17 0x0000000000402e68 in ?? ()
#18 0x00007ffff6ae5830 in __libc_start_main (main=0x402d70, argc=12, argv=0x7fffffffd878, init=<optimized out>, fini=<optimized out>, 
    rtld_fini=<optimized out>, stack_end=0x7fffffffd868) at ../csu/libc-start.c:291
#19 0x00000000004033e9 in _start ()

i am using latest version from Ubuntu repo (ros-kinetic-gazebo-plugins 2.5.14-1xenial-20180125-134458)

Also, I have found very similar issue here: #354 - maybe they are related somehow?

kev-the-dev commented 6 years ago

354 was fixed and closed. Do either of you still have this issue? I am unable to reproduce it