Using joint->SetParam for velocities has no effect in Gazebo7
I migrated my old differential kinematic plugin from Gazebo2 to Gazebo7.
While it didn't worked out of the box, I had a look at on the following posts which recommend to use SetParam
for joints to set the proper ODE parameters:
So I changed to call in my OnUpdate
function from:
this->leftWheel->SetMaxForce(2, 2.4); // Nm
this->rightWheel->SetMaxForce(2, 2.4); // Nm
this->leftWheel->SetVelocity(2, someLeftVel ); // rad/s
this->rightWheel->SetVelocity(2, someRightVel ); // rad/s
to
this->rightWheel->SetParam("fmax",2 , 2.4);
this->leftWheel->SetParam("fmax",2 , 2.4);
this->leftWheel->SetParam("vel", 2, w_l );
this->rightWheel->SetParam("vel", 2, w_l );
But the vehicle does almost nothing.
Very very slowly it moves to the desired direction if steered.
By the away, what is the difference between fmax
and max_force
when using SetParam
?
Testing the SetParam function:
Additionally, the output of the following lines:
std::cout << " +++++----- " << this->leftWheel->GetParam("fmax",2) << "\n";
std::cout << " +++++----- " << this->leftWheel->GetParam("max_force",2) << "\n";
this->leftWheel->SetParam("max_force",2 , 100);
this->leftWheel->SetParam("fmax",2 , 100);
std::cout << " --------- " << this->leftWheel->GetParam("fmax",2) << "\n";
std::cout << " --------- " << this->leftWheel->GetParam("max_force",2) << "\n";
produce the output
...
+++++----- 0
+++++----- 0
--------- 0
--------- 0
...
So actually, the SetParam
function does nothing.
Am I missing something here?
Asked by tik0 on 2017-02-28 07:27:56 UTC
Answers
It's late to answer that but for the ones who have troubles using the different way of controlling a joint, there is now a tutorial about that : http://gazebosim.org/tutorials?tut=set_velocity&cat=
It helped me a lot.
Asked by Brosseau.F on 2017-11-14 09:15:45 UTC
Comments