Thursday, April 5, 2012

More rov-suite Planning

I've been doing more planning work on how I'm going to tackle the base of Monterey's code.  I'm leaning towards having a QROV object that holds all of the data regarding the ROV's status (motor values, relay values, relay names, etc).  Then, there will be a QROVController object that is used to adjust the QROV values and send a packet to the ROV based on the QROV values.  The QROVController object will handle reading the joystick through QJoystick, although it will probably have a subobject (QJoystickHandler) that will manage the joystick's deadzones and bilinear scaling.  All of the settings and UI inputs will go into the MainWindow class and from there affect QROVController.  This is my current plan of action that I will continue development on soon.

My goal from Monterey is to make it as portable and user friendly as possible.  I recently found out that QSettings lets you force it into saving the settings in a *.ini file instead of in the registry or another location.  I'm going to play around with that, because having of the settings in a separate file will make sharing settings and backing them up easier than it has ever been before.

I had been planning on doing most of the QROVController development during this Spring Break, but other plans have changed that.  Therefore, my initial goal of a mid June release *might* have to be pushed off until late June.  Although a night of two of heavy programming and caffeine might make up for this... ;)

If you have any suggestions, comments or feature requests, let me know!  I'd love to incorporate them!

Chris

Tuesday, April 3, 2012

New Networking Test!

The latest and greatest version of Networking Test has just been released! This new version adds two new features: port sharing and autosending.  The autosending feature lets you put in a delay (measured in seconds) which is then used to time the automatic sending of packets.  It's pretty useful!  Another feature is the port sharing.  In Windows that was default, but in OSX* and Linux you had to request that on your own.  Now, Networking Test shouldn't try to lock out other applications that try to access the specified UDP port, which makes it more useful for debugging your own applications.

Head on over to Sourceforge and download the file!

Chris K


*Qt did say that Unix systems disregard the request for a shared port, but they didn't specify if OSX shared that behavior or not.  I know that OSX is based on Unix, but they often aren't lumped together in the same category in the Qt documentation.

Tuesday, March 20, 2012

Monterey UI

Great news!  Monterey's first lines of code have now been written!  So far, I've laid the ground work for a QROV object that will hold all of the statuses of the ROV's various tools and components.  I've also started working on the GUI (which will look better as time passes, I promise).  My next major step is working on my QROVController object.  That will interact with the joystick and the UI in order to adjust QROV's properties (which are then sent down the tether to the ROV).

I've even created some new jargon for rov-suite:
TOBI (Topside Out Bottomside In) and TIBO (Topside In Bottomside Out).  I stole these from the SPI protocol's terminology because they made sense for an ROV controller.  Previously, RX and TX were used.  The problem with that is that the ROV's TX is the topside's RX and vice versa.  By using TOBI and TIBO, there should be none of that confusion.

I will post more updates on rov-suite to this blog as time goes by.

In other news, I found out about iFolder, which is a handy little Dropbox-like application that let's you use your own server.  I have an old netbook laying around that I just installed OpenSUSE12 (with KDE, my first time using Linxu without Gnome) and I plan on turning that into a Git server for backing up my code and an iFolder server to sync my other files across my computers.

I will admit, I do miss Ubuntu....  The other day, my friend (whom I converted from Vista to Ubuntu) came over to my house and had me install the "lmms" audio application.  From the terminal, I was able to download all of the necessary libraries, run cmake and build the application.  I then made a nice little shell script that sits on his desktop and acts as a shortcut to it.  I'm not used to OpenSUSE's terminal commands (good-bye, apt-get install.  hello zypper in!) yet, but I've only had it for 10 hours so far...

Thanks for stopping by!

Chris K

Thursday, March 15, 2012

NetworkingTest



Good news!  I've been working on touching up my UDP networking tools (NetworkingTest).  I've added a timestamped logging feature, cleaned up the code, fixed a bug, fixed the keyboard shortcuts and added an icon!  Plus, I have re-released the code onto my Sourceforge project.  You can find the executable here.  For the meantime, I have only released the OSX version.  I will recompile it on Windows and upload that ASAP.

