GithubHelp home page GithubHelp logo

pawan-sen / eyantra_drone Goto Github PK

View Code? Open in Web Editor NEW

This project forked from simmubhangu/eyantra_drone

0.0 1.0 0.0 172 KB

Metapackage to control the edrone via services and topics -https://www.youtube.com/watch?v=M-RYyMyRl9g

License: BSD 2-Clause "Simplified" License

CMake 4.14% C 4.10% C++ 80.48% Python 11.28%

eyantra_drone's Introduction

Build Status

eyantra_drone

Metapackage to control the eyantra_drone via service and topics http://wiki.ros.org/eyantra_drone

e-Yantra

This repository is for controlling the Pluto Drone. You will need the Pluto Drone in order to work with this repository.

How to contribute to this project

Fork this repository and get started. Currently, documentation and comments are missing within the code. You can create a pull request by adding documentation

Rules

  1. Use only the Pluto Drone for this project.
  2. You must add comments in your code. File level, function level and line level comments are expected wherever necessary

Winner

First PR that follows the given rules and completes the given task, is declared the winner at e-Yantra's discretion

Getting Started

Use following instructions on how to use this package:

Prerequisites
# libavcodec and libsdl2-dev for camera
sudo apt install libavcodec-dev libsdl2-dev 

Installation
# Navigate to catkin workspace
cd <WORKSPACE_NAME>

# clone repository
git clone https://github.com/simmubhangu/eyantra_drone.git

# Build the Package
catkin_make 

Run Package
# launch file to communication with  edrone

roslaunch edrone_server drone_comb.launch

# Follow the instruction on terminal to control the drone

Using ROSTopic:

rostopic pub /drone_command edrone_client/edrone_msgs "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1000, rcAUX1: 0, rcAUX2: 0, rcAUX3: 0, rcAUX4: 1500}" // example of arming drone 

ROSTopic To Control edrone

Arm
rostopic pub /drone_command edrone_client/edrone_msgs "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1000, rcAUX1: 1500, rcAUX2: 1500, rcAUX3: 1500, rcAUX4: 1500}"
Disarm
rostopic pub /drone_command edrone_client/edrone_msgs "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1500, rcAUX1: 1500, rcAUX2: 1500, rcAUX3: 1500, rcAUX4: 1000}"
Increase Roll value to move forward with respect to x-axis
rostopic pub /drone_command edrone_client/edrone_msgs "{rcRoll: 1600, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1500, rcAUX1: 1500, rcAUX2: 1500, rcAUX3: 1500, rcAUX4: 1500}"
Decrease Roll value to move backward with respect to x-axis
rostopic pub /drone_command edrone_client/edrone_msgs "{rcRoll: 1400, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1500, rcAUX1: 1500, rcAUX2: 1500, rcAUX3: 1500, rcAUX4: 1500}"
Increase Pitch value to move forward/left with respect to y-axis
rostopic pub /drone_command edrone_client/edrone_msgs "{rcRoll: 1500, rcPitch: 1600, rcYaw: 1500, rcThrottle: 1500, rcAUX1: 1500, rcAUX2: 1500, rcAUX3: 1500, rcAUX4: 1500}"
Decrease Pitch value to move backward/right with respect to y-axis
rostopic pub /drone_command edrone_client/edrone_msgs "{rcRoll: 1500, rcPitch: 1400, rcYaw: 1500, rcThrottle: 1500, rcAUX1: 1500, rcAUX2: 1500, rcAUX3: 1500, rcAUX4: 1500}"
Increase Throttle value to move up with respect to z-axis
rostopic pub /drone_command edrone_client/edrone_msgs "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1800, rcAUX1: 1500, rcAUX2: 1500, rcAUX3: 1500, rcAUX4: 1500}"
Decrease Throttle value to move down with respect to z-axis
rostopic pub /drone_command edrone_client/edrone_msgs "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1200, rcAUX1: 1500, rcAUX2: 1500, rcAUX3: 1500, rcAUX4: 1500}"
Increase Yaw value to rotate in clockwise direction
rostopic pub /drone_command edrone_client/edrone_msgs "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1800, rcThrottle: 1500, rcAUX1: 1500, rcAUX2: 1500, rcAUX3: 1500, rcAUX4: 1500}"
Decrease Yaw value to rotate in anti-clockwise direction
rostopic pub /drone_command edrone_client/edrone_msgs "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1200, rcThrottle: 1500, rcAUX1: 1500, rcAUX2: 1500, rcAUX3: 1500, rcAUX4: 1500}"

Note: RC values ranges from 1000 to 2000

Multiple Drones

Following is the procedure to control multiple drones within the same network:

Setting the drone in client mode: Connect to drone wifi and use following command to open telnet connection:
telnet 192.168.4.1 // drone wifi ip
Set the drone in both Station(STA) and Access Point Mode(AP) : Use following command:
+++AT MODE 3
Set the ssid and password: Use following command:
+++AT STA ssid password
Add IPs: Start your hotspot and your drone should connect to the hotspot. Note the IP address assigned to it. Edit following lines in DroneSwarm.cpp. Repeat this for all new drones which are added to the network.
all_ips.push_back(&quot;192.168.43.151&quot;);
all_ips.push_back(&quot;&quot;);
Send data: Follow procedure in ROSTopic Header to give commands to fly the drones. Add droneIndex in edrone_msgs for every topic. This index is the same as the index of the IP within 'all_ips' when you add it.
TODO - Get drone data from multiple drones

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.