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 @gclue_akira: 柏の葉で走行させてるjetracerの中身 #instantNeRF #jetracer https://t.co/giVvuE4hP7
Jul 4
DIY Robocars via Twitter
Cool web-based self-driving simulator. Click save when the AI does the right thing https://github.com/pncsoares/self-driving-car
Jul 4
DIY Robocars via Twitter
RT @donkey_car: Human-scale Donkey Car! Hope this makes it to a @diyrobocars race https://www.youtube.com/watch?v=ZMaf031U8jg
Jun 25
DIY Robocars via Twitter
Jun 25
DIY Robocars via Twitter
Jun 16
DIY Robocars via Twitter
RT @GrantEMoe: I won my first @diyrobocars @donkey_car virtual race! Many thanks to @chr1sa @EllerbachMaxime @tawnkramer and everyone who m…
Jun 13
DIY Robocars via Twitter
RT @gclue_akira: JetRacerで自動走行したコースを、InstantNeRFで再構築。データセットは別々に収集 #jetracer #instantNeRT https://t.co/T8zjg3MFyO
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: SPC 3.0 Now the motor also works. This car is doable. I just need to design a deck to mount my compute and sensors. http…
Jun 13
DIY Robocars via Twitter
RT @SmallpixelCar: My new car SPC 3.0. https://t.co/CKtkZOxeNQ
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: High speed at @diyrobocars thanks @EdwardM26321707 for sharing the video https://t.co/o4317Y2U1S
Jun 7
DIY Robocars via Twitter
RT @SmallpixelCar: Today at @RAMS_RC_Club for @diyrobocars. Used @emlid RTK GPS and @adafruit @BoschGlobal IMU. Lap time 28s https://t.co/R…
May 28
DIY Robocars via Twitter
May 15
DIY Robocars via Twitter
May 14
DIY Robocars via Twitter
May 13
DIY Robocars via Twitter
RT @f1tenth: Say hi to our newest #F1TENTH creation for @ieee_ras_icra next week in Philly. It’s going to be huge! 😎 🔥 @AutowareFdn @PennEn…
May 13
DIY Robocars via Twitter
May 11
More…