A pattern language for the ET robot contest:
On embedded software engineering
MASASHI KADOYA†, TOSHIYUKI NAKANO†, TAKANORI OZAWA†, MASAHIKO WADA†,HIROKI ITOH†, HIRONORI WASHIZAKI†, YOSIAKI FUKAZAWA†
A pattern language for participants in the Embedded Technology (ET) robot contest is extracted.
Because the ET robot contest is a software design competition that provides young engineers or
students with an opportunity to learn embedded software engineering, most participants are beginners
and have difficulty designing the robot. To help participants, we have published an extracted apattern language on a website. This pattern language, named the ET Robocon Strategy, consists of
40 patterns extracted from our technical knowledge and contest experience. In this paper, fivepatterns that an engineer can apply to develop a robot with wheels are introduced.

1. Introduction
The Embedded Technology (ET) robot contest [4] is a national software design competition hosted by volunteers
who are software design experts. The purpose of the competition is to provide young engineers or students with theopportunity to learn embedded software design.
The contest has two divisions: a model division and a racing division. In the model division, documentation andsoftware design (specification document, class diagram, development process, etc.) are evaluated. [3] In the racing
division, participants design a two-wheeled robot, which must complete a predetermined course as fast as possibleusing a light sensor to trace a black line on the course. However, the line is not always solid and is even missing inparts of the course. Participants must account for these discrepancies in their robot design.
The robot must be composed of only LEGO MINDSTORMS, which is used for software engineering education.
However, the LEGO MINDSTORMS kit has some disadvantages. For instance, the performance of the motor provided
by LEGO MINDSTORM is not ideal for the contest, and greatly influences robot performance.
The course consists of two parts: the Basic Stage and the Bonus Stage. The Basic Stage tests the robot’s speed,
while the Bonus Stage tests the robot’s ability to successfully navigate obstacles (e.g., seesaws, stairs, etc.). As part ofthe Bonus Stage, the DRIFT zone lacks the black guidance line and the robot must pass between two plastic bottles.
The course differs every year, but most changes are in the Bonus Stage. However, there are common difficult points,
which means that patterns must be adaptable. Examples of difficulties include:
A portion of the course lacks a black line.

There are ~1-cm bumps on the course.

