Ask Your Question

What are the units and coordinate conventions in ROS?

asked 2011-02-15 07:04:04 -0500

mwise gravatar image

updated 2014-01-28 17:09:07 -0500

ngrennan gravatar image

Has ROS agreed on a units standard?

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted

answered 2011-02-15 07:07:55 -0500

mmwise gravatar image

REP 103 outlines in detail the standard units of measure and coordinate conventions that are used in ROS.

edit flag offensive delete link more

answered 2011-02-15 08:47:45 -0500

Chad Rockey gravatar image

Melonee, as Melonee pointed out in REP 103, the units for ROS are mostly consistent with SI. The only exception being that celsuis is used for temperature instead of the kelvin base unit. However, unless you are performing absolute energy calculations, this is not likely to affect you.

The base coordinate frame in ROS follows the right hand rule and is essentially "engineering" frame as used by most mathematics and engineering professors I've encountered. This would be x-axis forward, y-axis left, and z-axis up.

Also, be aware that there are a few traps in this question with the coordinate frames. The first being that airplanes and other avionics love using the not-ROS compatible compass aligned coordinate frame. This frame is known for 0 degrees north, 90 degrees east, etc with x-axis north, y-axis east, and z-axis DOWN. While this is strange because altitudes above sea-level are now negative, heading is consistent with compass heading and positive pitch will pull you away from the ground. ROS coordinate frames provide for z-axis UP, so this resolves the altitude strangeness. However, heading now goes the opposite direction (consistent with the right-hand rule) and if you have positive pitch (about the y-axis), your plane will be heading into the ground! This is a tricky situation and one of the oldest coordinate frame battles between ground and aerial programmers. However, as long as you are careful and program your controls and your robots in ROS frame, all will work well.

The other main issue is that coordinate frames often don't follow magnetic or true north. While this is expected for the robot's internal coordinate frame and odometry frames, while being completely acceptable for map frames, there are differing opinions for globally aligned frames. Since compass heading doesn't match ROS heading, I have seen implementations that use 0 heading as north with pi/2 being west. However, others have had 0 heading being east with pi/2 being north. The good news is that so far no one has forced a choice, so you can use whatever you are most comfortable with. Just keep in mind that the rotation goes opposite that from a compass reading.

edit flag offensive delete link more


As far as a global (term used loosely here, in GPS terms, this is local) coordinate frame, it would probably be best to adopt something like ENU (east, north, up). This makes a plane tangent to the Earth's surface, and defines east as x, north as y, and up z.
mjcarroll gravatar image mjcarroll  ( 2011-02-15 10:12:49 -0500 )edit

answered 2020-09-04 02:06:27 -0500

bigbellmercy gravatar image

updated 2020-09-04 02:45:41 -0500

The reference frame in ROS is FLU, Front(X)-Left(Y)-Up(Z) as explained above. But optical frame uses RDF, Right(X)-Down(Y)-Front(Z), where Z axis direction is the direction that the camera looks forward.

Normally, the unit of position is meter and the unit of angle is radian.

More info.:

In this case, the rotation matrix (dcm) of RDF with respect to FLU is [0 0 1; -1 0 0; 0 -1 0] when the position vector is represented in column vector (not row vector) like [x; y; z] (or [x y z]' - the apostrophe(') symbol means matrix transposition).

Its Euler angle is (roll pitch yaw) = (-pi/2, 0, -pi) rad ('pi' is 3.141592) represented in '3-2-1 (or z-y-x) intrinsic sequence' where the body frame is rotated three times from the reference frame by the sequence of yaw, pitch and roll about the z, y and x axes of the body frame respectively.

This Euler angle value can be used in URDF(Unified Robot Description Format) file for a robot model to define 'joint's between a link frame and an optical frame of a camera.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools


Asked: 2011-02-15 07:04:04 -0500

Seen: 5,550 times

Last updated: Sep 04 '20