Saturday, November 17, 2012

Thumb Hypoplasia App 2.0


This app will be used to measure a patient's thumb's range of motion on a 2D plane.  By comparing ROMs (range of motion) of before and after surgery, surgeons will be able to get a quantitative analysis of the effects of the surgery.  The first version of this app was designed to find the 3D volume of space that the thumb could move in, but that had some issues.  This new version is working pretty well so far!  Each square on the grid is 1 square centimeter (found by having the user input a diagonal length of the screen and using the resolution to calculate the pixel density).  Each red dot is a recorded touch point.

I've spent about 8 hours this weekend working on this app (so far), because I've decided to rewrite it from scratch.  The main interaction area is a QGraphicsView widget which has perfectly usable performance on my modest Acer A500.  Through this project, I've been learning a lot about graphics in Qt, which should hopefully let me write some cool custom widgets.

Well I'm going to get back to working on the app now.  I'll post a video demo of it to Youtube soon.

Thanks for stopping by!

Chris Konstad

Edit: Here's a YouTube video of the very basic functionality currently implemented in action:

Friday, November 16, 2012

Update: School and College

I've been pretty quiet on my blog lately because school work and college apps have taken up a huge part of my time this past month.  Luckily, I'll be done with college apps before winter break so I can work on some side projects soon.  When I'm not doing educational work (school work, college apps, etc.), I'm working on things for my robotics team and trying to help get a programming club at my school going.  