At certain sites, the ambient light is very strong.
In this paper, we introduce 40 patterns that are part of a pattern language called ET Robocon Strategy. This paper
will outline the pattern language and then will give the details of 5 of these patterns related to the absence of black line
and navigating bumps: Replication of Course, Course Rental, Drive Straight, Mapping the Course, and Ignoring theGray Zone. Two patterns introduced in this paper (Drive Straight and Estimating Robot's Location) are especially
important for a portion of the course lacking a black line.

Waseda University

1

Figures 1

the 2012 course and a sample robot.

22. ET Robocon Strategy Pattern Language
From October 2011 to June 2012, a pattern language called ET Robocon Strategy was extracted from members of
our lab (the Washizaki lab) who participated in the ET robot contest via workshops and interviews. The ET Robocon
Strategy consists of 40 patterns. Each pattern is composed of a Name, Picture, Context, Problem, Force, and Solution.
If a further explanation is needed, we add related patterns and cases.
The ET Robocon Strategy can be classified into four categories: Environment, Team, Model, and Programming.
Environment relates to failures of the robots and course setup. Team refers to issues of team members or the entire
team. Model is the specific know-how to improve one’s own model. Programming refers to the methodology tonavigate the robot through the course. Herein how the ET Robocon Strategy functions to resolve these problems ispresented. Table 1 is the summary of the ET Robocon Strategy. Each category is represented by the first letter of its
name (e.g., "E" represents Environment). Each category is sub-divided into various situations related to the patterns:‘Milestone', ‘Develop Process', ‘Early Development', ‘Model', 'Bump', ‘Ambient Light Measures', ‘State', ‘Light
Sensor', ‘A Way of Drive', ‘Ambient Light', ‘Course', and ‘Performance'. These situations help to make sure what
problems can happen. Of these 40 patterns, the bold five are discussed in this paper.

Pattern Name
Always Charging
A Difference of A
Motor's
Performance
Torment by Light

Table 1 Summary of Environment Category of the pattern language
Category
Situation
Contents
E
Bump
To always charge the robot battery.
E
A Way ofTo correct the difference in performance between the rightDriveand left motors with software.
E

Ambient Light

Check Contest
Hall
Two-Stage
Preparation
Replication of
CourseCourse Rental

E

Ambient LightE

Ambient LightTo shine a flashlight on the course to confirm whether the
robot can deal with ambient light.
To check the contest hall before starting the contest to
confirm that there is ambient light.
To adopt both Cancel Strong Ambient Light and Calibration.

E

CourseTo buy a replica of the actual course.

E

CourseTune Up in
Contest Hall
Starting ThroughMeasures
Searching Causeof Problem

E

Performance

To borrow another team’s course replica if Replication of
Course is not adopted.
To confirm the state of the robot before starting the run.

E

Performance

E

none

Pattern Name
Anyways PID
Jerked Forward
and Stop
Cancel Strong
Ambient Light
Calibration
Estimating
Robot's Place
Confirmation of

To make a list of what the team should confirm before thecontest.
To check for any uncertainties in this pattern language.

Table 2 Summary of Programming Category of the pattern language
Category
Situation
Contents
P
Early
To develop the first PID method.
Development
P
Bump
To design a robot that jerks forward and stops to ride over abump.
PAmbient Light To embed methodology which cancels strong ambient light.
MeasuresP
Ambient Light To calculate differences between the color values and to
Measuresdesign the robot to trace a black line.
P
State
To estimate robot's location by its sensor.
P

State

To check the state of the robot by a log that records a value
3

Robot's State by
Log
Ignoring Gray
Zone Drive
Tail Drive
Mapping Driveof the robot’s sensor.
P

Light Sensor

To design the robot to go through gray zones.

P
P

Light Sensor
A Way ofDrive
A Way of
Drive
Early
Development
Bump

To take a robot's tail on the course and run.
To automatically store the course map on the robot.

Straight DriveP

Anyways PID

P

Jerked Forward
and StopP

Pattern Name
Winning Model
The Third Eyes
Why Trace
Championship
Model
Judges Liking
To Study is To
ImitatePlain Model

Pattern Name
Big Goal
Daily Goal
Personal Goal
Concurrent
Development with
Many Robots
Priority Ranking
of Difficult Place
Separation of
Senior and Junior
Team
Understand The
API
Share The
Contract
About Five
PersonExchange with
Other Team
Skillful Begging
Friendship of aTeam

To design the robot to go straight.
To develop the first PID method.
To design a robot that jerks forward and stops to ride over a
bump.

Table 3 Summary of Model Category of the pattern language
Category
Situation
Contents
M
Model
To fulfill each element of a model better than the other teams.
M
Model
To get advice from other people.
M
Model
To continue to question why the current model has been
made.
M
Model
To make the championship model differ clearly from previous
models.
M
Model
To research the judges’ preferences.
M
Model
To imitate a model that was highly rated.
M

Model

To decorate a model for understandability.

Table 4 Summary of Team Category of the pattern language
Category
Situation
Contents
T
Milestone
To have a big goal as a team.
T
Milestone
To have a daily goal as a team.
T
Milestone
To have an individual goal for the contest.
T
Develop
To prepare multiple robots for concurrent development.
ProcessT

Develop
Process
Early
Development

To determine the priority of difficult places on the course.

To understand the API before starting development.

T

Early
Development
Early
Development
Early
Development
none

T
T

none
none

T

T
T
T

To separate a team into expert and beginner members.

To share the confirmation of the contract of the contest.
To develop in a team of about five people.
To make exchanges with other teams to gain more
information.
To ask for help from a colleague or a superior.
To make deep friendships with other team members.

42.1. Replication of Course
This pattern is concerned with creating a practice course that is nearly identical to the one used in the contest.

Context
The team is developing a robot to run on a specific course.

ProblemWithout an accurate course to practice running the robot, a team cannot fully understand the course environment
used in the contest and cannot develop good tests for the robot to prepare for the course. So how can the team create
the best environment to make sure they develop the robot the best and are prepared for the contest?

ForcesIt is important that the team has enough space to prepare a practice course.
A team has sufficient funding.  Creating a separate course can be expensive.
Not fully understanding the surface of the course causes issues with the robot's mobility because the course
surface influences the robot's performance. Then, the robot will veer off course. If the surface of the course of
the contest is harder than that of practice, the robot may act more than you can image.  Although it is aserious matter that the team has enough space, setting up the ground corresponded to the course is very hard.
Not fully understanding the course layout, it is difficult to accurately position the robot in the course. An
5inability to recognize the robot’s position in each Bonus Stage leads to mistakes. In particular, when thecourse lacks a black line, it is extremely difficult to apply the Mapping the Course pattern.

Solution
After ensuring that the team has sufficient space (5460mm×3640mm), purchase and setup a replica course.
This should be as close to the competition course as possible. If the team doesn’t have the space or money, then createa smaller course to at least partially replicate the course for testing.
Also, an important part of the solution is that the robot must move on a hard surface (e.g., a table) because
surface hardness affects the robot’s movements. Practicing on a surface covered with a soft material (e.g., carpet) is notrecommended. Ideally, the replica course should be built on Styrofoam, which is the actual contest surface.
Furthermore, it is important to smooth the creases in the course as much as possible.
As an example of this pattern, for our contest, we purchased for 140,000 yen (about $1,400 US dollars) the course
shown in Figure 7 from Afrel (URL: http://www.afrel.co.jp/et2013_course.html). This course was setup and madeavailable for the following period (e.g., 2013 years):First: from May 7 to May 14
Second: from June 3 to June 10

PUT A Real PICTURE HERE
Figure 2

Results
For the 2012 contest, our lab purchased a replica course, allowing the robot to be accurately positioned on thecourse. However, we did not verify that there was sufficient space to build the course, and had to practice tuning therobot on carpet. Consequently, the Mapping the Course pattern was not accurately embedded, and the robot veered off
6

course during the contest.

Related Pattern
If a team lacks funding or the proper space to replicate the course, another option is Course Rental.

7

2.2. Course Rental
If it is infeasible to adopt Replication of Course, another option is Course Rental in which a practice course isrented from another team.

Context
A team does not have sufficient funds and/or space to replicate the course.

Problem
Similar to Replication of Course, the team must be able to get a course that they can build and test the robot on.
However the team is lacking the resources or money to replicate or build their own course. So how can the team get acourse that can help them build and test their robot with?

ForcesA team can have a close relationship with other teams, and can exchange and/or share resources.
Teams might be rivals and competing.  Observing how other team works out their strategy leads to invent
new idea.
A team might not have time to build a replicated course.  But a team can’t understand accurate position of
Bonus Stage.
Replicating a course can be very expensive.  If the team creates newly replicating course, the robot veers
in the actual contest because of difference of reflection of light
A course can take up a lot of space and the team might have limited space available.  The team can rent
space like conference room. But it still more costs money.

Solution
If two teams have a relationship, one team can rent the course from the other. This one-sided rental differs froman Exchange with Other Teams. The forces in the Exchange with Other Teams pattern include a give-and-takerelationship in regards to resource sharing. Although the Exchange with Other Teams involves cooperation, the teams
are rivals during the contest, and the course lending is a mock competition to simulate the actual contest.
Another thing that be considered is that the two teams can share the cost of replicating the course. So if one teambuilds it and rents to the other team, it can save the team that built it money.

Resulting Context

8In the 2011 and 2012 contests, we rented our course to a team from another university. In these cases, course rental
was one-sided as we provided the practice course and information. However, in 2013, we did not have a practicecourse, but due to building relationships in previous years, we were able to easily rent a practice course.

* Exchange with other teams:
Teams have close relationships, and exchange or share resources.
Forces:
It is possible to interact with other teams physically or virtually via the Internet.

Although each team provides useful information, the teams are rivals in the actual competition.

A team can provide other teams resources such as past design models or a course replica.

92.3. Drive Straight
The robot must go straight automatically to easily navigate the Bonus Stage.

Context
The robot must have a driving system that is independent of the robot’s light sensor in order to traverse the Bonus
Stage without a black line or with a gray line, which may not be detected by the light sensor. Additionally, the driving
system must possess speed as well as climb stairs, seesaws, etc.
A team should resolve these problems of Motor Speed Tuning and Course Replication.

ProblemFirst, a system to automatically navigate the course regardless if there is a black line to follow must be embedded.
However, development of an automatic system is costly. It is very difficult to gain speed when the robot follows a line
because the robot shakes to the right and left. So how can the team make it such that the robot can go straight evenwith a line and when it climbs?

ForcesThe performance difference between different motors is small. Although the developer tunes the robot
properly, the small difference will cause the robot to pivot slightly.]
If Drive Straight is applied toward wrong direction, the robot can’t come back on black line..
The team determines accurately the position where the robot should pause because the robot should comeback on black line. So applying frequently Drive Straight is a high risk.

Solution
The team must develop a system that allows the robot to travel straight. One way is shown in Motor Speed
Tuning. It is to correct the performance difference between the right and left motors using software. The way to solve
this problem is below.
STEP1: Get the initial value of rotations of right and left motor in a place where the robot should travel straight.
STEP2: Compare difference between the current value and the initial value by 4mm sec when the robot moves a little
forward.
STEP3: Move one of motor which rotates less than another of that.
The source codes developed actually are shown below.
float StraightDriver::steer(float velocity) {//get a value of a right motor.
int rightWheelCount = getRightMotor().getCount() - initialRightWheelCount;//get a value of a left motor.
int leftWheelCount = getLeftMotor().getCount() - initialLeftWheelCount;//compare a value of right and left motor.
10int countDiff = rightWheelCount - leftWheelCount;/*"degree" is positive value: rotate to the left for numerical value of "degree".
"degree" is negative value: rotate to the right for numerical value of "degree".
if(countDiff > 0){
degree = 5;}else if(countDiff < 0){degree = -5;}else{
degree = 1;}*/

return degree;}

Straight drive is applicable to various scenes.

The team wants to embed Mapping the Course.
By combining Straight Drive, the robot can move with complete freedom on most courses, but the robot
must also be able to turn around on a spot.
The robot must have speed and a system for climbing.

As the robot gains speed, it ignores the line and goes straight. For more speed, refer to Jerking Forward andStopping.

If the robot does not approach the bumps straight-on, one of its wheels may fall off.

Resulting Context
In the actual contest, our robot could traverse the seesaw and stairs. In addition, the robot could cancel the line trace
as it went through the gray zone.

112.4. Mapping the Course
The robot is programmed to move automatically through the course without relying on the light sensor.

Context
The team adopted Replication of Course or Course Rental, and the team makes sure that the environment forpractice is well-regulated. Moreover, it is guaranteed that the robot goes straight along smoothly.

Problem
The light sensor does not work in the Bonus Stage where the line is missing. Additionally, because ambient lightaffects the light sensor, the robot may veer off course when using the light sensor. Although the Canceling Ambient
Light pattern can resolve this problem, it is difficult to embed. So how can the team make it such that the robot
move automatically in a place where the line is missing?

Forces

Even if the team makes the robot move automatically, it is very difficult that the robot moves just as expected
because there is difference of hardness of surface between the course of the contest and practice.
Because the robot should enter straightly toward black line when the robot comes back on black line, the teamshould be careful of applying Mapping the Course.
As the former forces are written, Mapping the Course has a high risk. But the robot can take a shortcut acrossthe course having no black line if the robot succeeds Mapping the Course. It can reduce time a lot.

Solution
These problems can be solved by programming the robot to memorize the turning points on the course and toignore the line. Adopting Estimating Robot's Location makes sure accurately the robot’s location to use various
sensors. For more detailed explanation, the way to estimate the robot's location is that the robot knows itself the valueof angle, rotating of motors, and time. When the team confirms that the robot understands a place where it should start
Mapping Drive, the team adds and combines the method of Drive Straight and rotating to the robot.
However, due to Motor Speed Tuning problems, it is difficult for the robot move on “memory”, especially if thecourse is not exactly replicated.

12

2.5. Ignoring the Gray Zone
The robot can navigate the gray zone by combining Straight Drive and Estimating Robot's Location.

Context
The robot must drive on a gray line because gray line mixed black line. This reason is that gray zone indicates that
there is Bonus Stage on the front of gray zone.
Straight Drive should be embedded into the robot. And the robot can determine accurately its location by adopting
Estimating Robot’s Location.

Problem
Detecting the gray line is extremely difficult because the robot’s cords can interfere with the light sensor. Thus, it isdifficult for the light sensor to detect the value of color, causing the robot to deviate off course. So how does the robot
pass through the gray line?

Forces

A light sensor occasionally recognizes the gray line as the black line. However it depends on the situation of
the contest. If the robot can recognize the gray line as the black line, the team should not apply following thesolution because it only increases a risk.
If the robot detects gray zone, the robot can make sure its location. But applying this pattern leads to lose thispossibility.
If the team decides the distance of ignoring gray zone, the robot can’t come back on black line.

Solution
The robot can recognize the gray zone by combining the patterns of Straight Drive and Estimating Robot's
Location. First, the robot should “memorize” the start of the gray zone using the Estimating Robot's Location tomeasure the distance and angle of the robot. When the robot recognizes it has arrived at the front the gray zone, it cango forward a definite distance by changing to Straight Drive mode, allowing the gray zone to be ignored because thegray zone always is straight.

* Estimating Robot’s Location:
To estimate the robot's location by various sensors.

13

Conclusion and Future Work
We have extracted a pattern language consisting of 40 patterns from our technical knowledge and contest
experience. We applied five of these patterns to the 2012 ET robot contest. Although we were able to recreate apractice environment, the Mapping Drive pattern did not work very well and the robot moved liked it was on thepractice course. This reason may be that the contest surface was harder than the practice surface or that the robot turnedmore than expected. Thus, Mapping Drive needs fine tune adjustments when creating a practice course.
This pattern language for the ET robot contest is still being developed. Currently, we are collecting input using Wikiand discussing a pattern language in workshops about the contest. In the future, we plan to extract a pattern languagethat can be applied to embedded development and to the development of the ET robot contest.

Acknowledgement
We thank for shepherd Joseph W. Yoder for very careful review that improve this paper.

Reference
1)
2)
3)

4)
5)
6)

Gerard Meszaros, Jim Doble, “A Patten Language for Pattern Writing”, PLoP’97.
Kouichiro Eto, “Origin and Evolution of Wiki”, SIGHCI 2007.
Hironori Washizaki, Yasuhide Kobayashi, Hiroyuki Watanabe, Eiji Nakajima, Yuji Hagiwara, Kenji Hiranabe
and Kazuya Fukuda, "Experiments on Quality Evaluation of Embedded Software in Japan Robot Software
Design Contest," Proc. 28th International Conference on Software Engineering (ICSE 2006), May 2006.
“ET robot contest 2012”, http://www.etrobo.jp/2012/gaiyou/intro.php“nxtOSEK”, http://lejos-osek.sourceforge.net/index.htm
Masashi Kadoya, Toshiyuki Nakano, Takanori Ozawa, Masahiko Wada, Hiroki Itoh, Hironori Washizaki,
Yosiaki Fukazawa, “A pattern language for ET robot contest”, GuruPLoP, May 2013.

14