Deleting URDF model causes error

asked 2017-09-07 23:35:44 -0600

autonomous gravatar image

updated 2017-09-07 23:37:05 -0600

Not sure if this is ROS or Gazebo related.

The URDF contains the differential drive plugin shown at the bottom. If the code for this plugin is removed, then the URDF can be deleted without issue. Otherwise, if the URDF is deleted either through a script or through the world tab in the GUI, it causes the following error:

terminate called after throwing an instance of 'boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<boost::lock_error> >'
  what():  boost: mutex lock failed in pthread_mutex_lock: Invalid argument
Aborted (core dumped)

The plugin creates a subscription to the cmd_vel topic and I think that I will need to remove this subscription before deleting the URDF to avoid this error. However I don't know how I can unsubscribe to certain topics (preferably in python).

  <plugin filename="libgazebo_ros_diff_drive.so" name="differential_drive_controller">
      <leftJoint>left_wheel_joint</leftJoint>
      <rightJoint>right_wheel_joint</rightJoint>
      <robotBaseFrame>base_link</robotBaseFrame>
      <wheelSeparation>0.5207</wheelSeparation>
      <wheelDiameter>0.254</wheelDiameter>
      <publishWheelJointState>true</publishWheelJointState>
      <legacyMode>false</legacyMode>
      <wheelTorque>180</wheelTorque>
    </plugin>
  </gazebo>
edit retag flag offensive close merge delete