Skip to content
Snippets Groups Projects
Commit bf8d7a38 authored by Olivier Stasse's avatar Olivier Stasse
Browse files

Makes SpringPlugin.cc resilient to GAZEBO version

parent 1f2e1cd2
No related branches found
No related tags found
Loading
Pipeline #6418 failed
......@@ -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);
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment