0
$\begingroup$

Rosanswers logo

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_%28navigation%29). One definition of track angle is at: http://www.ehow.com/about_5584477_gps-track-angle-definition.html 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.)


Originally posted by Jurica on ROS Answers with karma: 97 on 2011-05-16

Post score: 1

$\endgroup$

1 Answer 1

1
$\begingroup$

Rosanswers logo

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 Our EKF Functions, where we had to deal with the same problem.


Originally posted by mjcarroll with karma: 6414 on 2011-05-16

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by mjcarroll on 2011-05-18:
We just did exactly that, but without the GPS heading. Here is our MATLAB implementation: https://github.com/mjcarroll/mech7710-final

Comment by Jurica on 2011-05-17:
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).

Comment by Jurica on 2011-05-17:
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).

Comment by Jurica on 2011-05-17:
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.

Comment by mjcarroll on 2011-05-17:
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.

Comment by Jurica on 2011-05-16:
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.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.