diff --git a/src/SpringPlugin.cc b/src/SpringPlugin.cc index 300fc2d6a92ef3d61aa85c68257cffaa980daa44..487dd25a0f965cdeb3048da3125e6fae053afc56 100644 --- a/src/SpringPlugin.cc +++ b/src/SpringPlugin.cc @@ -63,12 +63,17 @@ void SpringPlugin::Init() boost::bind(&SpringPlugin::ExplicitUpdate, this)); } - + ///////////////////////////////////////////////// void SpringPlugin::ExplicitUpdate() { +#if GAZEBO_MAJOR_VERSION < 9 common::Time currTime = this->model->GetWorld()->GetSimTime(); +#else + common::Time currTime = this->model->GetWorld()->SimTime(); +#endif + common::Time stepTime = currTime - this->prevUpdateTime; this->prevUpdateTime = currTime; @@ -78,4 +83,3 @@ void SpringPlugin::ExplicitUpdate() -this->kdExplicit * vel; this->jointExplicit->SetForce(0, force); } -