Takeoff After Landing using Dronekit

Hello,

I am using a Pixhawk 2.1 Cube on Arducopter v3.6.4 with a Raspberry Pi 3 Model B running dronekit scripts. What I want to do is takeoff, go to a point and land there and after some time take off and return to the home location. I tried to run it on SITL but was unsuccessful. The quad takes off and goes to the point and lands. But after landing it disarms the motors and doesn't arm again.

What I did was change the mode from GUIDED to LAND in dronekit. I ran the arm_and_takeoff() function but it just refuses to arm. I interrupt the script and then run the code again and it flies as usual but doesn't arm and takeoff once it lands.

Is there anyway to overcome this problem?

Thank you.

Regards

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

Join diydrones

Email me when people reply –

Replies

  • Hello,

    Thank you for the reply and help.

    I don't think I need to dive into the arducopter or px4 firmware to takeoff after landing automatically. I wanted to use the python script keeping the parameters of the pixhawk to fairly default values.

    I did find a way but it is not the prettiest solution. I changed the name of the vehicle variable in dronekit and essentially connected the drone again to take it off after landing.

    So what I am doing in the script is connecting the "Drone" via the AMA0 port and running the mission and landing the "Drone". Then to takeoff again I changed the name to "Drone1" and connected and ran the arm_and_takeoff command again, then ran the mission and then landed.

    If I didn't change the name and just reconnected it, it did takeoff after landing but didn't land the second time.

    If there is a better way to do this I would love to know. Right now this is what works for me on SITL and actual testing as well.

    Regards,

    Sohaib 


    Alberto Vila said:

     But to perform that particular action would be enough to 
    modify the pixhawk software,with the modification that you
    saw. And then you could continue communicating through
    Takeoff After Landing using Dronekit
    Hello, I am using a Pixhawk 2.1 Cube on Arducopter v3.6.4 with a Raspberry Pi 3 Model B running dronekit scripts. What I want to do is takeoff, go t…
  •  But to perform that particular action would be enough to 
    modify the pixhawk software,with the modification that you
    saw. And then you could continue communicating through
    scripts with the main board, or not?



    Sohaib Ahmed said:

    Hello,

    Thank you for the reply,

    I looked into the threads you linked but I don't think they will work for me. I am trying to run it on dronekit whereas I think these are for setting waypoints through mission planner or some other ground control software. I tried to replicate it on SITL and used AUTO and RTL modes but I had to change to GUIDED for it to take inputs from the python script. And again once it landed and disarmed, it didn't take off. 

    I will contact the person you mentioned to ask more about this topic.

    Thank you for the help. I really appreciate it.

    Regards



    Alberto Vila said:

    O, THERE IT IS,

    https://github.com/ArduPilot/ardupilot/pull/6914

    that the solution to this

    Takeoff After Landing using Dronekit
    Hello, I am using a Pixhawk 2.1 Cube on Arducopter v3.6.4 with a Raspberry Pi 3 Model B running dronekit scripts. What I want to do is takeoff, go t…
  • Hello,

    Thank you for the reply,

    I looked into the threads you linked but I don't think they will work for me. I am trying to run it on dronekit whereas I think these are for setting waypoints through mission planner or some other ground control software. I tried to replicate it on SITL and used AUTO and RTL modes but I had to change to GUIDED for it to take inputs from the python script. And again once it landed and disarmed, it didn't take off. 

    I will contact the person you mentioned to ask more about this topic.

    Thank you for the help. I really appreciate it.

    Regards



    Alberto Vila said:

    O, THERE IT IS,

    https://github.com/ArduPilot/ardupilot/pull/6914

    that the solution to this

    Takeoff After Landing using Dronekit
    Hello, I am using a Pixhawk 2.1 Cube on Arducopter v3.6.4 with a Raspberry Pi 3 Model B running dronekit scripts. What I want to do is takeoff, go t…
  • O, THERE IT IS,

    https://github.com/ArduPilot/ardupilot/pull/6914

    that the solution to this

    Copter: stop disarming as part of running rtl as mission item by peterbarker · Pull Request #6914 ·…
    Fixed #6324 Note that the land-as-mission-item code is duplicated from the rtl-as-mode code but omits the disarm part, so doesn't suffer from the sam…
  • I saw that solution on github but now i cant found it, dont know why.

    To allow land functions inside auto, its a solved question, but now i cant found that ,

  • you ned to ask this guy, because there is already a solution for this

    https://github.com/peterbarker?tab=repositories

    peterbarker - Overview
    peterbarker has 44 repositories available. Follow their code on GitHub.
  • of course is a way : try this to me worked,

    https://github.com/ArduPilot/ardupilot/pull/7402

    read this:

    https://discuss.ardupilot.org/t/flight-mode-changue-failed-copter3-...

    an this allows you to continue withmission arter takeof when in you are in auto mode so yo can do,

    Auto

    takeof

    move

    land

    delay

    takeoff

    move to the next waypoint

    Copter: split init() into ok_to_enter and enter() by peterbarker · Pull Request #7402 · ArduPilot/a…
    This change allows the base mode object to do some checks for the derived classes. It also ensures we either don't play with the controllers or s…
This reply was deleted.

Activity