Simulator Software Setup

From molecubes
Jump to navigation Jump to search
Molecubes software demo: designing a robot and evolving its behavior
in a simulator (no sound)

The Molecubes software is designed to test and evaluate different morphologies and behaviors on the Molecubes. The interface allows the user to add Molecubes in any configuration in a virtual world that emulates real world physics, and then to send commands to individual Molecubes for actuation. In this way, the software allows the user to simulate and evaluate what might happen with a custom configuration and structure of Molecubes before physically constructing it. It employs the AGEIA PhysX physics simulator, as well the OGRE graphics rendering engine.

How to Run Simulator

These are the directions for setting up and running the latest version of the Molecubes Simulation tool. You will need the AGEIA PhysX run-time drivers and the zipped release package.

Step 1: AGEIA PhysX Drivers - Download from http://www.ageia.com/drivers/drivers.html Versions 7.09.13 and 7.06.25 have been tested and are known to be compatible. Please note the PhysX Hardware Accelerator is NOT REQUIRED.

Step 2: Latest Simulator Version - Download the zipped folder from Molecubes SVN, extract the files to any location on your hard drive, and run CubeInterface.exe.

Current Release Feature List:

  • build modular robots by adding modules to the existing modules one at a time
  • make any of the modules rotate in either clockwise or counterclockwise direction
  • observe the motion of the modular structure resulting from actuation of individual Molecubes

How to Set Up Simulator Development Environment

We used a pair of Molecube shells to represent an actuator in simulation

Download Source Code & SDKs

Note: The software has been developed and tested under Windows XP and Vista. Computers using the Intel 82845G/GL/GE/PE/GV graphics chipset are not able to run the visualization engine for currently unknown reasons. This chipset is unfortunately common in many new Dell machines.

Microsoft Visual Studio 2005 is required. Feel free to prove us wrong.

Step 1: AGEIA PhysX SDK - Download the latest tested and verified version 2.6.4. It is available for download to registered developers at http://www.ageia.com/developers/downloads.html. Registration is free and no spam.

Step 2: OGRE SDK v1.4.3 - Download OGRE SDK. Please use the older version 1.4.3 instead of the latest version on the Ogre website. We have had problems with the latest version.

Step 3: NxOGRE v0.4RC3 - Download NxOgre v0.4RC3 Please use the older 0.4RC3 version posted here instead of the latest version from their website. We have had problems with the latest version.

Step 4: Checkout Molecubes SVN Repo - Follow directions here. If you are familiar with SVN, the repo is located here: https://molecubes.svn.sourceforge.net/svnroot/molecubes

Install AGEIA PhysX SDK, OGRE, and NxOGRE

Step 1: Install AGEIA PhysX SDK v2.6.4 (default settings). Install directory will most likely will be: C:\Program Files\AGEIA Technologies\AGEIA PhysX SDK\v2.6.4

Step 2: Install Ogre SDK v1.4.3, recommended install path: C:\OgreSDK

Step 3: Install NxOgre v0.4RC3 by unzipping into recommended directory: C:\OgreSDK\NxOgre

Step 4: Setup Environment Variables, these correspond to installation paths of three steps above. (set in My Computer -> Properities -> Advanced System Settings -> Environment Variables):

 NXOGRE_DIR   C:\OgreSDK\NxOgre<br>
 OGRE_HOME    C:\OgreSDK<br>
 PHYSX_DIR    C:\Program Files\AGEIA Technologies\AGEIA PhysX SDK\v2.6.4

Step 5: Replace three original NxOGRE files with their respective modified counterparts available from Molecubes SVN or if you have checked out the latest code from SVN it can be found in trunk/software/NxOGRE/:

 $(NXOGRE_DIR)\include\nxOgre_body.h<br>
 $(NXOGRE_DIR)\include\nxOgre_joint.h<br>
 $(NXOGRE_DIR)\source\nxOgre_joint.cpp

Please take care to paste the modified files into the appropriate NxOgre folders.

Step 6: Compile NxOgre Open the NxOgre .sln file located in the NxOgre installation directory NXOGRE_DIR. Verify configured for Release build rather than Debug build. Execute Rebuild Solution (Build -> Rebuild Solution)

