Home | Tutorials | Wiki | Issues
Ask Your Question
1

SetLinearVel() is not constant ?

asked 2017-04-13 03:40:40 -0500

shenki gravatar image

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.

Thank you in advance !

edit retag flag offensive close merge delete

Comments

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

eugene-katsevman gravatar imageeugene-katsevman ( 2017-04-13 10:13:29 -0500 )edit

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

shenki gravatar imageshenki ( 2017-04-14 01:43:18 -0500 )edit

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

sloretz gravatar imagesloretz ( 2017-04-14 10:20:20 -0500 )edit
1

shenki, accept the answer, please

eugene-katsevman gravatar imageeugene-katsevman ( 2017-04-14 10:40:06 -0500 )edit

1 Answer

Sort by » oldest newest most voted
2

answered 2017-04-13 09:45:23 -0500

sloretz gravatar image

updated 2017-04-14 10:19:30 -0500

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.

edit flag offensive delete link more
Login/Signup to Answer

Question Tools

1 follower

Stats

Asked: 2017-04-13 03:40:40 -0500

Seen: 87 times

Last updated: Apr 14