# Deleting URDF model causes error

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>