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

GPS track angle (Course over ground)

asked 2011-05-16 06:41:43 -0600

Jurica gravatar image

updated 2014-01-28 17:09:41 -0600

ngrennan gravatar image

I have question about track angle. I use gpss_client(for CTurtle) and in topic fix (gps_common/GPSFix) which besides latitude, longitude, altitude, speed, DOP factors give track angle which definition in fix topic in short is Direction in degrees from north. So i use google and find that angle is relative direction of travel to a ground position(same as Course Over Ground). In gorund robots we can asumme that track is equal heading which in marine vessels must be corrected for wind and sea current ( http://en.wikipedia.org/wiki/Course_%... ). One definition of track angle is at: http://www.ehow.com/about_5584477_gps... So my question is how is track angle measured. If we use compas convention that this angle is measured from true north in clock wise direction so North is 0° and East is 90°. But i think here in ROS is opposite 0° is North and 90° is West(counter-clock wise direction.) I read that all coordinate systems in ROS are right-handed(and that counter-clockwise direction is positive directon. Well if someone uses track and know in which direction form North track angle is measured(CCW(left) or CW(right)), can that knowdlege share with me,and other ROS users in forum.

What i think is that track angle is measured form North(0°) to West(90°)in counter clockwise direction.(my GPs reciever is LS20030 from Locosys.)

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2011-05-16 13:43:39 -0600

mjcarroll gravatar image

updated 2011-05-17 03:00:08 -0600

So, the two major conventions for GPS is NED (North-East-Down) and ENU (East-North-Up). Both of these are right-handed. NED is commonly used in aerial vehicles, where everything of interest is below, and ENU is commonly used in ground-based vehicles, where altitude is of interest.

Heading is represented in the NED coordinate system. This means that your heading, Phi, is 0 in the North direction, and is positive in the East direction, the same as a compass heading.

ROS works better following the ENU convention, as it more closely matches the body coordinate frame (X-forward,Y-left,Z-up).

Basically, you probably want to choose a convention for your work, and rotate the course over ground heading into your chosen coordinate frame. Looking at the datasheet for your receiver, it looks like course over ground is given as a compass heading (ENU) from True north, or Magnetic north, whichever you choose to use.

To get this into NED coordinates, you need to rotate the ENU coordinate frame. This can be accomplished using quaternions, rotation matricies, etc.

Assuming that your heading is represented in Radians, with North = 0, Pi to -Pi

  1. Subtract pi/2 from your heading (phi -= pi/2)
  2. Negate your heading (phi = -phi)
  3. Check the wrap on your heading (re-wrap to Pi to -Pi)

I'm not sure if a checkwrap function exists in ROS's geometry libraries, but you can get an example from https://github.com/wjwwood/au-automow/blob/master/au_automow_common/automow_ekf/src/automow_ekf.cpp" title="Github">Our EKF Functions, where we had to deal with the same problem.

edit flag offensive delete link more

Comments

Thx for yours answer. Yes it seems that headins is in NED convention, so i must choose which i will be using, and then convert one coordinate system to another.
Jurica gravatar image Jurica  ( 2011-05-16 23:29:03 -0600 )edit
We recently ran into the same issue on our project. I would say that ENU seems to work "better" with the ROS body-frame coordinate conventions.
mjcarroll gravatar image mjcarroll  ( 2011-05-17 02:58:04 -0600 )edit
I plan to use gps track angle for fusion with odometry heading, so i use odometry + GPS in EKF and i plan to fuse measurements form GPSn like x,y(in utm system) and gps track angle and speed which GPS gives(SOG). First realization in Matlab and then i hope so in ROS.
Jurica gravatar image Jurica  ( 2011-05-17 06:31:59 -0600 )edit
I think i will use ENU system so track angle which GPs gives(fix topic) is angle which shows how far from north y-axis is rotated in right direction. Robot (P3AT) heading is 0° and turns about x-axes(what ROS gives is negative angluar velocity so turns in clockwise direction).
Jurica gravatar image Jurica  ( 2011-05-17 06:39:15 -0600 )edit
So if I want true heading of robot i must add track+90°(or -(270-track) gives same result) , and i finnaly have same odometry frame in right angle towards global GPS (UTM) frame.(I plot odometryin utm and GPS x,y in utm and they match, so i think that is good).
Jurica gravatar image Jurica  ( 2011-05-17 06:44:37 -0600 )edit
We just did exactly that, but without the GPS heading. Here is our MATLAB implementation: https://github.com/mjcarroll/mech7710-final
mjcarroll gravatar image mjcarroll  ( 2011-05-18 09:11:21 -0600 )edit

Question Tools

Stats

Asked: 2011-05-16 06:41:43 -0600

Seen: 38,973 times

Last updated: May 17 '11