Connecting Raspberry pi with Pixhawk | Get Started to run your Python code | Step by Step Guide

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
[Music] hey guys hope you all are doing well today i'm going to connect a raspberry pi to my big stock light controller base drone so that i can increase the computational power of my drone and doing this i can work on opencv libraries and i can install robot operating system and build cool applications so let's see before going for some actual connection i would like to add that if you're a beginner and if you want to do or add onboard computer to your drone then i would recommend to go with a standard frame idea frames like the f450 s500 f550 or dbs discovery frame so if you are having any problem with your core or anything that could go wrong then you won't be at much loss so there's one more drone that i'm going to use for this project so this is custom built carbon fiber and some three printed parts so uh the drag thing here it's 3d printer here you have the gps and telemetry the safety switch and all the kind of things that you need to have when you get started with pixel so i will take this thing out so so here you can see that we have a pixel flight controller along with all the electronics uh connected to it here i'm going to use raspberry pi 3b model as my onboard companion computer the connections are simple you can follow the documentation for reference on the pixel you can see telemetry 1 and telemetry 2 potential 1 port is connected to the 915 megahertz telemetry model of the pixel and telemetry to port we are going to use this to connect with the raspberry pi for serial communication this reveal communication uh takes place over the ur protocol so your protocol is slightly different than i to cn spi protocol in itus and spi protocol you need a system clock along which the data packets are sent but in your protocol you don't need a system clock the packets data packets are signed with the start and stop bit so that the receiving your port knows when to start and stop the counting just confirm that the connections that you have done are similar to the connections shown here and if they're okay then we'll just move on with the next step before powering it up take out all the propellers and for the demonstration purpose i have kept the raspberry pi outside and this is the connector to which i'm connected uh to the telematic 2 port and i'll power it up so you can see that i'm powering the raspberry pi from the telemetry 2 port [Music] now let's do some settings in the configurations [Music] now i can access my raspberry pi or ssh from my ubuntu machine and both raspberry pi and my laptop are connected to the same network for the same router now we need to get into terminal and ssh by address your ip address of the raspberry pi [Music] enter your password and here we are into the raspberry pi and before this we need to do some configuration settings into a mission planner for that we can uh follow the autopilot documentation for reference so you need to do this settings here you need to check that the serial 2 protocol that should be set to 2 serial 2 ball that should be 9 to 1 that's the ball grid over which the pixel and the raspberry pi will communicate and log back in type that should be 3. uh this thing will need into the future while streaming the data flash log and once you are done with the mission planner thing you need to write the parameters and uh back uh to the ssh now we'll go into the mac proxy documentation we need to install some python dependencies and my proxy and map link for that i'm using your python 2 for that you can copy this and here we can install them before that we'll do [Music] so once you have updated your browser file uh you can paste that comma [Music] so i have all the uh latest versions of the packages now next thing is we need to install a map link for that we need to enter the command sudo clip install pi map link [Music] so i have already uh the latest version of uh map link now sudo click [Music] install mac proxy [Music] so here we have done the installation as i have already all the packages installed you might take some time for the installation after this we need to enable the serial hardware port on our raspberry pi and the serial console should be disabled for that will get in the configuration solo trust my iphone config and you need to get into in interfacing option and in that you need to get into serial and would you like to login shell to the accessible or serial so you need to select no and would you like the serial port hardware to be enabled yes okay so now you can uh reboot your pc for that after rebooting in the raspberry pi i have connected it or ssx and the next setting that i'm going to do is very important because most of the time people fail to figure out that thing and even i didn't figure out for the first time when i was doing that and it took me about a week to configure the settings for that we can follow the ui documentation of raspberry pi so raspberry pi one two three they have uh two us that is you are drawing uart one and raspberry pi four has six uarts so we will talk about gas bit by three in raspberry pi 3 dur 0 is already assigned to bluetooth so this means that whenever we'll try to access the serial of uart this bluetooth will try to conflict and it won't means allow us to access the uart0 so for that we need to disable this thing and to disable this thing we need to edit the config.txt file for that we'll get in the file that is nano space [Music] slash config dot txt [Music] will get to the end of the file [Music] here uh the the first thing is enable uh hyphen ur that was already zero by default and i have made it one because i wanted to enable the output and the next line that is dt overlay equals to pi 3 hyphen disable hyphen vt this line is important because we need to disable the bluetooth if you are having pi 2 or pi 4 you just need to change that by 3 and after doing this you can save the file and accept now we will check the list of the tty ports because we need to know on which port we are going to connect for that ls let me [Music] slash dave tty start and here we are so uh we will have the focus on this tty ama0 and dty as zero for raspberry pi 3 mostly dty am a0 is used so you just note it down [Music] now we'll move to the final step so that we can have the connection between the raspberry pi and the pixel for that you need to enter as root user and here we are so uh this is the command that we uh we need to establish the connection that is my proxy dot pi iphone iphone master and slash dave slash dty ama0 so this tty ama0 is a port on which we are going to establish the connection and portrait that is 921600 and uh if you can remember then we have done deciding in the mission planner and set the baud rate uh to nine to one and here the aircraft is my copter so if you are having uh a auto plane or auto submarine then you can just change this so i am having your copter or you can give any name according to your convenience and when i hit enter i will get all the details of the aircraft so here uh the mode is stabilized and i've got gps lock and i've got the autocopter firmware version gbos fmu v2 and the frame so you'll get all the uh information of your drone here and now if i'm using my transmitter and changing the mode then then we can see that or if i want to check the modes so these are all the available mode or if i want to change the mode that is i want to change the mode so now the mode is land so we can control the drone from here [Music] here i have successfully established connection between the raspberry pi and pixel and i've got all the parameters from the raspberry pi here on the screen so these are the map link messages that i'm getting here and i can access my drone right from here without even touching the transmitter i can change the mode and i can change anymore if you are using a transmitter you are just limited with the modes but from here i can change anymore at any time and in the next videos i will write some python scripts to autonomously control our tool like we can autonomously take off and land we can use the camera and we can do some precision lining or we can just write code in that will autonomously get to the waypoints and we can do many things so if you are having any problem in establishing the connection so just comment down below
Info
Channel: Pankaj Mali
Views: 29,344
Rating: undefined out of 5
Keywords: pixhawk, raspberrypi, raspberrypi3b, raspberrypi4, robot, robotics, arduino, autonomous, arducopter, ardupilot, drones, quadcopter, diy, swarm, swarmrobotics, missionplanner, precisionlanding, opencv, computervision, pythonprogramming, python, programming, intel, dji, gopro, dronekit, dronekitsitl, gazebo, ros, raspberrypidrone, pi drone, customdrone, frsky, taranis, flight controller, apm, pi camera, pankaj mali, pankaj mali drone, python program
Id: BSDST7ePOtM
Channel Id: undefined
Length: 12min 32sec (752 seconds)
Published: Sat Sep 19 2020
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.