In flight - setting flight mode auto

Hi There,

I have set up a mission according to the following protocol:

I have successfully upload the request item to the EEPROM

mavlink_mission_item_int_t packet;
memset(&packet, 0, sizeof(packet)); // Clear structure to be safe.
packet.target_system    = vehicle_id;
packet.target_component = autopilot_id;
packet.x                = m_missionPoints[index].lat;
packet.y                = m_missionPoints[index].lon;
packet.z                = m_missionPoints[index].alt;
packet.command          = MAV_CMD_NAV_WAYPOINT;
packet.seq              = index;
packet.param1           = 0;
packet.param2           = 0;
packet.param3           = 0;
packet.param4           = 0;
packet.frame            = MAV_FRAME_GLOBAL;
packet.autocontinue     = 0;
packet.current          = 0;

however, when setting the flight mode to AUTO while in flight the drone changes direction and seem to be flying towards (0,0) position…

any ideas?

Thanks,
Ron

Did you start with a takeoff command ?

Did you tested it on the SITL ?

Does some failsafe get triggered ?

Did you start with a takeoff command ? - take off success

Did you tested it on the SITL ? - indeed

Does some failsafe get triggered ? - i don’t think so, i’ll look it up

Thanks

In regards to - Did you start with a takeoff command ?

is it mandatory to start every mission with takeoff even though i’m in the air?

yes, it is good policy.

Thanks, I’ll try it out and let you know of the outcome :slight_smile:

update it seems that I had an issue with the GPS coordinates not being in the right format - thanks @amilcarlucas for trying to help out