|
FRCInstallInstructions
WebDMA Build and installation instructions for FIRST Robotics
IntroductionThis 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 BoostThe 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 PatchDownload 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:
Now verify that it works.
Installing BoostYour 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 BoostNow, 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 projectLaunch the Wind River Environment, and open the workspace that your project resides in (this should be done by default). Adding the filesFirst, add the WebDMA files to your project:
Modifying the include pathNext, lets modify the include path so it can find the boost files.
Enabling WebDMA in your codeEverything 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 robotThe 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
TestingOnce 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