skip to main content

CSE@UTA

CSE High School Robot Programming Contest
FAQs, Tips & Tricks.

1. I'm having trouble getting the robot's program to transfer to the robot.

Some fluorescent lights (often "full spectrum" bulbs) emit infrared light that interferes with downloading to the robots. To circumvent the problem, try the following: -- turn the lights off; do the download in a room the lights off; or place something around the sensor & emitter (like cardboard).

2. Is it possible to use some form of resistance to permit 2 bumper sensors to be used on 1 input?

A: Yes, it is allowed to use a resistance to connect two sensors to one sensor port.

3. What kind of additions are the teams limited to?

A: You are allowed to do small modifications to the original lego robots such as changing the tires to change their friction on the floor (or to change their diameter), or to add different whiskers or bumpers (which, depending on the desired shape, can be hard to build exclusively from lego parts). The main limitations are that you can not add any additional sensors, or computational resources (It still has to be a lego robot and use the RCX to do all the computing). Also, the robot has to follow the rules, i.e. at the start it can not overlap any grid cell other than the start cell (i.e. if the robot is relatively big most of it will initially have to be outside the maze.

4. What types of program modifications are permitted at the time of the competition ?

A: In the first round of the tournament we provide a limited amount of time between the two runs for teams to recalibrate their sensors or to fix their code. This is only intended to fix mistakes made in adjusting the sensors to the lighting and floor conditions, or to fix an apparent program error that occurred in the first run (such as a crash of the program). Teams are not permitted to switch to a different program or to include any information about the maze. This will be monitored and violations will lead to immediate disqualification.

5. What does "autonomously acquired information" mean in the competition rules?

A: Autonomously acquired implies that the robot has to gather the information without intervention by the programmer or PC. It is ok in the competition if the robot remembers things from the first run (e.g. which turn was a dead end) and uses this information in the second run of the round. Basically, whatever happens inside the program is ok and does not have to be erased between different runs or rounds. On the other hand, no information about the maze can be transmitted by a programmer or from the PC.

6. How can you store data in the RCX and transfer it between runs ?

A: The basic idea is that the RCX does not actually delete anything in memory and everything you wrote to memory in one run will be still there when you start it again. The only problem is that all variables you declare will be initialized to 0 when you start the program. You can overcome this problem by saving the information in an allocated piece of memory. If you free all memory correctly, then the allocation will always assign the same piece of memory and the information will still be there. You can try the following:

int *mem;
mem = (int *)malloc(sizeof(int));
cputw(mem[0]);
mem[0]++;
free(mem);

This allocates the space for one integer variable, prints it to the display, increments its value, and then frees the memory. If all other memory is freed correctly, then the next time you run the program it will allocate the same piece of memory and you will see that the value on the display will increase by 1 every time you start the program (if you did not free all the memory it will allocate a different piece of memory and this will not work). Also, in case you do not know when to free the memory, the last piece you allocate can be freed immediately without corrupting the data (even though this is not the cleanest way to manage your memory). E.g.

mem = (int *)malloc(sizeof(int);
free(mem);
cputw(mem[0]);
mem[0]++;

will do the same as the program above (as long as you make sure there is no call to malloc after the free). Another possibility to maintain data is to not actually shut down the program but to move it back to the beginning once you exit the maze or once you press a button. For the latter you would have to reprogram the buttons (the include file for the button functions is dkey.h ).

 

Labeled with ICRA