My favorites | Sign in
Project Logo
                
Search
for
Updated Apr 22, 2009 by dus...@virtualroadside.com
Labels: Featured, Phase-Implementation
FRCInstallInstructions  
WebDMA Build and installation instructions for FIRST Robotics

Introduction

This guide assumes that you know how to build projects in the Wind River environment, and that you know how to do basic things like load the project onto a robot. If you don't, then I would recommend reading the C++ programming guide that comes with the Wind River environment.

Installing/patching Boost

The current (1.38.0) boost header files need to be patched to work with vxWorks. You do not need to use GNU Patch to do the patching, but the instructions contained here use it. There are a number of programs that can handle patch files.

Installing GNU Patch

Download the complete package without sources from the GNUWin32 website, at http://gnuwin32.sourceforge.net/packages/patch.htm

Go ahead and install it to the default location, then add the bin directory to your path:

Windows XP:

  • Right click on "My Computer" (might be in your start menu)
  • Select 'properties'
  • In the dialog, select the 'advanced' tab
  • Click 'Environment Variables'
  • Click the 'PATH' variable in one of the lists (probably better to do the user variables), and then click 'edit' and add the following string to the end of it: ";C:\Program Files\GnuWin32\bin". If you didn't install it to the default location, then change the path to whatever that was and append a '\bin' to it.

Now verify that it works.

  • Open a command prompt (Start -> Run -> type 'cmd' and hit OK)
  • type 'patch --help' and hit enter. If it works, then a bunch of options for patch are shown.

Installing Boost

Your project MUST use the gcc compiler, but the example projects included with the FRC installation already have gcc selected by default.

You need to download the Boost 1.38 source code, and install the header files on your machine somewhere. There is a patch that comes with WebDMA to allow compilation with vxWorks. Hopefully future versions of boost will not require patching to compile correctly (there are a number of patches in the Boost TRAC site that have been filed, they just need to be integrated into the main branch).

http://sourceforge.net/project/showfiles.php?group_id=7586&package_id=8041&release_id=659602

I unzipped the files into c:\Program Files\boost, and there should be a directory boost_1_38_0 under that, which should have a boost directory under that, which should have a bunch of .hpp header files in it.

Patching Boost

Now, we need to patch the boost header files. This patch was tested with the Boost 1.38 header files, and may not work correctly on newer versions of Boost (though hopefully we won't need to patch it anymore in the future). If you haven't installed GNU patch yet (see above), this is a good time to do that.

So open up a command prompt (see above), and then type in the following command (if you installed the boost files to a different directory, then you will need to use that directory instead):

cd "\Program Files\boost\boost_1_38_0"

Now, do a dry run of the patch (the patch is located in the boost directory of the WebDMA distribution). Type the following:

patch --dry-run -p1 < path\to\patchfile\boost_1_38_vxworks.patch

And if it works, you should see the following output:

patching file boost/asio/detail/descriptor_ops.hpp
patching file boost/asio/detail/pipe_select_interrupter.hpp
patching file boost/asio/detail/select_interrupter.hpp
patching file boost/asio/detail/socket_ops.hpp
patching file boost/asio/detail/socket_types.hpp
patching file boost/asio/serial_port_base.hpp
patching file boost/asio/serial_port_service.hpp
patching file boost/config/platform/vxworks.hpp
patching file boost/config/select_platform_config.hpp
patching file boost/date_time/c_time.hpp
patching file boost/date_time/compiler_config.hpp
patching file boost/date_time/microsec_time_clock.hpp
patching file boost/functional/hash/detail/float_functions.hpp
patching file boost/thread/pthread/recursive_mutex.hpp

If you do not see that output, then you did something wrong. If you didn't do it wrong, go ahead and actually do it:

patch -p1 < path\to\patchfile\boost_1_38_vxworks.patch

And you should see the same output.

Modifying your Wind River project

Launch the Wind River Environment, and open the workspace that your project resides in (this should be done by default).

Adding the files

First, add the WebDMA files to your project:

Modifying the include path

Next, lets modify the include path so it can find the boost files.

Enabling WebDMA in your code

Everything should be good, so lets just add some sample code to your main file and the constructor of your RobotMain class (or whatever you specified in your START_ROBOT_CLASS macro).

Add the following include directive to the top of the file

#include "WebDMA/WebDMA.h"

And then add the following line to the constructor of RobotMain (or whatever):

	IntProxy i1 = WebDMA::CreateIntProxy("Integers", "i1", 
					IntProxyFlags().default_value(5).minval(0).maxval(10).step(1) );
	WebDMA::Enable("80");

And thats it (we're not going to use it or anything. If you were going to use it, then you would need to store the IntProxy object somewhere where it can be accessed).

Lets see if it compiles. It might take awhile. If it doesn't compile, you probably did something wrong. :)

Loading the web interface files onto the robot

The files in the www directory of the WebDMA distribution need to be copied to your robot and placed in a directory called 'www', unless you change it in the code.

Just FTP to your robot's IP address and make sure you use FRC as the username and password. Copy all of the files in the directory over.

I recommend FileZilla for an FTP client. You can get it at http://filezilla-project.org/download.php?type=client

  • Open FileZilla
  • at the top of the screen, enter "10.xx.yy.2" (where xx.yy is your team number -- this is the IP address of your robot), and then enter FRC as user name and FRC as password. Click 'Quickconnect'
  • Drag the www directory into the remote site window once it connects

Testing

Once you have your project compiling and the HTML interface files are on the robot, go ahead and load your code onto the robot. Once its loaded and started then point Firefox (recommended, but other browsers will work, just not tested very much at all) at your robot's IP address and see if the page loads. If it loads, then celebrate!

If its not working, send me an email or file a bug, because it should work.

You can look at the main.cpp file (included with WebDMA) for an example of how to use the proxy objects and how to set them up. However, keep in mind that the proxy objects should mostly act like normal integer/boolean/float variables (just remember that their values can change anytime). You can look at WebDMA/WebDMA.h and WebDMA/VariableProxy.h for documentation. VariableProxyImpl is the actual implementation for the proxy classes.


Sign in to add a comment
Hosted by Google Code