[Pogamut-list] Turning and moving at the same time?

nvh pogamut-forum at artemis.ms.mff.cuni.cz
Wed Jan 21 17:17:03 CET 2009


Turning and moving at the same time?

Author: nvh

I'm Niels, a Dutch master student that is currently working on his master thesis at IDSIA, Switzerland. I'm planning to use pogamut for my research, and I got it running fairly easily.
The goal of my research will be to control an UT2004 with neural networks. Right now I'm looking into pathplanning without the use of the navigational graph. 

To map the output of the neural network to moving actions in the bot I've created an generalization on of the move and turn functions on the AgentBody. Each logic loop (so every 1/8 of a second) the outputs of the neural network are converted to actions in the following way:

^
        body.turnHorizontal((int) Math.round(turn*180));
        move = Math.min(move*5, 2.0);
        if(move > 0.1)
        {
            body.contMove((float) (move));
        }
        else {
            body.stop();
        }
^

move and turn are doubles in the ranges [[0,1] and  [[-1,1]] respectively. The problem however is, that when I start a bot which is controlled by this piece of code, the bot only moves forward, and doesn't turn. When I place the ''turnHorizontal'' statement after the ''contMove'' statement, the bot only turns. 

Isn't it possible to issue a move statement and a turn statement in the same ''doLogic'' call? Or is there something else wrong with my implementation?





More information about the Pogamut-list mailing list