Stop Mission MAV_CMD_OVERRIDE_GOTO

Hi,
I’m some problem with this command.

For first i will explain the goal.

In QGC I have set the mission to do but I would to stop the mission and set the flight mode in HOLD mode by an external command.

I’m trying to use MAV_CMD_OVERRIDE_GOTO or MAV_CMD_NAV_LOITER_UNLIM with this parameter:
msglong.command=MAV_CMD_NAV_LOITER_UNLIM;
msglong.param3=0;
msglong.param4=0;
msglong.param5=0;
msglong.param6=0;
msglong.param7=0;

mavlink_msg_command_long_encode(255,MAV_COMP_ID_ONBOARD_COMPUTER , &msg, &msglong);

msglong.command= MAV_CMD_OVERRIDE_GOTO;
msglong.param1=MAV_GOTO_DO_HOLD;
msglong.param2=MAV_GOTO_HOLD_AT_CURRENT_POSITION;
msglong.param3=MAV_FRAME_GLOBAL;
msglong.param4=0;
msglong.param5=0;
msglong.param6=0;
msglong.param7=0;
mavlink_msg_command_long_encode(255,MAV_COMP_ID_ONBOARD_COMPUTER , &msg, &msglong);

This message does not work. I Have tested my code with MAV_CMD_NAV_LAND and work as well.
Have you some advice to give me?

thank you.

1 Like

Hi~ You setting to current mode must into Guide mode and then mission can be well

Are you have tried?
Can you tell me you succeed or fail ?

I’m not working on this project now. By the way I turned the Mav on guided mode (offboard) and tried some command that working well on simulation. Now have to go to integrate my application on real Mav. I’ll update you soon