Dronekit setup, simulation and visualization on Mission Planner

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
hello everybody this is Tiziano and today we're gonna discuss on how to build a drone program that will allow you to take off go somewhere and land in just a few line of Python. That's right you don't need to know you know involved C language or to dig into why drone fly, you simply don't care! you focus on your added value just imagine how many amazing things you can do if you can give the fact that a drone flies for granted You can do autonomous mission object recognition obstacle avoidance path planning everything without messing with the low-level code that makes a drone actually fly back when I started if you wanted to set up your drone you had to actually physically build your your very own auto pilot, write very low-level code, figuring how to make everything work together in early 2000 though DIY community arose and everybody in the world start working together on this drone code projects and a lot of great software came out from that experience like PX4 stack and Ardupilot and paparazzi and so on and those stacks actually are worth millions and millions of dollar because if you combine the effort or all the DIY community and all the tasks that people put and the effort that people put into this code there's no company could afford it. actually thanks to this effort a lot of professional companies, a lot of commercial companies flourish and actually took vantage of this freely available code to create their own product. Today we're going to set up the environment in our Linux virtual machine and we're going to create the simulator and then we're gonna write down some basic rules that will make our drone take off go, somewhere and land with just a few lines of Python and also we're gonna be available we're gonna be able to see the whole simulation run on ground control station so let's step further and follow me in this tutorial let's switch to the Linux virtual machine. We start off by installing mavproxy, dronekit and dronekit-sitl software in the loop. Then we start our simulator choosing our Latitude and longitude location and a copter as a vehicle and then we start mavproxy that connecting the localhost on TCP port 5760 and sharing the connection to the UDP port 14551 and 14550 then we connect our mission planner to the UDP port 14550 and as you see everything runs like I was connected to my vehicle and we startwriting out a script we import dronekit especially we could we import connect vehicle mode and location global relative and we import time and then we start connecting our vehicle by importing the argparse library that will allow us to pass some argument when we call the script we will use connect as the argument for our connection string dronekit connects using serial or TCP or UDP connection you have just to specify the connection string as an argument okay so we connect with the vehicle and we print connection to the vehicle connect string then we have connect now let's define a function for takeoff and landing so we start calling this function arm and takeoff and we pass the target altitude we first check if the vehicle is armable and if it is then we switch the vehicle mode to guided and then we arm now a vehicle arm is both read and write variable so we can read if the vehicle is armed or we can write true in order to write to arm the vehicle or false in order to disarm a vehicle now we take off and we use the function vehicle simple takeoff passing the target altitude and then we wait for the vehicle to reach the target altitude and we check the altitude using altitude using vehicle location global relative frame altitude and once the altitude is greater than the target altitude then we break this look we now write the main program. So we arm and take off and we pass the altitude ten meters. And then what we want to do is we want to set up the default speed and we set the vehicle air speed or ground speed it doesn't matter because it's a multi rotor and then we want to go to this Waypoint and I'm gonna copy and paste the Waypoint I already set, here so we're gonna assign Waypoint one as a location global relative of this Latitude and longitude here and I'm gonna set 10 meters as altitude and so here now once the system is going to waypoint one you can do pretty much whatever you want but as for me I will just sleep for 30 seconds and I'll come back setting the vehicle to return to lunch mode and then we're gonna wait under 20 seconds and then we close connection and we write vehicle.close and we're good so we we test our system we call our script passing the passing the connection string as localhost port 14551 and as you see the vehicle connects and finds the quad and then initialize the model and then arms and takes off, and once they reach 10 meters it flies to Waypoint 1, it waits 30 seconds and then it will switch to return to launch mode and then it'll disconnect and as you can see our mission planner you can follow the mission as the vehicle was real that wasn't hard at all and imagine how many other things you can do with such a toolkit now that's all for today thanks for watching and see you next time
Info
Channel: Tiziano Fiorenzani
Views: 119,989
Rating: undefined out of 5
Keywords: dronekit, arducopter, missionplanner, mavlink, python, diy, dronekit python tutorial, dronekit python, dronekit simulator, dronekit tutorial, mission planner, mission planner simulation quadcopter, tiziano fiorenzani, dronekit setup, dronekit simulation, program drones, how to program drones, 10 minutes
Id: TFDWs_DG2QY
Channel Id: undefined
Length: 8min 30sec (510 seconds)
Published: Wed Sep 13 2017
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.