Get local position pose given a GPS cordinate (MAVROS)

Given a GPS coordinates in LLA, find the corresponding pose (geometry_msgs/PoseStamped) in local frame.


  1. Ubuntu 16.04 with ROS kinetic
  2. PX4 simulation/gazebo iris
  3. PX4 Fimware: v1.10.1
  4. MAVROS: version 1.0.0


I am a little confused with the tf setup to achieve the aim mentioned above.

My approach was

  1. Get a tf frame setup like:
  2. Given the transform from earth->map, I can find the Pose in map frame for the LLA input.

The px4_config.yaml file was started with a setup like this:

  frame_id: "map"             # origin frame
  child_frame_id: "base_link" # body-fixed frame
  rot_covariance: 99999.0   # covariance for attitude?
  gps_uere: 1.0             # User Equivalent Range Error (UERE) of GPS sensor (m)
  use_relative_alt: true    # use relative altitude for local coordinates
    send: true               # send TF?
    frame_id: "map"  # TF frame_id
    global_frame_id: "earth"  # TF earth frame_id
    child_frame_id: "base_link" # TF child_frame_id

# local_position
  frame_id: "map"
    send: true
    frame_id: "map"
    child_frame_id: "base_link"
    send_fcu: false

Unfortunately, my tf is as shown below,

Can someone please suggest me a solution to this problem ?

Thanks in Advance,
Ashwin Sushil