diff --git a/Gazebo_Distributed_MPI/gazebo/physics/World.cc b/Gazebo_Distributed_MPI/gazebo/physics/World.cc index 39d68a8..c20b4a2 100644 --- a/Gazebo_Distributed_MPI/gazebo/physics/World.cc +++ b/Gazebo_Distributed_MPI/gazebo/physics/World.cc @@ -1826,7 +1826,7 @@ void World::ModelUpdateSingleLoop() // for (unsigned int i = 0; i < this->dataPtr->rootElement->GetChildCount(); i++) // { // this->dataPtr->rootElement->GetChild(i)->Update(); - // std::cout << "GetChildCount() : " << this->dataPtr->rootElement->GetChildCount() << std::endl; //zhangshuai test 2019.07.09 + // std::cout << "GetChildCount() : " << this->dataPtr->rootElement->GetChildCount() << std::endl; // std::cout << "GetChild(" << i << ") : " << this->dataPtr->rootElement->GetChild(i)->GetName() << std::endl; // std::cout << "rootElement->GetName() : " << this->dataPtr->rootElement->GetName() << std::endl; // std::cout << "this->GetModelCount() : " << this->GetModelCount() << std::endl; @@ -1843,13 +1843,22 @@ void World::ModelUpdateSingleLoop() // } // test by zhangshuai 2019.07.10 ----End - for (unsigned int i = 0; i < this->distribution->GetGazeboIDPtr(gazeboLocalID)->GetModelCount(); i++) + // Modified by zhangshuai for MPI 2019.07.11 ----Begin + if (this->flag == 1) { - this->distribution->GetGazeboIDPtr(gazeboLocalID)->GetModel(i)->Update(); - // this->GetModel(i)->Update(); - std::cout << "GetModelCount() : " << this->distribution->GetGazeboIDPtr(gazeboLocalID)->GetModelCount() << std::endl; - std::cout << "GetModel(i)->GetName() : " << this->distribution->GetGazeboIDPtr(gazeboLocalID)->GetModel(i)->GetName() << std::endl; + for (unsigned int i = 0; i < this->distribution->GetGazeboIDPtr(gazeboLocalID)->GetModelCount(); i++) + { + this->distribution->GetGazeboIDPtr(gazeboLocalID)->GetModel(i)->Update(); + } } + else + { + for (unsigned int i = 0; i < this->dataPtr->rootElement->GetChildCount(); i++) + { + this->dataPtr->rootElement->GetChild(i)->Update(); + } + } + // Modified by zhangshuai for MPI 2019.07.11 ----End } ////////////////////////////////////////////////// diff --git a/Gazebo_Hector_Test/src/hector_quadrotor/hector_quadrotor_gazebo/launch/hector_60_single_gazebo.launch b/Gazebo_Hector_Test/src/hector_quadrotor/hector_quadrotor_gazebo/launch/hector_60_single_gazebo.launch new file mode 100644 index 0000000..fa1436d --- /dev/null +++ b/Gazebo_Hector_Test/src/hector_quadrotor/hector_quadrotor_gazebo/launch/hector_60_single_gazebo.launch @@ -0,0 +1,676 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +