Quantcast
Channel: Gazebo: Q&A Forum - RSS feed
Viewing all articles
Browse latest Browse all 7017

Machine with four wheels, how can I find the velocity of the left and ride side of the machine independently?

$
0
0
I have a four wheeled differential driving machine. I am writing a plugin that requires turn rate. Is there a way to find the velocity of a specific wheel in a machine? Here is my Turn Rate Method. int32_t calcTurnRate() { //Define pointers to front left and front right wheels gazebo::physics::LinkPtr RWheel = this->model->GetChildLink( "base_link::Rwheel_chassis::front_right_wheel"); gazebo::physics::LinkPtr LWheel = this->model->GetChildLink( "base_link::Lwheel_chassis::front_left_wheel"); //Components of Wheel Velocities int32_t RVel = RWheel->GetRelativeLinearVel().x; int32_t LVel = LWheel->GetRelativeLinearVel().x; //return turn rate return (RVel- LVel) * (WHEELBASE / 2); }

Viewing all articles
Browse latest Browse all 7017

Trending Articles