00858       {
    00859         [ROS_ERROR](../../../api/rosconsole/html/macros__generated_8h.html#a7fb635b03cc608284eadecd2f8becd9a)("DeleteModel: model [%s] does not exist",req.[model_name](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelRequest__.html#ae6bbe17db56816c9331ef6bf466e5f21).c_str());
    00860         res.[success](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelResponse__.html#a51152f41440f853bd60c199e254a7789) = false;
    00861         res.[status_message](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelResponse__.html#ad32bf4e34bc8e7d8cf5f5fcf85dc9754) = "DeleteModel: model does not exist";
    00862         return false;
    00863       }
    00864 
    00865       // delete wrench jobs on bodies
    00866       const std::vector<gazebo::Entity*> children = model->GetChildren();
    00867       for (std::vector<gazebo::Entity*>::const_iterator iter=children.begin();iter!=children.end();iter++)
    00868       {
    00869         gazebo::Body* body = (gazebo::Body*)(*iter);
    00870         if (body)
    00871         {
    00872           // look for it in jobs, delete body wrench jobs
    00873           this->[clearBodyWrenches](classGazeboROSNode.html#a8434da6f0a95fe58cceaf5518c906a8b)(body->GetScopedName());
    00874         }
    00875       }
    00876       // delete force jobs on joints
    00877       for (unsigned int [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392)=0;[i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392)< model->GetJointCount(); [i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392)++)
    00878       {
    00879         gazebo::Joint* joint = model->GetJoint([i](../../../api/ivcon/html/ivcon_8c.html#acb559820d9ca11295b4500f179ef6392));
    00880         // look for it in jobs, delete joint force jobs
    00881         this->[clearJointForces](classGazeboROSNode.html#a79ad3a609931f0e04b497126d5ae49d7)(joint->GetName());
    00882       }
    00883 
    00884       // delete model
    00885       gazebo::World::Instance()->SetSelectedEntity(NULL);
    00886       gazebo::World::Instance()->DeleteEntity(req.[model_name](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelRequest__.html#ae6bbe17db56816c9331ef6bf466e5f21));
    00887 
    00888       [ros::Duration](../../../api/rostime/html/classros_1_1Duration.html) model_spawn_timeout(60.0);
    00889       [ros::Time](../../../api/rostime/html/classros_1_1Time.html) timeout = [ros::Time::now](../../../api/rostime/html/classros_1_1Time.html#a4652034e29ceebf378d5930ff5914c0c)() + model_spawn_timeout;
    00890       // wait and verify that model is deleted
    00891       while (true)
    00892       {
    00893         if ([ros::Time::now](../../../api/rostime/html/classros_1_1Time.html#a4652034e29ceebf378d5930ff5914c0c)() > timeout)
    00894         {
    00895           res.[success](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelResponse__.html#a51152f41440f853bd60c199e254a7789) = false;
    00896           res.[status_message](../../gazebo_msgs/html/structgazebo__msgs_1_1DeleteModelResponse__.html#ad32bf4e34bc8e7d8cf5f5fcf85dc9754) = std::string("DeleteModel: Model pushed to delete queue, but delete service timed out waiting for model to disappear from simulation");
    00897           return false;