[Pogamut-list] On AutoTraceRay in Pogamut 2.3-2.4.1

RT@ICE pogamut-forum at artemis.ms.mff.cuni.cz
Thu Oct 15 13:36:01 CEST 2009


On AutoTraceRay in Pogamut 2.3-2.4.1

Author: RT at ICE

Hello from Japan!

In Pogamut 2.2, by adding into the constructor as follows:

body.addRayToAutoTrace(1, new Triple(0, -1, 0), SENSOR_LENGTH, true, false);
body.addRayToAutoTrace(2, new Triple(0, 1, 0), SENSOR_LENGTH, true, false);

and with the following line

ArrayList traces = memory.getAutoTraces();

all information on AutoTraceRay could be successful assigned to traces.

However, in the subsequent versions of Pogamut 2, 2.3-2.4.1, the above usage does not work. As a result, the following method we use for obtaining the distance to the wall always return -1, causing our bot (ICE-2009) to occasionally crash into the wall at BotPrize2009(:cry:). We note here that the following method works for Pogamut 2.2.

double getSensorResult(String id){
//        log.info("How many sensor?:"+traces.size());
        for(int i=0;i < traces.size();i++){
                if(traces.get(i).UnrealID.equals(id)){
                        if(traces.get(i).result){
                                return
Triple.distanceInSpace(memory.getAgentLocation(), traces.get(i).hitLocation);
                        }else{
                                return SENSOR_LENGTH*2;
                        }
                }
        }
        return -1;//Error
}

Do you have any ideas on how to fix this problem for Pogamut 2.3-2.4.1?

Thanks in advance.

Cheers,

ICE-2009 member





More information about the Pogamut-list mailing list