(!) Please ask about problems and questions regarding this tutorial on answers.ros.org. Don't forget to include in your question the link to this page, the versions of your OS & ROS, and also add appropriate tags.

Description: This package is used to communicate between plutodrone and system through ROS. Drone will send the accelerometer, gyro, Magneto and altitude data, subscribe the roll pitch and yaw value.

Tutorial Level: BEGINNER

Installation

pluto_drone Drona aviation

# Navigate to catkin workspace
roscd <WORKSPACE_NAME>

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


# Build the Package
catkin_make

Run Package

Run roscore command and follow the step:

rosrun plutoserver data_via_rosservice.py

roslaunch plutoserver drone_comb.launch

Services

  • /plutoservice(PlutoPilot): Pluto drone gives data on this service after request. This service gives the data like accelerometer, gyro, Magneto and altitude.

Topic

  • /drone_command(PlutoMsg): This topic used to give the motion command to drone

  • /input_key(Int16): This topic used to give the key command to another scripts to genrate the appropriate command

Keyboard keys to control the Drone

  • Contolling Drone

You can control your drone after lauching the drone_comb.launch. Type the following sequence to control the drone in particular coordinates.

NOTE: The key pressed will not be visible in the terminal.

Control Your Drone!

Moving around:
        i    
   j    k    l
        m    

k : Reset
a : Arm drone
d : Dis-arm drone
r : stop smoothly
w : increase height
s : decrease height

Control Commands (varies from 1000 to 2000)

  • Arm

rostopic pub /drone_command plutodrone/PlutoMsg "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1000, rcAUX1: 0, rcAUX2: 0, rcAUX3: 0, rcAUX4: 1500}"
  • Disarm

rostopic pub /drone_command plutodrone/PlutoMsg "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1000, rcAUX1: 0, rcAUX2: 0, rcAUX3: 0, rcAUX4: 1000}"
  • Motion Command: You can set the rcRoll, rcPitch , rcYaw and rcThrottle to control the direction of drone.

# Increase Roll value to move forward with respect to x-axis

rostopic pub /drone_command plutodrone/PlutoMsg "{rcRoll: 1600, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1500, rcAUX1: 0, rcAUX2: 0, rcAUX3: 0, rcAUX4: 1000}"

# Decrease Roll value to move backward with respect to x-axis

rostopic pub /drone_command plutodrone/PlutoMsg "{rcRoll: 1400, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1500, rcAUX1: 0, rcAUX2: 0, rcAUX3: 0, rcAUX4: 1000}"

# Increase Pitch value to move forward/left with respect to y-axis

rostopic pub /drone_command plutodrone/PlutoMsg "{rcRoll: 1500, rcPitch: 1600, rcYaw: 1500, rcThrottle: 1500, rcAUX1: 0, rcAUX2: 0, rcAUX3: 0, rcAUX4: 1000}"

# Decrease Pitch value to move backward/right with respect to y-axis

rostopic pub /drone_command plutodrone/PlutoMsg "{rcRoll: 1500, rcPitch: 1400, rcYaw: 1500, rcThrottle: 1500, rcAUX1: 0, rcAUX2: 0, rcAUX3: 0, rcAUX4: 1000}"

# Increase Throttle value to move up with respect to z-axis

rostopic pub /drone_command plutodrone/PlutoMsg "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1600, rcAUX1: 0, rcAUX2: 0, rcAUX3: 0, rcAUX4: 1000}"

# Decrease Throttle value to move down with respect to z-axis

rostopic pub /drone_command plutodrone/PlutoMsg "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1500, rcThrottle: 1400, rcAUX1: 0, rcAUX2: 0, rcAUX3: 0, rcAUX4: 1000}"

# Increase Yaw value to rotate in clockwise direction

rostopic pub /drone_command plutodrone/PlutoMsg "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1600, rcThrottle: 1500, rcAUX1: 0, rcAUX2: 0, rcAUX3: 0, rcAUX4: 1000}"

# decrease Yaw value to rotate in anti-clockwise direction

rostopic pub /drone_command plutodrone/PlutoMsg "{rcRoll: 1500, rcPitch: 1500, rcYaw: 1400, rcThrottle: 1500, rcAUX1: 0, rcAUX2: 0, rcAUX3: 0, rcAUX4: 1000}"

Multi Drone

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

  • Setting the drone in client mode: First connect to your drone. Open a telnet connection as per the following

telnet 192.168.4.1
  • Set the drone in both Station(STA) and Access Point Mode(AP) : Once connected, run the following

+++AT MODE 3
  • Set the ssid and password: Set your ssid and password you want the drone to connect to

+++AT STA
  • Add IPs: Start your hotspot and your drone should connect to is. Note the IP address assigned to it. Open PlutoSwarm.cpp  in plutodrone/src and add the IP address. Repeat this for all new drones connected to the network

all_ips.push_back(&quot;192.168.43.151&quot;);
all_ips.push_back(&quot;&quot;);
  • Sending data: Follow procedure in Control Commands to fly the drones. Add plutoIndex(PlutoMsg) for every topic. This index is the same as the index of the IP within 'all_ips' when you add it.

Get drone data: Pending

Contact

In case of problems, questions, or suggestions, please contact Simranjeet <simranbhangu01@gmail.com>


CategoryCategory

Wiki: pluto_drone (last edited 2018-05-18 09:24:02 by Simranjeet)