How can I get drone's position from simulator?

Hi, recently I’m playing with ArduCopter on SITL.

When I set SIM_GPS_DISABLE to 1, SITL showing two drone image, (orange and red maybe).
So I want to know real position of drone from simulator.

Is there any API or Doc about this?

Thank you for reading this.

type watch global_position_int on SITL. It will show GLOBAL_POSITION_INT mavlink message.
And what I don’t understand is - why are you setting SIM_GPS_DISABLE to 1?

I want to test EFK failsafe.
When gps turn off, I cannot trust drone’s calculating position.
so I want to know simulator’s information.

I test your answer and it looks like great :slight_smile:

Thank you for answering.

@shelling In MAVProxy you can use some settings on the map module to show different positions.

Try map set to see what you have available:

AUTO> map set
AUTO>           brightness 1
        loitercircle False
         rallycircle False
        showahrs2pos 0
        showahrs3pos 0
       showclicktime 2
       showdirection False
         showgps2pos 1
          showgpspos 1
          showsimpos 0

“simpos” comes from the mavlink SIMSTATE message, which is the simulated vehicle position (as opposed to GLOBAL_POSITION_INT, which is the vehicle’s best guess as to where it is).

They come up in different colored aircraft, left as an exercise to the reader to memorise which is which :slight_smile:

Thank you for detailed answer.

In your answer, you mentioned two positional values(SIMSTATE and GLOBAL_POSITION_INT).
You said GLOBAL_POSITION_INT is vehicle’s best guess position, so I cannot get simulated position using watch global_position_int, is it right?