This example is an culmination of multiple tutorials. Before completing this tutorial, you should complete these tutorials:
- A basic familiarity with the Linux command line interface.
- The ROS Beginner Level Tutorials (This is a must as it establishes the interfaces used in this tutorial)
- Mathworks Getting Started with Robotics System Toolbox
- AR Drone Tutorial This tutorial connects the drone to ROS.
- Pioneer P3AT Checkout. While not required to complete this tutorial, I use the tools script for situational awareness of the ROS architecture.
This example uses theenvironment; however, it should be comptaible with older versions. This example also uses an AR Drone.
Drones can be dangerous. Be mindful of your surroundings. Do not attempt to catch a flying drone.
Start and Connect Drone
Connect drone to battery. Ensure that battery is secured to drone. Ensure that there are no lose wires hanging out.
Connect your computer to the drone's wifi.
Open a new window in the command line. Start ROS.
Start ROS Tools
Open a new window. The easiest way is to do this is with CTRL+SHIFT+T. This opens a new tab in the same window. Next, navigate to the folder where you did the Pioneer tutorial. This can be accomplished using the change directory, cd, and list, ls, commands. The folder should end with: /src/nre_p3at/launch
Launch the tools program.
Three windows should open. Your topic monitor shows your topics. Your Node Graph shows what is connected to ROS as well as what topics are published and subscribed. The TF Tree shows... Minimize the windows for now.
Start AR Drone Program
Open a new tab. Navigate to the folder where you did the "Up and Flying with AR" tutorial. The folder should end with: /src/ardrone_autonomy/launch
Launch the drone program.
This will connect your drone to the ROS architecture. Open your Node Graph and click refresh (Blue circle arrow in upper left corner). Your AR drone should appear.
In a new tab, open Matlab:
Once Matlab opens, start ROS in Matlab:
Return to the Node Graph and click refresh. a Matlab box should appear.
These simple scripts are examples. The publish function will launch your drone. Note that the "/ardrone/" can be replaced with another name when using a different type of drone. Use the Topic Monitor to browse the different topics.
Subscribe and Print Battery Percent
The following script subscribes Matlab to the navdata topic and prints the Battery Percent
Use this a template for subscribing to data. Also, open the Node Graph. You will see the connection between the drone node and the Matlab node.
Subscribe to Camera
The following script subscribes Matlab to the front camera, "image_raw" topic, and shows the image.
The result should be a snapshot from your drone's camera.
Launch and Land Drone (THIS WILL LAUNCH YOUR DRONE!)
The following script publishes the launch command to your quadcopter, pauses for 5 seconds, then publishes the land command to your quadcopter.
These codes can be adapted and combined for other uses. Good luck. -JBT