Our (Jesuit Robotic's) ROV is looking great so far this year.  We have some ideas that we have been tossing around for a year or so that we are finally getting around to implementing!  For example, we are going to have a Raspberry Pi onboard so that we can flash our Arduino firmwares without having to open up the cans (waterproof electronics containers).  

The programming club is coming along nicely.  Two other students and myself are leading the club by teaching the other members how to use Qt to target iOS and Android (sadly, most of our members haven't had any programming experience yet).  Our first project is an application that will act as an information center about all of the clubs on campus.  We are working with the web development club on campus to create a web-based application that will let club administrators update the information about their club to include upcoming events and other notes.  

Here is an awesome Qt Developer Days video demonstrating Qt 5 on various platforms (I can't wait for Qt 5 to come out in 2013!  I'm super excited about Qt Creator 2.6 as well.).


And if you're looking to make 2D games using Qt Quick that target mobile devices, check out V-Play.  I haven't used their service yet but it looks pretty interesting!

Finally, I'm starting to make some headway again on a thumb hypoplasia analyzing Android app.  I've been stuck for a while because of third party library linking (and using) issues, but now a friend of mine offered an alternative solution.  Instead of finding a 3D volume that the thumb can move in, I could instead find the area on different planes that the thumb can move in.  It's much easier to calculate area than it is volume!  I plan to get some work done on that tonight because I'd like to start testing out a beta version of it ASAP.

Thanks for stopping by,

Chris Konstad

Saturday, October 13, 2012

UDP Packet Logger


Last weekend, I made a handy little command line utility called "unlog" (Udp Network LOGger).  You can find the source here.  Once installed (and added to the path), just type unlog, if you want a timestamp or not, the port and then the file.  Then, unlog sits on that port and writes all of the UDP packets it gets to the file of your choice.  This might be handy for debugging UDP based ROV control applications or really just anything related UDP.

Enjoy!

Chris

Sunday, October 7, 2012

[Tutorial] Bash Script for Arduino Uploader

Following the recent tutorial I wrote about flashing an Arduino hex file remotely using a Raspberry Pi, I wrote a bash script to automate the process.  To use this function, just copy the highlighted code to your .bash_profile or .bashrc file in your home directory.  With this function, you can just type arduinoupload path/to/my/file.hex in the command line and it will take care of the rest (assuming that you are trying to flash an Arduino Duemilanove using the "pi" user on the Raspberry Pi at IP 192.168.2.16 AND that you have already setup an SSH public key between the two).  If you don't set up the SSH keys, you will be prompted to enter your password.  You can tweak the function to adjust it to your setup, or you can rewrite it to make it more flexible.  I chose to hardcode these values because my setup (IP, user, Arduino model) never changes.

This is just an interesting little bash script that somebody may be able to make use of.  If you want any explanations regarding the script, you can either ask me in the comments or use Google (I'm new to bash so it probably will be more helpful that I will be).

Thanks for stopping by!

Chris Konstad

Saturday, September 29, 2012

[Tutorial]Upload Arduino Sketches Using RPi

I just figured out how to do something really cool: upload sketches compiled on my laptop to my Arduino over my local network by using my Raspberry Pi.

It's pretty simple, really, but the uses are endless.  The most immediate use for me is that I could have a RPi onboard my ROV and I could flash new Arduino software to my ROV without having to turn it off or open it up.  That alone would save my robotics team a lot of time!

Here's a quick little tutorial on how to do this.

Step 0: Install AVRDUDE on Your RPi
This step is very simple.  Connect your RPi to the interent and type sudo apt-get install avrdude.  That will install all of the necessary packages (assuming SSH is already installed and enabled).

Step 1: Write and Compile Your Code



Write your code as normal and compile it as normal using the Arduino IDE.  The only catch here is that you'll want to go into settings and turn on the verbose mode for compilation so that you can find the hex file that the avr-gcc makes.  It moves around each time, just FYI.  The highlighted line (also the second to last line) is the path to the hex file.

Step 2: Copy the Hex File onto the RPi




This step should be pretty simple for any SSH familiar users.  Just use the scp fileToCopy user@hostname:/fileToCopyTo command.  In the screenshot above, you can see that I copied over two different hex files.  Remember where you copied the hex file to!

Step 3: Burn the Hex File

First off, you'll need to SSH into your RPi.  Just type ssh user@hostname into your command line.  It'll ask you for user's password, so enter that.  If you need help SSHing, you can find some awesome tutorials for your OS by using Google.  Once you're in, you can burn the hex file using avrdude.  For my Arduino Duemilanove, I know that it is in /dev/ttyUSB0.  You can find out which USB port your Arduino is under by typing ls /dev/tty* before plugging in your Arduino and then again afterwards.  Compare the results to find out the name of your Arduino.  Keep in mind that it should always stay the same unless you plug in another Arduino.  Now for burning the software.  The command for the Arduino Duemilanove is avrdude -b 57600 -p m328p -c arduino -P /dev/ttyUSB0 -U flash:w:fileToBurn -v.  That "v" is there for verbose output.  Let's break down that command.

avrdude: the application being called
-b 57600: sets the baud rate to 57600, which is what the Arduino Duemilanove
-p m328p: sets the part number of the processor (the atmega328p in this case)
-c arduino: sets the programmer type to "arduino" (which should be used for ALL "normal" Arduino software flashing)
-P /dev/ttyUSB0: this sets the port
-U flash:w:fileToBurn: this tells avrdude to "perform a memory operation" that involves the writing of the specified file to the flash memory of the microprocessor
-v: verbose output

And that's all there is to it!

Enjoy!

Chris Konstad

Wednesday, September 19, 2012

Mobile App Making Club

My school has decided to create a mobile app (iOS, Android) club where students can learn how to write apps.  The teacher in charge of the club has been asking for my input and help recently.  He wants to make it so that people in the club can write an app for one OS and compile it for the other OS without rewriting it.  He talked about using Google's new "translator," although if I recall correctly, that can't touch the UI code.  That means the students will have to rewrite the UI wrapper for their converted backend code.  I'm thinking about suggesting that they use Qt with QML (Necessitas for Android and Qt4iOS for iOS support), although I'm worried because of the status of both projects.  I don't know if new programmers should learn with projects that are relatively new because of the problems those newer projects could impose (including a higher barrier to entry).

Is there a better way to write apps for both platforms (using "real" code, not blocks and not using HTML5)?

Please leave any suggestions in the comments!

Thanks!

Chris

Sunday, August 26, 2012

School Started and Qt on iOS

Sorry I haven't done too much work on ROV-Suite recently.  I've been pretty busy with school starting, college applications, Robotics team planning (I'm now the team lead) and other programming projects.

This year at school, I'm taking 5 AP courses (Physics, Spanish 4, English, Government, Calculus BC) and so my schedule will be pretty packed.  I won't have too much time to work on as many side projects as I did last year.  Also, I'm the team lead for my Robotics team, which will be a large time commitment.  Finally, the essays involved in college applications and the applications themselves will be a large time-sink.  What I'm trying to say is: don't expect too many updates to ROV-Suite or my other projects this school year.


The good news is that I have successfully written a QML application for iOS (I ported it from my Android/OSX/Windows/Linux code with only slight modifications)!  I'm really excited that the "Qt4iOS" project was far enough along for me to be able to easily use it.  I used Xcode 4.4.1 (on OSX 10.8) and I used the LLVM GCC compiler toolchain.  It works great on my iPhone!  I'll be writing more iOS apps and games in the future (possibly with the help of one of my friends).

I'm going to write a nice tutorial (with screenshots) about developing for iOS with Qt + QML sometime soon.  Thankfully it's pretty easy to get it all setup and working!

Thanks for stopping by!

Chris K