Hi, im trying to send guided waypoint using serial port and arduino, i’m using mavlink_msg_set_mode_pack(sysid, compid, &msg, tagsys,1,4); (4 Guided mode)
it work fine when it’s disarmed, but when i arm my Quad the command do not work any more when i see log file i found this error ERR, 153446941, 10, 4, i can see that time= 153446941, quad = 10 and commande = 4 Guided cause an error but why/how i don’t figure out.
Thanks for the replay Mike. I forget to mention that i test it when i have gps 3D Lock and i can switch to guided when armed using GCS.
I change the base_mode in the command 137, the new command is mavlink_msg_set_mode_pack(sysid, compid, &msg, tagsys,137,4); and it switch to Guided mode but it disarm in few second i think it’s a problem of message_send freq.
Can you please share you code? it will be helpfull.
My could switches to Guided from Position Hold mode. The code reads Mavlink data from one copter and based on Altitude changes sends that data to the other copter. Eventually I was going to have the one copter follow the other based on GPS changes. I haven’t got that far.
I think once you switch to Guided mode you have 30 seconds to get off the ground or it just shuts down. You also need to be sending Heart beat packets or it will assume you are no longer under GCS control.
In any case I switch modes in mid flight after I position the two copter where I need them to be and trigger the switch with one of the channels on my radio.
You’r right i test it today and it switch to guided mode prefectly but it disam in few second even when i switch to guided mode using GCS. (altitude error i guess)
I will add sending heartbeat in my code and will test it in filght (hope it will not crash ). Will tell you about it.
I test it today and it works
Now i’m surching how to do the same funtion as "Follow me " to direct the drone from me (left right, over or behind me).
So what i’m doing is: (if some one need it one day)
send heartbeat
mavlink_msg_set_mode_pack(sysid, compid, &msg, tagsys,1,4)
and i use for guided waypoint
mavlink_msg_mission_item_pack(,2,)