moving on to investigate autonomous flight using missionPlanner and MATLAB.
The main advantage of the unmanned aerial vehicles lies in the fact that drones can go to places that are hard to reach for humans or vehicles, such as high-rise buildings, narrow streets, obstructed roads, etc.But the most important upshot of drones is probably that they can limit the face-to-face contact thereby reducing the chances of contamination with the new virus. By replacing mundane tasks, performed by humans, they could also prove to be a time and labour-saving solutions.Drones can carry cameras, loudspeakers or even small items of first necessity, like groceries, medicines, disinfection products and why not even documents to be signed.
The part list are written above or follow the instructions for additional information on the parts needed, But make sure you have all as follows:
A frame
PDB
Motors x4
Propellers x4
ESC x4
A flight controller
GPS/GNSS antenna &.power module
Raspberry Pi 3B
Transmitter
Batteries
Battery chargers
Banana connector
Micro SD card
WiFi router
Standoffs/spacers.
Make sure you have all listed parts but for a completed & detailed part I recommend the hovergames kit for a successful build.
HARDWAREHARDWARE
Hardware and Building Phase:Assemble the F450 quadrotor frame and the printed battery casing in the middle (make sure to add the M2.5*5mm spacers)
Attach the motors to the frame.
Solder the banana connectors to the ESCs and motors wires.
Solder the ESCs and the power module to the PDB. Note: Make sure not to use the 5V output of the PDB (it will not provide enough power).
Add the first laser cut layer to the top of the F450 frame using M2.5*10mm male-female spacers; and attach the PDB and power module to this layer. Note: make sure to place the components such that the wires are long enough reach to all of the motors.
Connect the ESCs to the motors and use zip ties to secure the wires on to the frame.Attach the flight controller to the Raspberry Pi and place it in the printed casing.Add the second laser cut layer on top of the first layer and attach the Raspberry casing using double sided sticky pads.
The GPS can be glued on top of the casing, however here it has been placed on another third layer that goes on top of the flight controller casing as shown in the pictures, but it is entirely up to the person who is building it. Then simply connect the GPS to the flight controller.
Fix the receiver on top of the second layer using double sided sticky pads. Connect the ESCs and receiver wires to the flight controller pins. The receiver occupies the first column of pins and then the motors occupy the next four columns. Note: The front of the drone is determined by which motor is attached first. Whichever front direction you choose make sure that the motors are connected in the picture at the start of this step.
Add propellers. It is advised to leave the propellers to the very end i.e. after finishing the software section and always make sure you take safety precautions when the propellers are on just in case things go wrong.
SOFTWARE
Get the latest Emlid Raspbian Image from NXP docs.Download, extract and run Etcher with administrator rights.Select the archive file with image and sd card drive letter.Click “Flash!”. The process may take a few minutes.
FIRST TIME SETUP
Install Mission Planner and move to the First Time Setup section.
Follow this step to connect your UAV follow this procedure:
To
To connect to your UAV follow this procedure:To connect to your UAV follow this procedure:Run both your MAVProxy.bat file, and Mission Planner.Connect the battery to your UAV and wait approximately 30-60 seconds. This will give it time to connect to the wireless network.Click the connect button in the top right of Mission Planner. In the first dialog box that appears type 127.0.0.1 and click OK. In the next box type the port number 14551 and click OK. After a few seconds Mission Planner should connect to your MAV and start displaying telemetry data in the left panel.When you set up your UAV for the first time, it is necessary to configure and calibrate certain hardware components. The ArduCopter docs have a thorough guide on how to configure the frame type, compass calibration, radio control calibration, accelerometer calibration, rc transmitter mode setup, ESC calibration, and motor range configuration.Depending on how you have mounted your Raspberry Pi on the drone it may be necessary to change the board orientation in mission planner. This can be done by adjusting the Board Orientation (AHRS_ORIENTATION) parameter in the advanced parameters list under the Config/Tuning tab in Mission Planner
FIRST FLIGHT
Once the hardware and software is ready, it’s time to prepare for the first flight. It is recommended that before trying autonomous flight the UAV should be flown manually using the transmitter to get a feel for the handling of the aircraft and to fix any issues that may exist.The ArduCopter documentation has a very detailed and informative section on your first flight. It discusses the various flight modes that come with ArduCopter and what each of these modes does. For the first flight, stabilise mode is the most appropriate flight mode to use.ArduCopter has many built in safety features. One of these features is the Pre-Arm Safety checks which prevent the aircraft from arming if any issues are detected. Most of these checks are important in helping reduce the chance of a crash or loss of the aircraft but they may be disabled if necessary.Arming the motors is when the autopilot applies power to the motors to allow them to spin. Before arming the motors it is essential that the aircraft is in a clear open area, well away from any people or obstacles or in a safe flying arena. It is also very important that nothing is near the propellers, particularly body parts and other things that will be damaged by them. Once everything is clear and the pilot is satisfied that it is safe to start, the motors can be armed. This page gives a detailed set of instructions on how to arm the aircraft. The only differences between that guide and the FC lie in step 7 of arming and step 2 of disarming. To arm the FC, both sticks must be held down and in the centre for a few seconds (see picture). To disarm, both sticks must be held down and to the sides for a few seconds (see picture).
AUTONOMOUS FLIGHT
Mission PlannerNow that your copter has been tuned and can fly well under manual control, autonomous flight can be investigated.The easiest way to get into autonomous flight is to use Mission Planner as it contains a large array of things you can do with your aircraft. Autonomous flight in Mission Planner falls into two main categories; pre-planned missions (auto mode), and live missions (guided mode). The flight planner screen in mission planner can be used to plan a flight consisting of waypoints to visit and actions to perform such as taking photos. Waypoints can either be chosen manually, or the auto waypoint tool can be used to generate missions to survey an area. Once a mission has been planned and sent to the drone, the Auto flight mode can be used so that the aircraft will autonomously follow the pre-planned mission.
Guided mode is a way of interactively commanding the UAV to do certain things. This is done by using the actions tab in Mission Planner or by right clicking on the map. The UAV can be commanded to do many things such as takeoff, return to launch, and fly to a chosen location by right-clicking the map at the desired location and selecting Fly To Here.Failsafes are an important thing to consider during autonomous flight to ensure that if things go wrong, the aircraft is not damaged and people are not injured. Mission Planner has a built in Geo-Fence function which can be used to limit where the UAV can fly and stop it from going too far away or too high. It may be worth considering tethering the UAV to the ground for your first few flights as another backup. Finally, it is important that you have your radio transmitter on and connected to the drone so that if necessary you can switch out of the autonomous flight mode into a manual flight mode such as stabilise or alt-hold so that the UAV can be safely piloted to land.MATLABAutonomous control using MATLAB is far less simple and requires some prior programming knowledge.The MATLAB scripts real_search_polygon and real_search allow you to generate pre-planned missions to search a user-defined polygon. The script real_search_polygon plans a path over the user defined polygon whereas the script real_search plans a path over the minimum rectangle encompassing the polygon. The steps to do this are as follows:Open Mission Planner and go to the Flight Plan window.Draw a polygon over the desired search area using the polygon tool.Save the polygon as ‘search_area.poly’ in the same folder as the MATLAB script.Go to MATLAB and run either real_search_polygon or real_search. Make sure to choose your desired path width and change the file_path on line 7 to the correct directory where you are working.Once the script has run and you are happy with the path generated go back to Mission Planner.Click Load WP File on the right hand side and choose the waypoint file ‘search_waypoints.txt’ that you have just created.Click Write WPs on the right hand side to send the waypoints to the drone.Arm the drone and take off either manually or by right-clicking the map and selecting takeoff.Once at a reasonable height change the mode to auto and the drone will start the mission.After the mission is over, click RTL in the actions tab to bring the drone back to the launch site.The video at the start of this step is a simulation in Mission Planner of the UAV searching an area.
VISION
The drone mission is to fly over mountains or wilderness and spot humans or irregular objects and then process that to see if that person needs help. This ideally would be done using an expensive infrared camera. However, due to the high costs of infrared cameras, instead the infrared detection is being resembled by detecting all non-green objects using a normal Pi camera.ssh into the Raspberry PiFirst of all we need to install OpenCV on the Raspberry Pi. The following guide provided by pyimagesearch is one of the best available on the internet.Download the code into the Raspberry Pi from GitHub through this following link: http://bit.ly/GitHub-UoBDASAR. To download the code onto the Raspberry Pi, you can download the file on to your computer and then transfer it to the Raspberry Pi.
To run the code, go to the directory where to code is on in the Raspberry Pi and then run the command:python colour_target_detection.py --conf conf.jsonCONTINUOUS USEEvery time you restart the raspberry pi you need to run the following commands:sudo ssh pi@192.168.0.111 -Xsource ~/.profileworkon cvThen continue with step 4 above.Important note: NOT all terminals are capable of showing videos. On mac use the XQuartz terminal.
Comments