Hi there. I have a little issue with the CONNECT function while on the DIAGNOSIS module.
I search for a sample with the highest Health value to retrieve it from the module.
On the first round it works perfectly well, the robot collects the molecules and it brings these to the LABORATORY.
You must output only one command per turn (iteration of the infinite while loop), else your commands will be desynchronised from the inputs you’re receiving and viewing in the viewer/console.
Actually I am doing a GOTO DIAGNOSIS, CONNECT 1, GOTO MOLECULES, CONNECT B (4x), GOTO LABORATORY in one while loop. After that it goes to the beggining of while(1) goes though the for () functions and I try to do the same process as before but this time with 5 as ID, but instead of doing CONNECT 5 it does CONNECT 1.
Do you suggest of doing the following:
while(1) loop does GOTO DIAGNOSIS… end of while(1)
while(1) loop does CONNECT 1… end of while(1)
while(1) loop does GOTO MOLECULES … end of while(1)
To make a somewhat weird parallel, imagine you were driving but instead of seeing with your eyes continuously, I was sending you screenshots of what you see every second, would you take your driving decisions for the next kilometre from the first screenshot only?
You wouldn’t. Instead you would check the first screenshot, take a decision (keep on, slow down, turn, etc), see next screenshot, another decision etc…
I have a similar problem but I’m quite sure that I only print one action per iteration in the infinite while loop.
Still the output I get from my debugging statements seem to be wrong. My bot is still standing at DIAGNOSIS but the target variable has value MOLECULES. Can there be another reason in my case?