ArduPilot, Dronekit-SITL, and Mission Planner Drone Simulation Installation and Introduction

  Рет қаралды 24,809

PatchNFielder

PatchNFielder

Күн бұрын

Get your simulated drone up and running with the simple go to script in under 10 min.
Since I had such a difficult time getting the SITL simulation running without issues I thought I'd make this video so that everything you need to get started simulating UAVs would be in one place. This tutorial is specifically for people with Windows installed who also have the Ubuntu on Windows app or a Bash Shell installed.
Make sure you have Python 3.6 or 3.7 installed on your windows machine with it added to the PATH. There are plenty of tutorials for this so I won't cover it.
Also make sure you've got your Bash shell or Ubuntu updated all the way with the following, answer 'y' to the prompt:
sudo apt-get update && sudo apt-get upgrade
Mission Planner:
ardupilot.org/...
Packages to Install:
pip install dronekit dronekit-sitl mavproxy
Open First Terminal
dronekit-sitl copter --home=53.280707,-9.031534,0,180
(The GPS coordinates here are different than in the video, it doesn't matter. Pick your favorite location :) Just be sure to update the python file with the coordinates
that you intend to travel to from the home coordinates specified)
Helpful Links:
dronekit-pytho...
dronekit-pytho...
Open Second Terminal
mavproxy.py --master tcp:127.0.0.1:5760 --sitl 127.0.0.1:5501 --out 127.0.0.1:14550 --out 127.0.0.1:14551 --out 127.0.0.1:14552
(When it asks for the port in Mission Planner make sure it's 14552)
Bash Shell Command:
sudo python drone.py --connect udp:127.0.0.1:14550

Пікірлер: 58
@tankaichuen1258
@tankaichuen1258 4 жыл бұрын
Thank you for the video. I am having the same problem on disarming itself after a few second of arming and couldn't takeoff. I will try your method to solve it to check whether it works.
@PankajMali
@PankajMali 3 жыл бұрын
this is because of the cmd nav failure
@angelleal3005
@angelleal3005 3 жыл бұрын
so it works after you tried his way ?
@sagarsajeev4768
@sagarsajeev4768 3 жыл бұрын
* If you’re using the DroneKit-SITL Python API then you will instead have to connect to SITLs TCP port. So if DroneKit is connecting to TCP port 5760, you would connect your GCS to 5763 * Essentially, this way can also be done rather connecting to UDP ports, we can utilise the MavLink for sending messages through Script to reflect on Mission Planner - which can be connected to port 5763
@MUBEENAHAMEDKABIRRIBAYEE
@MUBEENAHAMEDKABIRRIBAYEE 9 ай бұрын
I know it's been 3 years, but can you explain this to me? I'm tryna do something similar for my thesis
@gianfrancodelgiudice4926
@gianfrancodelgiudice4926 2 жыл бұрын
Hello. Does anyone know why can't i change the flight mode manually in the mavproxy terminal or via python code? It only works if I do it in the "Actions" tab in mission planner
@tankaichuen1258
@tankaichuen1258 4 жыл бұрын
Hi Need some help I have been trying to connect to SITL the connection gets established but as soon as is try to arm the vehicle with vehicle.armed = True command Error : autopilot ARMING MOTOTS CRITICAL: Ground Start CRITICAL : Initializing APM Error : autopilot DISARMING MOTORS am not able to figure out the reason
@thianesh9097
@thianesh9097 4 жыл бұрын
I have the same issue
@tankaichuen1258
@tankaichuen1258 4 жыл бұрын
@@thianesh9097 I found the problem. The VehicleMode("GUIDED") from the script is not working. Therefore, I changed the mode manually in Mission Planner to takeoff, and it works with the script after changing the mode. However, I still cannot change to other modes like GUIDED, LAND, AUTO, RTL, and STABILIZE with my python script.
@thianesh9097
@thianesh9097 4 жыл бұрын
@@tankaichuen1258 Thank you for your reply. The script worked after changing it to guided mode using Mission Planner but, as you said the script was unable to change the mode on its own
@brcisna
@brcisna 4 жыл бұрын
@@tankaichuen1258 Were is this setting in Mission planner? Cannot find "GUIDED mode'? New to Dronekit/MissionPlanner. Edit: After looking further I found "Flight Modes" I have no 'takeoff' mode? I am using a compiled version of APM Planner 2.x Linux. I do have guided mode. In the terminal repeats 'Waiting for the drone to enter GUIDED mode' I do have guided mode selected. Thank You
@PankajMali
@PankajMali 3 жыл бұрын
Actually the problem is mavlink , i dont know what i can call it as a bug or something but the latest version of mavlink has that error, so what i did was like reverting back installed freshly pip install pymavlink==2.4.8 n it works now , in your case the error is due to navigation command failure so you can revert back to previous version...hope it helps you.
@shree4641
@shree4641 2 жыл бұрын
what are the backup checks you have put in the simple_goto file because I'm getting this Error - ERROR:autopilot:DISARMING MOTORS. If possible can share share the updated file/link to the file. This worked for me - Set your vehicle mode to STABILIZE (or any other armable mode). Run your python script. Immediately change your vehicle mode manually to GUIDED. Your vehicle should perform your script commands if correct.
@oussamabaroty5506
@oussamabaroty5506 Жыл бұрын
i have no connection btw mission planner and SITL PLS HELP ME
@scientia2680
@scientia2680 2 жыл бұрын
I wanna know how did you do for launching the windows acedwards please...
@sagarsajeev4768
@sagarsajeev4768 3 жыл бұрын
mode_mapping = self.master.mode_mapping() AttributeError: 'NoneType' object has no attribute 'mode_mapping' Can someone help me out?
@AkshayCuddapah
@AkshayCuddapah 3 жыл бұрын
Thank you. copter simulation is successful. But, I have problem with SITL plane (after second terminal commands there is no response, its not connecting to MP & MAVproxy: no link). can you please help me.
@PatchNFielder
@PatchNFielder 3 жыл бұрын
If you have trouble connecting to the MAVproxy usually there is something wrong with the port you're trying to use as the "fake" drone. All in all I haven't touched the system in years, but I do remember it has always been super buggy. If you forget about best coding practices and just mess with it until it works, that's what I've found to be the best solution.
@jigarpatel7943
@jigarpatel7943 2 жыл бұрын
how to update baud rate in simple_go file
@Vaishnavi-w4i
@Vaishnavi-w4i Жыл бұрын
where is the link for the code
@ihebchiha9205
@ihebchiha9205 3 жыл бұрын
hello, after writing a dronekit code and sending it to the drone, I run the code, everything is ok, but while the drone is going to the next waypoint, the altitude is not stable. I am using the simple_go function, and I mentioned the altitude. what could be the problem causing this variation of altitude.
@kaanvural2920
@kaanvural2920 3 жыл бұрын
It's about the pitch movement of drone. When drone wants to go somewhere it's altitude has to be decrease because it has to bend it's nose forward.
@troonsk
@troonsk 4 жыл бұрын
You saved my day sir, thanks a lot. One thing that I encounter was that I had to change to Guided mode manually :)
@XPowerfullXPlayerX
@XPowerfullXPlayerX 3 жыл бұрын
did you solve that?
@PappuYadav-tn7lu
@PappuYadav-tn7lu 3 жыл бұрын
@@XPowerfullXPlayerX All you have to do is on Mission Planner's "Action" tab, choose Set Mode = Guided. And then run your simple_goto.py script.
@entertainmenthub6879
@entertainmenthub6879 3 жыл бұрын
It is solved by downgrading pymavlink to 2.4.8
@PatchNFielder
@PatchNFielder 2 жыл бұрын
Yes, the more I hear about this software the more it’s stuck in time using older versions.
@shree4641
@shree4641 2 жыл бұрын
Even if I manually changed the action to guided mode, still it didn't work for me.
@yahya9889
@yahya9889 4 жыл бұрын
pip doesnt work anymore? this is frustrating im trying pip3 but its not working either
@angelleal3005
@angelleal3005 3 жыл бұрын
It really doesn't work. What a pitty.
@PappuYadav-tn7lu
@PappuYadav-tn7lu 3 жыл бұрын
My recommendation would be to install Anaconda and open terminal from an environment in Navigator. From there everything like pip should work.
@tvstanuj6196
@tvstanuj6196 4 жыл бұрын
will it work it with python 3.....but it was given in the dronekit website that... it does not support python 3
@PankajMali
@PankajMali 3 жыл бұрын
yes it wont
@charithdilshan7791
@charithdilshan7791 3 жыл бұрын
It will work. The web site is not updated, but it actually works.
@PankajMali
@PankajMali 3 жыл бұрын
@@charithdilshan7791 yes it works but you need to very carefully work with that while choosing packages which works in both py2 and py3
@charithdilshan7791
@charithdilshan7791 3 жыл бұрын
@@PankajMali agree
@PappuYadav-tn7lu
@PappuYadav-tn7lu 3 жыл бұрын
It does work for me at least including Python 3.8
@ctaylo28
@ctaylo28 2 жыл бұрын
Andrew I followed your tutorial but when I check my dronekit import libraries in my windows terminal, i get error like: PS C:\Users\cecil> python Python 3.10.1 (tags/v3.10.1:2cd268a, Dec 6 2021, 19:10:37) [MSC v.1929 64 bit (AMD64)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> import dronekit Traceback (most recent call last): File "", line 1, in File "C:\Users\cecil\AppData\Local\Programs\Python\Python310\lib\site-packages\dronekit\__init__.py", line 2689, in class Parameters(collections.MutableMapping, HasObservers): AttributeError: module 'collections' has no attribute 'MutableMapping' What shall I do? My Windows has python3.10.1 installed. Can you help please. Thank you.
@PatchNFielder
@PatchNFielder 2 жыл бұрын
Might just be that package has an issue, I would search google and see if there’s another dependency you might need.
@PatchNFielder
@PatchNFielder 2 жыл бұрын
The longer response would be, I haven’t touched this module for like a year, but what it seems like is a dependency problem because of an old python version. I think I’m using python 3.7 in the video. But regardless, make sure the distinction is made between mavproxy and ardupilot. The script you write to tell the drone where to go is in python 3, but the OG mavproxy software is in python 2. If it wouldn’t disturb your other projects I would suggest maybe creating a dev environment and trying the python 3.7 version on windows and go through the package install part of the video again. The only way I got this software to work at all was using the setup I had in the video.
@ctaylo28
@ctaylo28 2 жыл бұрын
Luckily, it worked when I uninstall python3.10.1 then reinstall python3.9 -import dronekit is fine. But then went into another problem when I pull a 2nd terminal and call > dronekit-sitl copter --home=53.280707,-9.031534,0,180 Below is result: PS C:\Users\cecil> dronekit-sitl copter --home=53.280707,-9.031534,0,180 dronekit-sitl : The term 'dronekit-sitl' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct and try again. At line:1 char:1 + dronekit-sitl copter --home=53.280707,-9.031534,0,180 + ~~~~~~~~~~~~~ + CategoryInfo : ObjectNotFound: (dronekit-sitl:String) [], CommandNotFoundException + FullyQualifiedErrorId : CommandNotFoundException How come that unrecognised..? I install all that dependencies for dronekit in the powershell cmd terminal. Can u suggest another tip pls.. My PC running in windows10 with ubuntu20.04 on the side app.
@PatchNFielder
@PatchNFielder 2 жыл бұрын
Make sure you added python 3.9 to your PATH in windows. That maybe why the command isn’t recognized
@yossipz
@yossipz Жыл бұрын
I followed your instructions exactly but for some reason I can't solve this problem drive.google.com/file/d/1J-pmjvXiEdpmUn4vEZ-PWpiyu45IKOgv/view?usp=sharing Do you have any idea what the problem is?
@siou3268
@siou3268 3 жыл бұрын
Excellent video. Do you have any email? I need your help.
@PatchNFielder
@PatchNFielder 2 жыл бұрын
If you post your problem here you’re going to be able to get help from people who are using the software more readily. I haven’t touched this since I put the video up
Dronekit setup, simulation and visualization on Mission Planner
8:31
Tiziano Fiorenzani
Рет қаралды 123 М.
规则,在门里生存,出来~死亡
00:33
落魄的王子
Рет қаралды 25 МЛН
Life hack 😂 Watermelon magic box! #shorts by Leisi Crazy
00:17
Leisi Crazy
Рет қаралды 10 МЛН
How To Get Married:   #short
00:22
Jin and Hattie
Рет қаралды 23 МЛН
Mission Planner Part 1 - Introduction
17:28
Linn Aerospace
Рет қаралды 226 М.
When you Accidentally Compromise every CPU on Earth
15:59
Daniel Boctor
Рет қаралды 829 М.
Ardupilot Series: SITL installation and Controlling ArduCopter
13:55
The most important Python script I ever wrote
19:58
John Watson Rooney
Рет қаралды 199 М.
Drone Programming Libraries 2021
9:32
Intelligent Quads
Рет қаралды 20 М.
规则,在门里生存,出来~死亡
00:33
落魄的王子
Рет қаралды 25 МЛН