# Thread: Polar coordinates using linear, angular velocities

1. ## Polar coordinates using linear, angular velocities

I have a robot that has some linear and angular velocity.

I receive odometry information, which will be the position (x, y, theta) and velocity (linear and angular) in the robot's frame.

When the robot has linear and angular velocity, v and w, I want to predict the trajectory it is moving on. This should be a circle (or arc if we only consider part of the trajectory).

When I receive the odometry information, I start by finding the angle from the robot frame origin to its position, polar_theta. Then I find the distance of the vector from the origin to its position, polar_r. With these values, I have the current polar coordinates.

Then, I can find polar_theta' (polar theta prime) by displacing polar_theta by w*t, where t is some number of seconds. I have been using 0.25 seconds. Then to find the new x, y, and theta values in the robot's frame, I do:

x_r' = polar_r * cos(polar_theta')
y_r' = polar_r * sin(polar_theta')
theta_r' = theta_r + w*t

Then I can convert these values to the world coordinate system.

My question is why do I not use the radius found by r = v/w ? I feel like that should be the radius for polar coordinates I am using. However, when I use that value, I get incorrect results:

x_r' = r * cos(polar_theta') //Incorrect results!
y_r' = r * sin(polar_theta') //Incorrect results!

The radius r found from v/w and the radius polar_r found from the distance from the origin to the position are different. Why is the radius r = v/w not working here? I feel like I should be using it since the linear and angular velocity should define the circle.

Any help is appreciated.

2. ## Re: Polar coordinates using linear, angular velocities

Originally Posted by SterlingM
I have a robot that has some linear and angular velocity.

I receive odometry information, which will be the position (x, y, theta) and velocity (linear and angular) in the robot's frame.

When the robot has linear and angular velocity, v and w, I want to predict the trajectory it is moving on. This should be a circle (or arc if we only consider part of the trajectory).

When I receive the odometry information, I start by finding the angle from the robot frame origin to its position, polar_theta. Then I find the distance of the vector from the origin to its position, polar_r. With these values, I have the current polar coordinates.

Then, I can find polar_theta' (polar theta prime) by displacing polar_theta by w*t, where t is some number of seconds. I have been using 0.25 seconds. Then to find the new x, y, and theta values in the robot's frame, I do:

x_r' = polar_r * cos(polar_theta')
y_r' = polar_r * sin(polar_theta')
theta_r' = theta_r + w*t

Then I can convert these values to the world coordinate system.

My question is why do I not use the radius found by r = v/w ? I feel like that should be the radius for polar coordinates I am using. However, when I use that value, I get incorrect results:

x_r' = r * cos(polar_theta') //Incorrect results!
y_r' = r * sin(polar_theta') //Incorrect results!

The radius r found from v/w and the radius polar_r found from the distance from the origin to the position are different. Why is the radius r = v/w not working here? I feel like I should be using it since the linear and angular velocity should define the circle.

Any help is appreciated.
I'm not clear if this is the problem, but here goes:

The "r" in v = rw only works when the linear speed is the speed due to centripetal acceleration, that is to say if the object is not moving in a circle then v = rw does not hold.

-Dan

3. ## Re: Polar coordinates using linear, angular velocities

Originally Posted by topsquark
I'm not clear if this is the problem, but here goes:

The "r" in v = rw only works when the linear speed is the speed due to centripetal acceleration, that is to say if the object is not moving in a circle then v = rw does not hold.

-Dan
Hi, thanks for replying. I am assuming that it is moving in a circle. The problem is to find the circular motion of the robot (or just a point if you want to think of it like that). I know v and w and the x,y position of the robot. I am wondering why I cannot use

x' = r*cos(polar_theta)
y' = r*sin(polar_theta)

where r = v/w and polar_theta is the angle between the x-axis and the position vector. Instead, I have to use the length of the position vector to find the correct values. I hope this makes it more clear.

4. ## Re: Polar coordinates using linear, angular velocities

Originally Posted by SterlingM
Hi, thanks for replying. I am assuming that it is moving in a circle. The problem is to find the circular motion of the robot (or just a point if you want to think of it like that). I know v and w and the x,y position of the robot. I am wondering why I cannot use

x' = r*cos(polar_theta)
y' = r*sin(polar_theta)

where r = v/w and polar_theta is the angle between the x-axis and the position vector. Instead, I have to use the length of the position vector to find the correct values. I hope this makes it more clear.
Okay, if this doesn't do it I think I'm out of ideas. Your robot would be starting and stopping its rotation. Is the linear speed of the robot constant as it goes around/turns in a circular path?

I realize your system is complex and that you would want to simplify it as much as possible, but what's wrong with using the position vector?

-Dan