Robot Code Layout

From Robowiki
Jump to navigation Jump to search
Visualization of different robot layouts.

The layout of a robot is basically its design structure.

There are 3 basic types of structures used by robots.

Combined Layout

This structure is mostly used by codesize restricted or simple robots. Such as most Nano, Micro and Mini robots.


In this layout each part of the robot parts, such as the radar, gun and movement are all contained within the main robot file itself, this allows a very close tie between the parts of the robot allowing them to easily interact with each other.


This type of layout quickly gets unmanageable as to the number of methods and fields in the simple class grow, making locating and debugging code much more difficult.

Modular Layout

May also be called a Spider Layout. This layout is used in most megabots and otherwise large or well structured robots. It is used for its simplicity of design and ability to easily test many different options while designing a robot.

In these each of the parts of the robot, such as radar, gun and movement are separated out into easily interchanged classes, which are then encapsulated within the main robot in some fashion.


These modules are usually still tied closely to the robot they were designed for. However despite this, their self contained design makes them far easier to move to another robot then a non-modular design.


Attempting to have modules that rely on each other is a large source of code bloat for these robots, in which it cannot usually be done in a simple manner.

Tower Layout

This layout is rather unused, mostly due to some minor design complexities. This design does not have the benefits of the modular layout, and is more of an expanded Combined layout, with the robot's parts separated into different modules which are stacked on top of each other. One part of the robot extending the previous.


This layout is somewhat of a middle ground between a modular and a combined layout. Like a combined layout the modules can easily rely on each other, and like a modular layout the code is separated into easy to work on modules.


However this type of layout lacks modularity. So the ability to quickly and easily switch between different modules of the same type is lost. It also make it more difficult for other robots to adapt the modules into their code. There is also the issue of order of modules and calling and overriding methods, which make this layout somewhat more complicated to use.

This article is a stub. You can help RoboWiki by expanding it.