Step 7: Compile CubeInterface Open the CubeInterface .sln file located in the checked out repository trunk\software\CubeInterface. Verify configured for Release build rather than Debug build. Execute Rebuild Solution (Build -> Rebuild Solution)

Step 8: Run CubeInterface Either browse to trunk\software\CubeInterface\release and execute CubeInterface.exe or in Visual Studio (Debug -> Execute without Debugging).

Step 9: Celebrate!...It should be working

Simulator Runtime Configuration

Once the executable is built, place the necessary dlls (as mentioned above) in the same folder. From there, the program should run correctly. The graphics configuration can be modified by editing the config.yaml file. This file allows you to change the resolution and color depth.

Common Problems

Compilation fails

  • Verify the correct versions of the SDKs and the correct environment variables are configured.
  • NxOrge compilation fails:
 'nxOgre::structure' : class has no constructors<br> 
 'nxOgre::character' : class has no constructors
 
  • Just Move class _nxOgreExport structure : public body" and "class _nxOgreExport character : public controllable, public NxUserControllerHitReport" to the top of their header file.

CubeInterface compilation fails

  • Be sure NxOgre.lib is added in the project from $(NXOGRE_DIR)/compiler/$(SolutionName)/$(ConfigurationName)/lib/NxOgre.lib

Runtime Crashes

  • Verify the necessary dlls, config files, and artwork are present in the runtime directory. These are included by default in the CubeInterface project directory trunk\software\CubeInterface\CubeInterface. The runtime logs are useful in determining the source of a failure. Specifically NxOgre.physics.log and ogre.graphics.log.
  • The following files are required from the project directory trunk\software\CubeInterface\CubeInterface) in the release directory trunk\software\CubeInterface\release.:
 config.yaml
 NxCharacter.dll
 NxCooking.dll
 NxOgre.dll
 OgreMain.dll
 OIS.dll
 Plugin_ParticleFX.dll
 RenderSystem_Direct3D9.dll
 RenderSystem_GL.dll
  • The entire Media directory is required (from the project directory trunk\software\CubeInterface\CubeInterface) in the release directory trunk\software\CubeInterface\release.

Other Potential Issues

  • When compiling, be sure that the active solution configuration is set to "Release," 'not' "Debug". Debug libraries have "_d" appended to their names (e.g. "OgreMain_d.dll) which might confuse NxOgre or potentially CubeInterface.

Runtime Still Crashes...

  • As noted above, the software has been developed and tested under Windows XP and Vista. Computers using the Intel 82845G/GL/GE/PE/GV graphics chipset are not able to run the visualization engine. This chipset is unfortunately common in many new Dell machines.

If your problem does not fall into any of these categories please let us know.

LEXI Exporter for 3DS Max

LEXI Exporter: delete the green square if it appears. When you export a mesh only the static mesh nodes and group nodes should appear.
LEXI Exporter: if the 3D object is composed of many parts, you should group the different parts. The 3d object and the pivot need to be centered.

This auxiliary tool was used to export the 3-dimensional design file of the Molecube shell (a pair of those is shown shown on the right) into an object mesh so it could be displayed in the simulator. You will only need this tool if you would like to visualize some other new objects. This plugin exports 3DS models into *.mesh files; it is available for download from here. The exporter is used in conjunction with AutoDesk's 3D Studio Max. Other 3D modeling programs work as well, as long as it supports exporting to the .mesh format, which is the format supported by NxOGRE.

Notes on LEXI Exporter:

  • Sometime a green square appear when you import object, delete this green square.
  • If the 3D object is composed many parts, you should group the different parts.
  • The 3D object and the pivot need to be centered.
  • To scale and position a model, use "Reset XForms" before exporting.
  • "Reset XForms" is found under the "Hammer" utility tab (the right-most tab).
  • When you export a mesh only the static mesh nodes and group nodes should appear.

XForms are used to apply transformations to objects in 3D Studio Max. If you find that the changes in size, orientation, or pivot location/orientation are not being saved during export, the problem probably lies with the XForms. Make sure that the XForms are being applied properly (if at all) by clicking on "Reset XForms."


To check the exported objects in the mesh format, CEGui Mesh Viewer was used.

References