Thursday, August 28, 2014

Drone Following #3: Collaboration and Ideas

Haven't done much flying since the last post but quite a bit of logistical thinking-- both alone and with others. I have two friends interested in working on this project with me-- my girlfriend, Nicole Lay, a Computer Science graduate, and my friend, Aaron Bradshaw, an engineering student at University of Kentucky. You may have noticed the yet unfulfilled "AJ Labs" link over at leibeck.tk, and that's what we intend to put there. It's really touch and go while we figure out how we want to share our information, so for the time being just know they are contributing from close or afar.

In terms of the project, I've tried to make it into a basic logistics problem. What kind of information are we receiving, what information can we derive from this existing information, and how can we use this connectivity to achieve our goal. So let's do it this way:

The Problem: We want to be able to have the drone follow targets during a variety of activities.

Current Thoughts: Connecting the drone to another "theoretical" device in order to orient the drone towards the device, and to follow it.

Available Information: On the ardrone_automony github page, you can see a concise list of the accessible information:





  • header: ROS message header
  • batteryPercent: The remaining charge of the drone's battery (%)
  • state: The Drone's current state: * 0: Unknown * 1: Inited * 2: Landed * 3,7: Flying * 4: Hovering * 5: Test (?) * 6: Taking off * 8: Landing * 9: Looping (?)
  • rotX: Left/right tilt in degrees (rotation about the X axis)
  • rotY: Forward/backward tilt in degrees (rotation about the Y axis)
  • rotZ: Orientation in degrees (rotation about the Z axis)
  • magXmagYmagZ: Magnetometer readings (AR-Drone 2.0 Only) (TBA: Convention)
  • pressure: Pressure sensed by Drone's barometer (AR-Drone 2.0 Only) (Pa)
  • temp : Temperature sensed by Drone's sensor (AR-Drone 2.0 Only) (TBA: Unit)
  • wind_speed: Estimated wind speed (AR-Drone 2.0 Only) (TBA: Unit)
  • wind_angle: Estimated wind angle (AR-Drone 2.0 Only) (TBA: Unit)
  • wind_comp_angle: Estimated wind angle compensation (AR-Drone 2.0 Only) (TBA: Unit)
  • altd: Estimated altitude (mm)
  • motor1..4: Motor PWM values
  • vxvyvz: Linear velocity (mm/s) [TBA: Convention]
  • axayaz: Linear acceleration (g) [TBA: Convention]
  • tm: Timestamp of the data returned by the Drone returned as number of micro-seconds passed since Drone's boot-up.

  • Derivation and Communication: Of particular interest for my idea is the rotz parameter. If our "theoretical device" could have a similar parameter, but with certainty, we could line up the two devices on similar plane, and have the drone maintain a 180 degree relationship, facing the device at all times. And as long as the device maintained the ability to be moved relatively, this transformation could be applied to the drone. As you can see, most of this relies on a communication and transformation from the external device.

    The Device: We're also putting a lot of emphasis on what the particular device could be. For the sake of my upcoming project for electronics course about microcontrollers, I may consider using an Arduino with a GPS shield, if that is indeed a possibility. It could expand to mobile devices like phones and tablets, but getting an app and setting it up to communicate with ROS could be even more difficult. We'll see, I suppose. I still need to try my luck at controlling the drone with ROS.

    A side note: It would seem intuitive to purchase a GPS flight recorder for the drone, and maybe give it a better idea of where it is relative to its surroundings, but I feel like this would be "buying" my way out of the situation. I understand that we're talking about a drone and other device, likely bring the cost up past 300-400$, but it's really important to me as an aspiring Engineer to make the most of what's available, not only for the challenge, but to make to make the end result available to the largest group of users. In truth there are already systems that extreme sports athletes use, but I would like expand this type of system to this cheaper platform. That's what it's all about!

    We'll see where this idea takes us. I may not update for a while, but I'll be sure to include my flight videos when I can.

    ------------------------------------------------------------------------------------------------------------

    Wednesday, August 27, 2014

    Drone Following #2: Learning to Fly

    This isn't a terribly programming heavy post, but it is essential to working with and understanding with something that flies-- especially with four rotors. I took my Drone out for its first flight, which was mostly successful. I didn't understand that there was actually quite a bit of settings to configure before flying, but even under less than optimal circumstances it performed quite well.


    The battery life of these devices really isn't that developed yet, but because this is the POWER EDITION, it has high density batteries that boost it close to an hour. In terms of the settings, there's a few key ones to how you'll be flying the drone. Most important is the maximum tilt. This value determines what the acceptable amount of tilt is for the drone. However, this also affects your maximum speed, since, in order to stop, the device may have to tilt past the acceptable limit. Also important is the maximum rotation, which has essentially the same properties, but for rotational properties like turning. These two facts combined essentially form kind of an overall sensitivity. It's pretty difficult to crash and burn when both the tilt and rotation are turned down, so keep that in mind. If you're filming or trying to get shots with the onboard camera, I'd suggest this kind of setting, but I imagine with an external camera (attached to the USB port) like the GoPro, it's probably not too much of a problem.

    There's also a set of lighter features that are good for optimizing your style of flight. Drones can be flown indoors and outdoors, so you there are flip switchs for things like where you're flying, which of the styrofoam hulls you're using, and then a few more gauges like maximum altitude (up to 100 feet), max vertical speed (how fast the drone raises and lowers, etc) and a few others. Before I begin experimenting I want to fly quite a bit to better how understand what behaviors the drone can tolerate, and what settings would best permit these behaviors. Whereas the app requires you open a menu (while flying D: ), whereas on ROS you could probably easily manipulate these settings on the fly.

    Plus that, there's a few novelties such as flips (can be enabled over 30% battery) and "absolute control" (where it spins around and then you can move it relative to where you are), but I've not discovered any pleasing features.

    I hope to log in a decent amount of hours flying, and, more importantly, safely landing before I proceed to use the driver. I'll try to make some of my videos and pictures available so you can maybe determine if you'd like one in the future.







    Drone Following #1: Features and Prospects

    I acquired an AR Drone today for a good price.
    I'm beginning to brainstorm what kind of projects to take on. I have an upcoming microcontroller project in an electronics class I may now utilize it for. The most interesting aspect to me, and really the selling point is the horizontal and vertical cameras, the horizontal capable of filming up to 720p. I already played around with the AR Freeflight app on both Ios and Android, and I was surprised by the options capable within the camera.

    One of the aspects I really want to check out is ROS connectivity. A few people in my lab used these same parrot drones in the lab. I took a look at ar_driver and it appears to be roughly equivalent to a manual version of the AR freeflight app, which is convenient. There's also ardrone_autonomy, which I'll move to after an understanding of the driver.

    My first project though I want to take a look at though is classic teleoperation. I like the free app, and it's great to get started, but I have my own gripes with it. First I want to figure out how to use the drone with my computer and then use some joysticks and other controllers. I have in my possession a Xbox 360 controller, and several wiimotes and nunchucks. I've seen a few interesting wiimote teleoperations that I would also like to investigate.

    Next, I want to work on some automated following. I imagine this can be done one of two ways; either by human recognition or by relation to some mobile device or controller. I think the latter is clearly easier, so I'll likely be working on it first. However, I certainly want to enable Human Recognition at some point, for that would open up a whole new range of projects.


    ------------------------------------------------------------------------------------------------------------
    Have anyone made any cool mods to a drone?