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:
- [gazebo_ros_diff_drive.cpp](http://docs.ros.org/jade/api/gazebo_plugins/html/gazebo__ros__diff__drive_8cpp_source.html)
- [SetMaxForce deprecated in gazebo 5.0](http://answers.gazebosim.org/question/8458/setmaxforce-deprecated-in-gazebo-50/)
- [ODEJoint.cc](https://bitbucket.org/osrf/gazebo/src/a29d8dabed9a14fb6bafdcd31c84b160c00b127c/gazebo/physics/ode/ODEJoint.cc?at=gazebo7_7.0.0&fileviewer=file-view-default)
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?
↧