# Moving objects along a radius

I'm working on a project involving a Roomba which I'd like to move precisely from coordinate to coordinate. To move the Roomba manually you need to give it a velocity between -500 to 500mm/s and a radius between -2000mm and 2000mm. (taken from this specification). The robot has two seperate wheels with each having its own velocity. If you want it to turn, one wheel has to be moving slower/faster than the other.

Now imagine my roomba is moving from (0,0) on the x axis and at (2,0) I want him to move to (6,4). To do this I have to calculate the radius of this imaginary circle. I know my current position, my current velocity (which should be irrelevant since I always move on the same radius?) and the angle between the robot and the wanted position.

How do I calculate the radius? Does the velocity matter? Is there anything else I need to consider?

I found some more information about calculating the velocities of each wheel.

It says that's basic geometry but I can't figure out how the radius and angle relates to the velocity. Is this about angular velocity?

For the equations at the bottom: is V arbitrary? Does it matter if I want to drive 200mm/s on the radius or 400mm/s?

My physics are extremely rusty, please forgive me.

## 1 Answer

For the radius of the circle, $$R = \frac{x^2 + y^2}{2 y},$$ where $x$ is the horizontal distance you want to traverse and $y$ is the vertical distance you want to traverse.

Proof: Let's assume the Roomba is at the origin, and facing in the positive $x$-direction. The circle it will traverse is of radius $R$ and is centered at $(0,R)$. This means that any point on the circle (including our target point $(x,y)$) will satisfy $$x^2 + (y - R)^2 = R^2$$ and solving for $R$, we get $$x^2 + y^2 - 2 R y + R^2 = R^2 \quad \Rightarrow \quad R = \frac{x^2 + y^2}{2 y}.$$

For the calculation of the differential steering rates, they are in fact playing a bit fast & loose with angular position & angular velocity; what they're calling $\theta$ is really the Roomba's angular velocity around the circle. But the result is correct: the last two formulas give $V_{left}$ and $V_{right}$ in terms of the desired linear velocity $V$, the wheelbase, and the radius of the desired turn.

(Do you actually need to calculate the velocity of each wheel, though? From the spec, it looks like you can just feed in the desired $R$ value and velocity, and the Roomba takes care of calculating $V_{left}$ and $V_{right}$.)

• Great answer. So if I move the robot to (5,5) and want to move to (7,4), I can simply pretend for the formula that I'm at (0,0) and want to move to (2,-1)? And yeah, I can simply use the drive commmand. But since this is about exact driving I need to test out all possibilities. – Pulz Jun 16 '15 at 21:32