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

Revision history [back]

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 automow ekf function, where we had to deal with the same problem.

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 automow ekf function, where we had to deal with the same problem.

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 automow ekf function, where we had to deal with the same problem.

click to hide/show revision 4
Trying to fix link that renders funny.

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.