Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

the value of /odom/twist/twist/linear and angular is not in the unit of m/s and rad/s #3

Open
TouchDeeper opened this issue Apr 26, 2021 · 2 comments

Comments

@TouchDeeper
Copy link

Hello,

I found that the value of /odom/twist/twist/linear and /odom/twist/twist/linear/angular is not in the unit of m/s and rad/s.

If I want to convert it to the unit of m/s and rad/s, what coefficient should I multiply? Thank you a lot.

@dolikemedo
Copy link

HI!
according to this:
http://library.isr.ist.utl.pt/docs/roswiki/navigation(2f)Tutorials(2f)RobotSetup(2f)Odom.html
Isnt it m/s?
image

also:
28 //compute odometry in a typical way given the velocities of the robot
29 double dt = (current_time - last_time).toSec();
30 double delta_x = (vx * cos(th) - vy * sin(th)) * dt;
31 double delta_y = (vx * sin(th) + vy * cos(th)) * dt;
32 double delta_th = vth * dt;

so if vx (x component of velocity) is m/s, dt is second, then delta_x (x component of distance traveled) is meter.
It says vth is rad/s so, delta_th is radian

or do i interpret this incorrectly?

@zhh2005757
Copy link

Hello TouchDeeper !
I found something wrong about timestamp transformation from the original code "ROSThread.cpp". The timestamp of the code is nanoseconds, and there is no any transformation to seconds. So you only need to divide it by 1000000000 at line 314, like follows
2022-04-08 17-18-05屏幕截图
Then, the odom output will be the m/s and rad/s
2022-04-08 17-20-52屏幕截图

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants