Robot Simulator of the Robotics Group for Self-Organization of Control: ode_robots/ Directory Reference

- Main Page
- Namespaces
- Classes
- Files
- Directories
- Related Pages
- Examples

- Search for |

# ode_robots Directory Reference

The ode_robots directory provides all the stuff necessary for simulations with the physics engine ODE (http://ode.org). More...

## Directories
directory | agents
directory | examples
| Examples for the usage of the selforg framework.

directory | motors
| Additional motors complementing the offer of ODE.

directory | obstacles
| Obstacles in our simulations are different kinds of boundaries, so called arenas or playgrounds.

directory | ode_patches
| Patches for ODE and drawstuff from the Leipzig Robot Group.

directory | osg
| The osg directory provides the osg primitves of which robots and obstacles are assembled and further helpful things dealing with the visualization in OSG.

directory | robots
| The robots of our simuated worlds "live" in this directory.

directory | sensors
| All sensors should be placed in this folder.

directory | textures
| The textures directory contains the different textures used in the simulations.

directory | utils
## Files
file | odeconfig.cpp
file | odeconfig.h [code]
file | ode_robots/README
| This file is used for the doxygen documentation.

file | simulation.cpp
file | simulation.h [code]

## Detailed Description

The ode_robots directory provides all the stuff necessary for simulations with the physics engine ODE (http://ode.org).

Simulation Environment

The class OdeConfig holds the configurable parameters of the simulation environment like gravity, simStepSize, realTimeFactor and so on.
In the class Simulation you find the functions to overload like start and end which have to be overloaded by all simulations. Additionally you can overload functions like command to react on keystrokes, config for configuration purposes (rarely required) and some more.

Simulation objects and more

The things inside the simulation environment (and some additional stuff) is inside the following subdirectories

- simulations: ready to use simulations
- agents: structure to build a "complete" agent (consisting of a controller, a robot and the wiring in between), different wirings
- robots: our robots,creatures, vehicles or whatever you would like to call them are in this directory
- osg primitives: many classes for the osg and ode integration. It provides Primitives and Joints of which robots and obstacles can be assembled, and further helpful things to deal with OSG
- motors: a few additional motors (PID servos)
- sensors: up to now an infrared-sensor and a sensor-bank is available
- obstacles: passive obstacles like different kinds of playgrounds, a sphere and usage of terrains
- utils: all the little things that make life easier
- ode_patches: OBSOLETE! our patches for ODE 0.5 and drawstuff
- textures: our textures used in the simulations and a program for calculating heigt-maps

How to start your own simulation

To start a new project it is recommended to copy one of the existing simulations from `ode_robots/simulations/` e.g. one of the "template" folders. To easy the procedure use the createNewSimulation.sh script in the simulations directory:
`$> ./createNewSimulation.sh template_dir newsimname`
where `template_dir` is the template directory you wish to copy and `newsimname` is the name of the new simulation you wish to create. This takes care of your installation type and other things like possible superficial CVS information.

Example:

    cd ode_robots/simulations
    ./createNewSimulation.sh template_onerobot mysimulation

For user-type installation you probably want to put the simulation in a separate directory, that means:

    ./createNewSimulation.sh template_onerobot ~/path/to/simulations/mysimulation

Now you can adjust the simulation as you like. A simple make in the simulation directory should be enough. In case your simulation code consists of other files than main.cpp, please add them to FILES in the Makefile.conf in the simulation directory. You also have to run `make depend` afterwards!

If you insert a new file to the simulation framework, such as a new obstacle, robot or similar you DON'T need to add them anyvery. Every *.cpp file in the directories specified in Makefile.conf is compiled and included in the library libode_robots.a. In case you add a new directory with source files, which should be included in the lib, then add it to Makefile.conf. In any case run a `make` in the lpzrobots directory, this creates the neccessary dependency information to ensure a proper build.

How to add a new robot or obstacle or controller to your simulation
  - Locate a similar object in the simulator. You find this under: `ode_robots/robots`, `ode_robots/obstacles`, and `selforg/controller`
  - copy the .h and .cpp file to you simulation folder, e. g. `nimm4.cpp` and `nimm4.h`
  - rename it to whatever you like, say `myrobot.cpp`, `myrobot.h`
  - modify the code so that the class has the new name, e. g. `MyRobot`
  - change include directives to have a `<ode_robots/ >` style.

        #include <ode_robots/primitives.h>

  - add "myrobot" to the Makefile.conf FILES variable
  - run `make depend`
  - ready to use the stuff in your simulation (use include "myrobot.h")

Collision control and Materials
  Read more here