Hi,
I push some waypoints throug the “/mavros/mission/push” service. But the mode can’t be set to AUTO.MISSION without running the QGC. Do you know how to deal with it?
Thank you very much!
yes, I think the vehicle has a valid position. I test my code in SITL.( I try to set the mode to AUTO.TAKEOFF and it works.) If I set the mode to AUTO.MISSION through the mavros_msgs/SetMode.srv without running QGC, the mode will be changed to AUTO.RTL and can’t start the mission. If the QGC is running, it works.
I don’t have a good understanding of the flight mode setting. What are the requirements to set the mode to AUTO.MISSION without running the QGC? Can you give me some advice?
Thanks for your reply.
Hi,@dagar update:
Through the just study, I understand why the mode is set to AUTO.RTL.
In my humble opinion, when I try to set the mode to AUTO.MISSION by “/mavros/set_mode” service, the “set_data_link_loss_nav_state” function will be called due to the data link loss enabled. Then the function will set the mode to AUTO.RTL because the "link_loss_act " is equal to “link_loss_actions_t::AUTO.RTL”.
But I’m confused where to set the “data_link_loss_act” parameter in “set_nav_state” function. Is it related to “NAV_DLL_ACT”? I try to change the value but it doesn’t work.
I try to set the mode to AUTO.MISSION forcibly as shown below. It works but I think it’s not a good way. So can you give me some advice? Is there a better way to set the mode to AUTO.MISSION and start the mission without running the QGC?