The Android version of NetworkingTest has received a similar update (without the new icon, although I will probably change it's icon to the newer, improved one).  I will upload the *.apk of the Android version soon!

Chris K

Friday, March 2, 2012

Doxygen - Automatic Qt/C++ Documentation

I came across a nifty application today: Doxygen.  Doxygen is able to parse your raw source files for a variety of languages (with special support for Qt's signals and slots) and turn it into documentation.  I've seen the output of Doxygen before with Qwt and several other libraries, but I never realized that it could be automated.

I will definitely start documenting my code with Doxygen.  You can expect that Monterey v2.0 and it's corresponding classes will all be Doxygen'ed.

If you want to check out my *very* basic test of Doxygen, you can see it's automatic documentation of my QPID class here.

Hope this helps!

Chris

Monday, February 27, 2012

Monterey 2.0 - Preliminary Information

I have many big changes in mind for Monterey 2.0 (my FOSS ROV controller)!  How does having an ROV controller that works on OSX, Linux, Windows AND Android sound?  How does a simplified UX (user experience) sound?  Does a revamped UI sound like a good idea?  Finally, how does having a clean, simple example Arduino sketch for the bottomside (ROV firmware) sound?  Well, I've started designing these aspects of the controller.  I have learned quite a bit about OOP and Qt since I started working on Monterey v1.0 (my first decent sized Qt project), and I plan on applying what I have learned to Monterey v2.0.  

Preliminary Feature Set
  • A cleaner, neater code base! (also more focused on OOP than before)
  • Multiple motor configurations (4 horizontal/2 vertical, 2 horizontal/2 vertical and 2 horizontal/1 vertical)
  • Relay support (probably 3)
  • Servo support (probably 2)
  • Depth, heading and voltage sensor support
  • Fully functional (and well commented) example sketch for the Arduino Ethernet
  • USB joystick support
  • Easy debugging
  • Simplicity of use
  • A revamped UI with nicer widgets that get the job done better (graphs, compass, LEDs, etc) than their old counterparts in Monterey v1.0
And of course, if you want to add more features or use another bottomside microprocessor, you can change whatever you need to!  The topside code will be completely open sourced (I just need to find a license that I like and that I can use... it'll most likely be GPL'ed or LGPL'ed, although I would like a freer license), so you can tweak it how you'd like.  And since the topside talks to the bottomside over UDP, it'll be easy to use any bottomside architecture you'd like (Arduino, Propeller, BASIC Stamp, Raspberry Pi, etc).

I will also be simplifying the packet layouts.  There really is no need for the bottomside to echo up packets to the topside, so I'll get rid of that "feature."  I also plan on making the bottomside firmware respond to changes in settings in the topside firmware (i.e. the firmware will automatically detect changes in the motor layout if that change is made in the topside).  

I'll be posting more information, diagrams, flowcharts and screenshots as this unfolds.  I will still wait until June of 2012 to release the source, though (whether completed or not).

Thanks for stopping by!

Chris K

Sunday, February 26, 2012

Qt + SDL on OSX Tutorial

I know that I promised a tutorial on using SDL with Qt on OSX, and here it is (complete with screenshots)!

To download the example application that I used (Joypick), go here.  You will obviously want to get the source code, not the executable.  It is under the "Source" tab.

Step 1:  Download the SDL Library


Go to the SDL download page to download the OSX runtime library.  It'll download as a *.dmg file.

Step 2: Copy Files
Open up the *.dmg and select the "devel-lite" folder.  Next, copy the "SDLMain.h" and "SDLMain.m" files to a place of your choosing.  I like to copy this kind of files to ...QtSDK/ExternalLibs/ on my hard drive.  It's just a nice place to keep them organized, although you can put them wherever you want.

Step 3: Install Framework
Next, copy the "SDL.framework" folder from the *.dmg to /System/Library/Frameworks/.  That is all there is to installing the framework.

Step 4:  Modify the *.pro File


Here is how my *.pro file looks.  I've modified it slightly from the original to get rid of the Windows related information.  Then, right-click (control-click) on Joypick (under Projects) and click on "Add Existing Files."
Next, locate the "SDLMain.h" and "SDLMain.m" files on your hard drive and select those.  Then click on "Open."  Qt Creator will automatically modify your *.pro file to include these files.

Step 5:  Link to the Framework
Now it is time to link to the SDL.framework that you installed earlier.  Go ahead and add the two lines that you see in the picture above (lines 17 and 18) exactly as they are shown (working on Snow Leopard).  I'll show them below.

QMAKE_LFLAGS += -F/Library/Frameworks/
LIBS += -framework SDL

Step 6: Undefine main
Because of SDL, you'll need to undefine main in your "main.cpp" file.  See picture above for more information.

Step 7: Fix the Crash
Open up "qjoystick.cpp" and go to where
void QJoystick::setJoystick(int js)
{
     Q_ASSERT(js < availableJoysticks());
     Q_ASSERT(js >= 0);
     
     SDL_JoystickClose(m_joystick);
     m_joystick = SDL_JoystickOpen(js);
}
is.  Go ahead and comment out the line that says
SDL_JoystickClose(m_joystick);
.  This line causes the application to crash almost each time it is run when not using an XBox 360 wired joystick (bug confirmed on Windows but not tested on OSX).

Step 8: Build and Run!
Go ahead and run Joypick.  It should work like a charm!  I tested this out using a Logitech Extreme 3D Pro joystick on Snow Leopard.  Enjoy being able to run SDL applications on OSX!

I hope this helps out!

Chris K

P.S.  If you have any questions, feel free to ask them in the comments.