# How to Split /cmd_vel into left and right wheel of 2WD robot?

Hi All Can you please help me writing the equation to split the velocity on left and right wheel of a differential robot from the /cmd_vel? I want to take smooth turns i.e both wheel should rotate in forward direction but at different speed while taking curves /turns

Equation which I encountered till now simply splits the velocity in which one wheel moves in clockwise Direction and other anticlockwise while taking turns.

Any help will be greatly appreciated.

edit retag close merge delete

It sounds like you're actually asking about the kinematics of a differential drive robot.

( 2019-09-26 13:17:06 -0500 )edit

@gvdhoorn I have seen the post. But unfortunately most of the link for the useful resources are not opening expect the YouTube video. Since I have lack of time can please share me link to a blog or documentation from where I can get a good idea.

Thankyou

( 2019-09-26 14:53:28 -0500 )edit

Sort by ยป oldest newest most voted

@gvdhoorn is right, this is a topic with an abundance of documentation in the community and simple geometry.

With that said this is how

vel_l = ((msg.linear.x - (msg.angular.z * self.wheel_bias / 2.0)) / self.wheel_radius) * 60/(2*3.14159)
vel_r = ((msg.linear.x + (msg.angular.z * self.wheel_bias / 2.0)) / self.wheel_radius) * 60/(2*3.14159)

more

Thanks @stevemacenski. I am noob in this field. Can you tell me the reason of multiplying the equation by (60/(2*3.14))

( 2019-09-26 14:51:28 -0500 )edit

That's conversion between rad and RPM. You dont need that if you dont need RPM

( 2019-09-26 15:56:24 -0500 )edit