This document explains how to compile a controler program with the RoBios HighLevel API and HDT for the EyeBotPlugin in SubSim.
The EyeBot Plugin extends SubSim with the EyeBot RoBios HighLEvel API. To run an Eyebot controller program, you need the actual program compiled as a .dll and a additional HDT for defining low-level attributes for sensors and actuators
The main function of SubSim is to serve as a debugging platform for controller programs specifically for microcontrollers such as the Eyebot. The Eyebot operating system RoBIOS is emulated by SubSim, so a program written to run on an Eyebot will function very similar when run by SubSim. RoBiOS has many system calls to support external devices such as motors, servos, position sensors, A/D input, electronic compass, etc... SubSim also defines these functions with a global scope, so they are available everywhere inside of SubSim including user programs. The RoBIOS system calls are implemented through a set of Plugins that interact with the internal physics simulation and graphical interface of SubSim. Because RoBIOS is implemented as the EyeBot Plugin, it is a good guide for those wishing to implement emulated system calls for other embedded operating systems. (NOTE: Because a custom user program is executed by SubSim on a PC, all the system calls of the native OS are available, Windows for instance. The user has to be careful not to rely on functions which may not be present on the target embedded platform).
The Eyebot uses a mechanism called the Hardware Description Table, or HDT, for defining low-level attributes for sensors and actuators. SubSim also supports the HDT format and it is necessary for writing programs that use any sensors or actuators. For more information see HDT HOW TO
To develop & compile your controller program you can either use Microsoft Visual Studio 7.1 or your favorite texteditor with MinGW as compiler.
Create a new solution to hold your code projects. For each program you
int main(int,char**) and a HDT file in separate projects.
Some configurations of Visual Studio will not define _WINDLL. This setting
must be defined in order to export your programs main function. If the project
has been correctly set up, you should see the message
"Main is being
automatically exported" when you compile.
MinGW is a collection of freely available and freely distributable Windows specific
header files and import libraries combined with GNU toolsets that allow one to produce
native Windows programs that do not rely on any 3rd-party C runtime DLLs.
It is a free package available under http://www.mingw.org.
For program development jEdit is recommended http://www.jedit.org. as text editor. Togehter with the jEdit Console Plugin it is very handy to compile your program.
if you are tired of typing mingw32-make all the time. Create a make.bat file with mingw32-make %1in any dir which is in the path (e.g. the minGW bin dir)
To execute the program you have to add the program name in a .sub SimulationFile. And load the file in SubSim. See Manual and HOWTO SUBFILES for more details on that
Example programs, including a VC71 workspace can be found in the examples/high-level directory.