# How to calculate velocity for a tracked robot

Hi to all,

I've built my own skid-steering tracked robot and I wrote a simple ROS node which allows me to control it by using my keyboard. Since I'm using encoders for both motors, I would like to be able to calculate the tracks velocity and displacement so I can publish these values as ROS topics.

The problem is that I'm not able to find the correct formula to use, can you help me please?

The total tracks length is 275 cm. After a full driving wheel rotation, the rubber tracks displacement is 125 cm. The tracks rubber footprint is 85 cm. Encoder pulses for a full driving wheel rotations are 200.000. Max output driving wheel RPMs are 51, but I think this is not relevant.

What kind of formula do I have to use if I want to calculate velocity and displacement for each track?

I know I should use the classical formula V = S / T and S = V x T but I can't understand how to use these relations for my robot since it uses tracks instead of wheels. Is it possible to calculate the overall angular velocity for the robot?

I hope you can help me..

edit retag close merge delete

Sort by » oldest newest most voted For the translation part tracks are identical to wheels, the track length does not matter here, because distance traveled is identical to the wheel inside the track + the track thickness.

So for the translation you just calculate the distance traveled using the Circumference of the wheel with r = wheel radius + track thinkness. For the velocity you already got the right formula. If you are still unsure you could just drive the robot 1m or 10m and count the pulses on each track and divide that by the distance traveled.

Now the problem is the rotation part. Tracks have the bad attribute to slip a lot while turning. (Try to turn your robot by hand without slipping on the ground to understand it), possible solutions include:

• Turn the robot by 360° and count the pulses. Problem is that this value is different for each underground

• Get the rotation from another sensor, like an IMU.

more

Thank you for your support and help! My total circumference is 260 cm, so I'm using this formula to calculate the traveled distance: Dist = (Enc_ticks/360) * Circ For the velocity V = S/T, how can I calculate the time? Can you suggest me any solution, please?

Sorry I don't think I understood the question on how to calculate the time.

I mean: in order to calculate the velocity, I need to use the equation: V = S/T where [S = (Enc_ticks/360) * Circ], but how can I calculate the time? Is there any specific function in ROS which allows me to calculate time or do I have to use a timer?

1