I'm trying to make my drone fly to a point autonomously by defining its world coordinates. I have tried all of the different possible messages that I can think off.
My working sequence is ----> drone starts, takes off, switch to guided mode, flies to waypoint, lands and stays there for a while then Returns to launch point. I have the whole sequence working properly and all of the commands have bee tested individually and they work fine EXCEPT for the waypoint one. The drone never flies to the waypoint I define in the code. It does fly to the waypoint if I define it through mission planner but not through my code. I am not sure if I using the wrong messages or what...
I have tried different messages such as, MAV_CMD_NAV_WAYPOINT , MAV_CMD_LOITER_UNLIM and many more. Thus can some one please show me which message would be used to define waypoint for the drone to fly to.