Coder Social home page Coder Social logo

target-land's Introduction

target-land

This demo allows a 3DR Solo to land on a colorful object using only the quadcopter, the controller, a gopro and a laptop. The CV runs offboard.

Demo Video

###Setup instructions: ####video: The SDP file defines a network stream. Opening this file with VLC or OpenCV's cv2.VideoCapture() should work. Before opening the network stream, we need to tell the controller to start streaming video. We do this by running nc 10.1.1.1 5502 on the computer where we want to receive the video. Let that run in the background. TODO make the python script open this instead, so the user isn't bothered by this extra step.

####autopilot firmware: Clone ardupilot and cd into ArduCopter. In the file called APM_Config.h, find the line that says //#define PRECISION_LANDING ENABLED. Uncomment this line. Now compile with make px4-v2. The build output is in this folder, and it's called ArduCopter-v2.px4. Now upload it to the Solo:

restart the Solo and wait a minute for the changes to take effect. If it doesn't work, try bumping the version number in the filename of /firmware/ArduCopter-v2.px4 to be higher than the last firmware that was flashed (located in ./loaded).

####parameters: Using you favorite GCS, load the parameters file. Using MAVProxy it looks like this:

  • mavproxy.py --master=udpin:0.0.0.0:14550
  • param load ./params.param

Then do a compass calibration using the Solo app, not a traditional GCS. A traditional GCS will do an offboard compass calibration, we want to do an onboard calibration.

####colors: In target_land.py there are variables near the top that need to be set in order to detect the right color. They are in HSV. Change these depending on the object, camera, lighting, etc. Red objects might are not ideal, because their H value is sometimes very high and sometimes very low.

####run it: Make sure these dependencies are updated: sudo pip2 install mavproxy dronekit pymavlink numpy --upgrade.

Also install OpenCV and put the right things in your path so that you can import cv2 in Python2.

run it: ./target_land.py

The script will connect to the video feed of the camera and then will connect to the vehicle over MAVLink. Whenever it sees a target that is big enough, it will send a LANDING_TARGET message.

target-land's People

Contributors

squilter avatar

Watchers

James Cloos avatar temi avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.