# SetLinearVel() is not constant ?

Hello !

I am using GAZEBO 7 and ROS to make a simulation on pioneer3-AT for my internship.

I am facing a problem that is just blocking me for days, I have my plugin that at a specific moment is using the fonction SetLinearVel(), however, I can see that the model got an accéleration and then stop and just slide.

I wanted to know if there is a way to solve this issue ? I do need a constant velocity and I don't know how to do, here are my 2 functions :

    void definirVitesseLineaire(const double x, const double y){

this->model->SetLinearVel(math::Vector3(x, y, 0));
}

void definirVitesseAngulaire(const double z){

this->model->SetAngularVel(math::Vector3(0, 0, z));
}


Even if my robot are going the same speed, they wont actually follow each other as they're supposed to do ( with my code ) because the ammount of time both of the functions above are being called is different from a robot to another. This is why I need a constant velocity.

edit retag close merge delete

Consider posting you comment as an answer, esp the last sentence )

hello guys, sloretz thank you for that information. Now it's working pretty well, I am calling these functions at every world frame.

I converted the comment to an answer. I'm glad it working now shenki

1

Sort by » oldest newest most voted

These functions make the model move at the velocity without applying any forces, so you won't see a force/acceleration from them. The velocities must be given in the world frame. They set the velocity at the time they're called, afterwards the object can be slowed by forces. If you need a constant velocity you must call the methods every time step.

more