Hello,

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.

Thanks.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • Hi,

    I am attempting to do something similar to what you are working on. I purchased a pixhawk and mounted it onto a quadcopter. I've also purchased a Microsoft  Kinect Sensor. My goal is to somehow replace the RC and Receiver with the Kinect and an Xbee. The idea is to use voice and motion commands to control the quad rather than an RC. The kinect will be connected to the Ground station computer and will capture the user's commands. I was thinking of using Xbee for the telemetry link between GCS and the quad. So far the challenge for me is to interface the Kinect with the Pixhawk autopilot. What I mean is, somehow using the data captured by the kinect to trigger modes on the quad such as RTL or motors on, as well as even pilot the quad. Would you have any idea whether this is possible or not?

    Thank you

    • Hi Malek,

      I'm working on a similar project: I want to control my APM with voice commands. But I don't know how to direct control my copter (to do simple things like turn 90 degrees clock wise or turn 180 degrees etc). Did you made some progress with this?

  • Hi Valentin,

    I am trying to get RC_CHANNELS_OVERIDE to work too. What's the correct GCS_ID you used?

    Thanks for your help

  • Hi Valentin,

    Thanks for the information, my sysID seems to be 255, but still doesn't work.

    This is now my code:

            mavlink_rc_channels_override_t rc_override;///Msg to override rc channels
            mavlink_message_t msg_rc;
            rc_override.chan1_raw=1100;
            rc_override.chan2_raw=1100;
            rc_override.chan3_raw=1100;//Lowest throttle
            rc_override.chan4_raw=1100;
            rc_override.chan5_raw=1100;
            rc_override.chan6_raw=1100;
            rc_override.chan7_raw=1100;
            rc_override.chan8_raw=1300;
            rc_override.target_system = 1; // Send command to MAV 001
            rc_override.target_component = 1;//PX_COMP_ID_ALL;
            mavlink_msg_rc_channels_override_encode(systemID, 0, &msg_rc, &rc_override);
            sendMAVLinkMessage(lcm, &msg_rc);


            mavlink_heartbeat_t heartbeat;
            mavlink_message_t msg_heartbeat;
            heartbeat.type = MAV_TYPE_GCS;
            mavlink_msg_heartbeat_encode(systemID, 0, &msg_heartbeat, &heartbeat);
            sendMAVLinkMessage(lcm, &msg_heartbeat);

            usleep(1000000);

    Do you see something wrong or do you know how i can easily see if the message is received correctly ?

    Thanks in advance !

    • Hi Dries,

      everything seems to be right but with those channels values you will not see motors spin. Try this code and tell me if you see something. Also make sure you have the correct message structure, if you have arming message working correctly this will be not the problem.

              mavlink_rc_channels_override_t rc_override;///Msg to override rc channels
              mavlink_message_t msg_rc;
              rc_override.chan1_raw=0;
              rc_override.chan2_raw=0;
              rc_override.chan3_raw=1300; //Low throttle, copter will not flight but you can see motors spin
              rc_override.chan4_raw=0;
              rc_override.chan5_raw=0;
              rc_override.chan6_raw=0;
              rc_override.chan7_raw=0;
              rc_override.chan8_raw=0;
              rc_override.target_system = 1; // Send command to MAV 001
              rc_override.target_component = 1;//PX_COMP_ID_ALL;
              mavlink_msg_rc_channels_override_encode(255, 0, &msg_rc, &rc_override);
              sendMAVLinkMessage(lcm, &msg_rc);


              mavlink_heartbeat_t heartbeat;
              mavlink_message_t msg_heartbeat;
              heartbeat.type = MAV_TYPE_GCS;
              mavlink_msg_heartbeat_encode(255, 0, &msg_heartbeat, &heartbeat);
              sendMAVLinkMessage(lcm, &msg_heartbeat);

              usleep(1000000);

      With "0" values in rc_override channels you don't affect them with your program and release the control of these channels to the RC and with a higher throttle value you can see if your message is being reading by the Ardupilot.

      Kind regards,

      Alexander.

      • Hi Alexander,

        I Found a problem but not yet a solution. I sniffed the serial port with a logic analyzer, and i see that the heartbeat is send, but the override message is not ?! I'm using code from : https://pixhawk.ethz.ch/software/mavconn/start to send the messages... Any suggestion ?

        • Hi Dries,

          I used code from Github:https://github.com/mavlink/c_uart_interface_example. Over this example I made my own code to override the RC control.

          Your problem sounds really weird because you're using the same structure to send both messages, so your program must be sending both messages. I suggest yo to revise your code and make some tests in order to determinate which is the real problem.

          Finally, if you don't find anything and the problem persist, send me a message through this web and I try to help you with some code.

          mavlink/c_uart_interface_example
          Simple MAVLink to UART interface example for *nix systems - mavlink/c_uart_interface_example
          • Hi Alexander,

            i am trying to do exactly same, arm the quadcopter , use rc_override mavlink msg to control it, I have modified c_uart_interface_example and have been sending the rc_override msg at 4hz. I am using jMAVsim simulator to watch behaviour of the quad. The movements of the quad are very random( can't able to figure out). 

            Please help me resolve this problem, Attached herewith are samplecode & simulator log. If possible please share your code so that i can compare the quad behaviour in simulator.

            My emailid: akash.dhamasia12@gmail.com

            samplepgmpx41.cpp

            simulatorlog1.txt

            https://storage.ning.com/topology/rest/1.0/file/get/3702847924?profile=original
          • Hi Alexander, Found the problem. When using mavconn, their is a file called mavconn-bridge-serial.cc with a list of messages that can be send :( I have put my message with message ID 70 in the list and now it works like a charm !

            Thank you for your help.

            • Hi Dries,

              congrats for your discovering and for solving the problem.

This reply was deleted.

Activity

Neville Rodrigues liked Neville Rodrigues's profile
Jun 30
Santiago Perez liked Santiago Perez's profile
Jun 21
More…