Archive for April, 2009

WebDMA demo video

Saturday, April 25th, 2009

If you read my previous post, I was talking about this new open source library I’ve created that allows you to embed a web server in your C++ application so that you could modify variables inside of it. I had created it for our FIRST Robotics team so that we could use it to tune things on our robot (and its been extremely useful for that) and use it for simple data acquisition. Of course, driving a robot is nothing more than changing variables… so I thought it would be a neat demo to set it up so that it could be driven by the web interface. 🙂

Here’s a video of our robot being controlled via the WebDMA interface:

And theres a (non-working) HTML version of the interface (though, its no longer the exact one that is on the robot, but its close) at

Changing variables using a web interface and embedded HTTP server

Tuesday, April 21st, 2009

When walking around during the Boston Regional, I had been talking to some people about code, and they mentioned that LabView was great because they could tune their PID controllers on the fly while the robot was operating. So I thought to myself, “why can’t I do this with C++?”. And… so I did. WebDMA was created to allow our FIRST Robotics team to tune our robot in an easy to use and intuitive way via any modern web browser.

Using C++ operator overloading, WebDMA provides proxy objects that your application can use as normal variables which can be manipulated or displayed by your application via a configurable jQuery/javascript powered Web 2.0 interface hosted by an lightweight embedded web server.

Despite that WebDMA was specifically created for use in FIRST Robotics on the NI-cRio/vxWorks platform, it uses the Boost ASIO portable networking library and Boost Thread portable threads library and is usable on any platform supported by these Boost libraries (tested on Boost 1.38, requires a patch for vxWorks).

A non-functional (but very shiny) demo of the interface is available at

Visit the Google Code project site for WebDMA

Update: Go here for a video:

Boost Asio and Boost Thread patches for vxWorks

Saturday, April 18th, 2009

The FIRST Robotics Competition is using the National Instruments cRio platform for the robot controller this year, and the operating system on it is vxWorks 6.3. After we participated in the competition, I had gotten a great idea involving putting a webserver on the robot so that it would be easier to tune various parameters on the robot (which I will be releasing soon).

I decided to use Boost::Asio for the networking layer since I had been meaning to write something using it for awhile anyways, and since its portable I could do the initial development on my home computer and then easily (at least, ideally) transfer it to another platform. I also decided to use Boost::Thread for the same reason. If you haven’t used Boost before, I highly recommend it — it has a lot of well-written and useful C++ header-only libraries.

Unfortunately, vxWorks is a bit different than ‘standard’ POSIX/*nix systems, so there are a number of patches one needs to make to Boost 1.38.0 in order to compile. I’ve submitted the patches to boost, so hopefully by the time 1.39.0 rolls around you won’t need this. 🙂

You can download the full patchset needed from my FRC resources page. Download it.

I’ve also posted bugs on the Boost Trac site: #2917, #2953, #2955, #2956, #2957, #2958, and #2959

Screw cygwin, I’m using GNUWin32

Wednesday, April 15th, 2009

For years I’ve hated cygwin (not for any particular reason, I just don’t like it) and have generally avoided using it because of that — but I’ve finally found a good alternative if you want useful *nix tools on Windows. Its called GNUWin32 and its a bunch of GNU utilities that have been ported to windows, and they’re quite lightweight also.

Its pretty sweet, I’ve actually had grep installed on my computer for quite awhile now, and just recently started installing more of these packages as my needs have evolved. I’d highly recommend it. The key thing to do is to add the bin directory to your path, so that way its accessible from cmd by default without having to screw around with typing out the full path name or anything.