What are the units and coordinate conventions in ROS?
Has ROS agreed on a units standard?
ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
Has ROS agreed on a units standard?
REP 103 outlines in detail the standard units of measure and coordinate conventions that are used in ROS.
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.
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.
Asked: 2011-02-15 07:04:04 -0600
Seen: 8,846 times
Last updated: Sep 04 '20
What are the best practices for tagging questions?
Is ROS Answers an Alternative to the [ros-users] Mailing List?
How to get notified of new questions with a certain tag by email?
How can I get involved in ROS community?
Do I need to know any specific computer language or framework to use ROS?
ROS Packages vs. Linux Packages
Posting code in answers and copyright statement?
How should I use branches and tags in my mercurial ROS repository?