I am trying to create a custom ground station that could take off the Quadcopter when a camera detects a predefined target. Basically, there are a camera, a computer and a Quadcopter. The computer sends MAVLink commands to the APM3.1 and no remote control shall be used.
I am running a C++ program that arms the Quadcopter with MAVLink but I can't manage to make it fly.
I first tried to override remote control with RC_CHANNELS_OVERRIDE MAVLink command but the Quadcopter does not answered to my request. I then tried with MAVLink missions. I succeed in sending mission to the Quadcopter (I can see them with Mission Planner) but when I switch to AUTO mode, nothing happened.
I'm probably missing something but I've been looking around for a while and I didn't manage to find anything. If you've done that kind of things and if you've got some time to spend for a newbie, any help would be warmly welcomed.
I finally managed to use the RC_CHANNELS_OVERRIDE MAVLink command. (I'm ashamed to say that I used a wrong GCS System Id...)
By the way, I am still interessted in knowing why I can't make the motors spin with missions.
I am very interested in how you finally achieve to override the RC channels with your own custom GCS. I am working in a project to remotely control APM using Mavlink commands. It would be great if you could explain me how you program it in C++.
P.S.: When you enter in AUTO mode, there is a security function that force you to send a throttle signal to APM to indicate that you are in the right mode. So, if you enter in AUTO mode and send a throttle signal you should be able to make it works.
You first have to arm the Quad. For that, use the arm mavlink command COMMAND_LONG (#76). Then, simply use the RC_CHANNELS_OVERRIDE (#70).
The thing is to use the correct GCS_ID so that the Quad will recognize you ;-)
Thanks for the tip on AUTO mode, i'll try that.
Thanks for your answer. I will try to use those commands to control APM.
Hi Valentin, can i get more information on how you were able to arm the quad using #76? Also i am trying to use SET_ROLL_PITCH_YAW_THRUST ( #56 ). Currently I am able to request for IMU data but I am still trying to send commands to the quad. Any help/input is highly appreciated. Thank you!
The trick is to use the #76 mavlink command with the MAV_CMD field set to the arm/disarm command (400).
Then send the MAVLink command to your QUAD, using the correct target system / target component.
Good luck !
Thanks for the reply. Based on your post, I was able to find out that command and the 400 with parameter 1 to arm and 0 to disarm.
However, I am still unsure what is the line in code to invoke. With the given library files, mavlink_msg_command_long is not recognized. Can I get some guidance here?
I just started coding in mavlink several weeks ago. Your help is highly appreciated. Thanks!
Hi Valentin, can give some advices on this rc overriding issue? I'm facing the same problem here..... when using RC_CHANNELS_OVERRIDE command in Mavproxy, the quadcopter seems to have no response at all.....i'm using the command " RC all 1000" just to override all the channels in case of emergency thru mavproxy....but somehow it seems to have no effect at all. Appreciate your help thanks. Need it urgently for my final year project T.T
what command are you sending to arm the quad? Whats the exact line? Also, arming the quad will not make the rotors spin. You have to send RC Override command
I am finally able to arm the quad as well as spin the motors ..:) :)
To arm the quad send the COMMAND_LONG message MAV_CMD_COMPONENT_ARM_DISARM with component id MAV_COMP_ID_SYSTEM_CONTROL = 250 and param=1 for arm or param=0 for disarm.
Then the sstem will be armed.
That is great!
Can I get bit more help on this? What is the line to send the message? Should i just have write() or some other mavlink command send function? Your help is highly appreciated!