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 diydrones2 to add comments!

Join diydrones2

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

Jørn Ramnæs liked VIDEO LINK's profile
6 hours ago
Mark Harrison left a comment on Moderators
"Wow, Ning2 looks really great on mobile. I had sort of drifted away as my browse-time went more on my phone, so this is great."
12 hours ago
Hank Deucker left a comment on PIXHAWK
"I am sure most will say not again, Pixhawk telemetry. I do need help and all can be reassured that I have spent many hours scouring the net for useful information. I am not new at quadcopter flying, I started in 2012 and have progressed through many…"
13 hours ago
DIY Robocars via Twitter
https://t.co/rLmFr8M2UK
17 hours ago
Hank Deucker left a comment on PIXHAWK
"Tomorrow, I am thinking about the wording at the moment."
yesterday
DIY Drones via Twitter
Welcome to the new DIY Drones design!. You may have noticed that DIY Drones looks a little different today. That's… https://t.co/cg2EmeDGMQ
yesterday
DIY Drones via Twitter
New! Online Training on Drones for Disaster Response https://t.co/brqRuujjY2
Tuesday
DIY Robocars via Twitter
https://t.co/8EMCvYW6oz
Tuesday
DIY Robocars via Twitter
RT @OttawaAVGroup: We are going to try something new this week. We will be having a drop-in style meeting Wednesday @ 7-9pm EST. Pop in and…
Monday
DIY Robocars via Twitter
RT @tawnkramer: Thanks Everyone for another fun virtual race! Amazing Ai racers competing head-to-head, Virtual Makers Fair event. Catch us…
Sunday
DIY Robocars via Twitter
RT @make: Find out the latest from @diyrobocars at 10am PT from @chr1sa of @3DRobotics on Virtually Make Faire! #makerfaire #maketogether #…
Saturday
DIY Robocars via Twitter
RT @Heavy02011: Join us Saturday online: Virtual Race League: @DIYRobocars Race #2 - Parking Lot Nerds https://t.co/aJUu4sdutx #Meetup via…
May 22
DIY Robocars via Twitter
RT @donkey_car: Yay, we are part of the virtual @makerfaire with @diyrobocars. Come see our race or better yet train a model and race with…
May 21
DIY Robocars via Twitter
RT @chr1sa: The @DIYRobocars Virtual AI Race is going to be part of the virtual @makerfaire on Sat! https://t.co/wnMDAboLID
May 20
DIY Robocars via Twitter
RT @tawnkramer: Please join us next week for our second DIYRobocars online race. We will be using a new Mountain Track course! https://t.co…
May 19
DIY Robocars via Twitter
RT @SmallpixelCar: I realized that the size of the cones in @diyrobocars is known. If we can detect the bounding box, which can be done wit…
May 19
More…