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

DIY Robocars via Twitter
RT @SmallpixelCar: Test my algorithm on real car https://t.co/idWRxcrmuK
yesterday
DIY Robocars via Twitter
RT @breadcentric: Evo is coming to town. If you have an #AWS #DeepRacer, you can purchase an extension pack! https://t.co/w60JwI98Hp #Machi…
yesterday
DIY Robocars via Twitter
https://t.co/bzpbxytpsv
Monday
DIY Drones via Twitter
RT @chr1sa: My talk on PX4 and FAA certification is coming up at 1:45 PST today on the PX4 Dev Summit livestream. Includes some cool new st…
Jul 7
DIY Drones via Twitter
RT @seesharp: I'm tuned into the PX4 / Dronecode free live conference. Great stuff. Microsoft AirSim talk in 10 minutes. https://t.co/0zbZ2…
Jul 6
DIY Robocars via Twitter
RT @masato_ka: 距離センサを3つとESP32を付けたラジコンカーをDonkeyCarライクにNNで自動走行。3層FC極小モデルをTensorFlow Lite for microcontrollerで動かしてる。機体は借り物でRumiCarって言います。Tenso…
Jul 5
DIY Robocars via Twitter
RT @SmallpixelCar: My car was able to go all the way autonomously until the crosswalk. It was only 100 yards from the target. What should b…
Jul 4
Liam left a comment on Agricultural UAVs
"Hi
I'm Liam from T-MOTOR. I would like to reach out to see if there is any possibility for us to work together.
We are a propulsion system manufacturer who offers motors, propellers and ESCs for all kinds of drone applications which vary from secur…"
Jun 30
DIY Robocars via Twitter
RT @SmallpixelCar: Smart move. The car used the shadow to guide it through the bridge. This was never in the training samples. But it learn…
Jun 30
DIY Robocars via Twitter
RT @SmallpixelCar: Getting closer to the target. Single camera. Untrained road. https://t.co/Wsr7RwDamj
Jun 29
Richard Cox left a comment on Australia
"Anyone in the DIYDRONES Australian subgroup based in Alice Springs, NT?
I am experimenting with Ardupilot (standard Arduplane), Pixhawk 4 FC in a 4-ch
RC "AXN Floater Jet" foamy plane..."
Jun 29
Omar Sykes left a comment on Australia
"Hi everyone, I am looking for someone who is good at drone building, repair and software in Adelaide. Please give me a call on 0477 319 219."
Jun 29
DIY Robocars via Twitter
RT @RoboticMasters: #donkeycar https://t.co/czuLoVRcA4
Jun 29
DIY Robocars via Twitter
https://t.co/DKQbNTbz0g
Jun 29
DIY Robocars via Twitter
RT @RoboticMasters: Donkey car, car car car car car car; Donkey car, car car car car car car; Donkey Car. Anyone like our tiny tiny donkey…
Jun 29
DIY Robocars via Twitter
RT @SmallpixelCar: After improving DBSCAN speed, I can get 11 frame per second on @NVIDIAEmbedded Jerson Xavier MAXN mode and the autonomou…
Jun 26
More…