Gazebo | Ignition | Community
Ask Your Question
0

Using joint->SetParam for velocities has no effect in Gazebo7

asked 2017-02-28 06:27:56 -0500

tik0 gravatar image

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2017-11-14 08:15:45 -0500

Brosseau.F gravatar image

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.

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2017-02-28 06:27:56 -0500

Seen: 1,285 times

Last updated: Nov 14 '17