Sunday, December 14, 2014

Drone Following #9: Soldering, State Machine, Github.



I've been quite productive since my finals (finally) ended.

First of all, my chips arrived! I was quite impressed with how small they were! The LSM9DS0 is about the length of half your thumb, and the level converter only a third of that. Not long after they arrived, I snuck out to the school's tech lab and soldered them together. It was nice to get back in the saddle and sit down with the ol' soldering iron. It feels like knitting, but with heat. My work isn't what it used to be, but I think it's enough to get the job done.



Next, I enjoyed my break exactly as envisioned. Tonight I spent the night doing some programming, the beginning of the drone following project. This consisted of creating an 3 state finite state machine. Right now it doesn't do much other than turn on LEDs in a sequential order and via the serial port tell you what state it's in.



But this is very important! After all, when I integrate this with the Drone controls, you don't want it ever going to the wrong state at the wrong time... This could mean taking off or landing at the wrong time. That being said, there was also some fool-proofing to be done-- for example, the Arduino reads super quick (sometimes), so you need to put a time delay in for the button press, or it may quickly transition between states. I handled this by having it hold for a second in a loop if the button is held. Right now all of the states are working as intended, so the next move will be ROS integration-- sending the state to ROS. From here, the Drone will read it, and respond accordingly. The states are as follows: Landing Mode, Takeoff Mode (indicated by a yellow LED) and Calibration Mode (indicated by a green LED). Calibration is where the Drone begins to follow movement.


Finally, I've made myself available on Github. It's been a while since I used it consistently, but I've realized that if I want to show people what I'm made of, I have to... show people what I'm made of. Therefore, I'll try to be consistent in uploading any code changes for your own viewing at my own github profile, Gariben. Here you can find the code for the state machine mentioned, as well as handy Fritzing diagrams and schematics. I'll usually include those in the blog, like so:
Currently, the code is housed under the "AirCat" repository. I didn't quite know what to name the project, since "Drone Following" will properly get me a pitchfork mob from an uneducated following, so I thought I'd just mimic the AirDog project that features the Drone remote, since the ideas are similar. Anyways, I hope to continue work on this project along with work to those I've dedicated myself too, so I'll try to keep everyone updated. Be sure to stay tuned to my Github for the latest-- it always comes at least a little before the blog.



1 comment:

  1. These are really nice for prototyping. The breadboard sticks onto the protoshield with tape that is included, and all your components and wiring are then on the arduino in a single piece. It's much easier to move everything from bench to bench or bench to project.

    https://www.sparkfun.com/products/9900
    https://www.sparkfun.com/products/12044

    ReplyDelete