Just create your own simulation, it's up to you. More...
Inherits lpzrobots::TaskedSimulation, and lpzrobots::Simulation.
Public Member Functions | |
void | start (const OdeHandle &odeHandle, const OsgHandle &osgHandle, GlobalData &global) |
start() is called at the first start of the cycles and should create all the object (obstacles, agents...). | |
virtual bool | command (const OdeHandle &, const OsgHandle &, GlobalData &globalData, int key, bool down) |
is called if a key was pressed. | |
virtual void | bindingDescription (osg::ApplicationUsage &au) const |
this can be used to describe the key bindings used by command() | |
void | start (const OdeHandle &odeHandle, const OsgHandle &osgHandle, GlobalData &global, SimulationTaskHandle &sTHandle, int taskId) |
starting function (executed once at the beginning of the simulation loop/first cycle) This function contains the additional parameters simTaskHandle and taskId, with these you have access to your global data. | |
virtual bool | restart (const OdeHandle &odeHandle, const OsgHandle &osgHandle, GlobalData &global, SimulationTaskHandle &sTHandle, int taskId) |
restart() is called at the second and all following starts of the cylce The end of a cycle is determined by (simulation_time_reached==true) | |
virtual void | addCallback (GlobalData &globalData, bool draw, bool pause, bool control) |
optional additional callback function which is called every simulation step. | |
virtual bool | command (const OdeHandle &, const OsgHandle &, GlobalData &globalData, int key, bool down, SimulationTaskHandle &sTHandle, int taskI) |
is called if a key was pressed. | |
Public Attributes | |
AbstractController * | controller |
Sphererobot3Masses * | sphere1 |
OdeRobot * | vehicle |
OdeAgent * | agent |
Just create your own simulation, it's up to you.
It's essential that your simulation is deduced from TaskedSimulation instead of Simulation. With this little change you have access to the taskId and the global simTaskHandle.
virtual void addCallback | ( | GlobalData & | globalData, | |
bool | draw, | |||
bool | pause, | |||
bool | control | |||
) | [inline, virtual] |
optional additional callback function which is called every simulation step.
Called between physical simulation step and drawing.
draw | indicates that objects are drawn in this timestep | |
pause | always false (only called of simulation is running) | |
control | indicates that robots have been controlled this timestep |
Reimplemented from Simulation.
virtual void bindingDescription | ( | osg::ApplicationUsage & | au | ) | const [inline, virtual] |
this can be used to describe the key bindings used by command()
Reimplemented from Simulation.
virtual bool command | ( | const OdeHandle & | , | |
const OsgHandle & | , | |||
GlobalData & | globalData, | |||
int | key, | |||
bool | down, | |||
SimulationTaskHandle & | , | |||
int | taskId | |||
) | [inline, virtual] |
is called if a key was pressed.
For keycodes see: osgGA::GUIEventAdapter
Reimplemented from TaskedSimulation.
virtual bool command | ( | const OdeHandle & | , | |
const OsgHandle & | , | |||
GlobalData & | globalData, | |||
int | key, | |||
bool | down | |||
) | [inline, virtual] |
is called if a key was pressed.
For keycodes see: osgGA::GUIEventAdapter
Reimplemented from Simulation.
virtual bool restart | ( | const OdeHandle & | odeHandle, | |
const OsgHandle & | osgHandle, | |||
GlobalData & | global, | |||
SimulationTaskHandle & | sTHandle, | |||
int | taskId | |||
) | [inline, virtual] |
restart() is called at the second and all following starts of the cylce The end of a cycle is determined by (simulation_time_reached==true)
the | odeHandle | |
the | osgHandle | |
globalData |
Reimplemented from TaskedSimulation.
void start | ( | const OdeHandle & | odeHandle, | |
const OsgHandle & | osgHandle, | |||
GlobalData & | global, | |||
SimulationTaskHandle & | sTHandle, | |||
int | taskId | |||
) | [inline, virtual] |
starting function (executed once at the beginning of the simulation loop/first cycle) This function contains the additional parameters simTaskHandle and taskId, with these you have access to your global data.
Reimplemented from TaskedSimulation.
void start | ( | const OdeHandle & | , | |
const OsgHandle & | , | |||
GlobalData & | globalData | |||
) | [inline, virtual] |
start() is called at the first start of the cycles and should create all the object (obstacles, agents...).
Implements Simulation.