ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

Maths behind these calculations?

asked 2019-04-17 07:40:32 -0500

Hypomania gravatar image

updated 2019-04-17 07:40:59 -0500

Hi,

I keep stumbling upon these two equations in odom calculations as they are used quite frequently in literature, however I can't seem to find any explanation on to how they are derived (an full example here: https://answers.ros.org/question/9494... ):

double delta_x = (vx * cos(th) - vy * sin(th)) * dt;
double delta_y = (vx * sin(th) + vy * cos(th)) * dt;

Could anyone please help me understand what's happening here? Perhaps if you have a reference that would be really helpful!

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-04-17 08:18:04 -0500

Delb gravatar image

#q231942 will probably fully answer your question.

Just to sum-up the answer : This is because all the information you get comes from the robot so your postions and velocities are in the robot frame. You need to convert to another frame (odom, map, etc...), and to do that you need to apply a rotation matrix.

edit flag offensive delete link more

Comments

Thank you for that, just what I needed!

Hypomania gravatar image Hypomania  ( 2019-04-17 09:18:06 -0500 )edit

Sorry to bother you again, just to confirm, these calculations is where the data from the base_link frame is converted into odom or map frame?

Hypomania gravatar image Hypomania  ( 2019-04-17 10:23:50 -0500 )edit
1

It just depends on what theta is because this formula can be apllied to convert from one frame to any other. Here i'm assuming it's to convert from the robot frame to odom since your example comes from someone who create an odometry node.

Delb gravatar image Delb  ( 2019-04-18 01:53:37 -0500 )edit

Thank you for that, that's spot on!

Hypomania gravatar image Hypomania  ( 2019-04-18 02:32:40 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2019-04-17 07:40:32 -0500

Seen: 388 times

Last updated: Apr 17 '19