>xabsl 2
Behavior Documentation
>
Index
>Agents
>Symbols
>Basic Behaviors
>Options
>> handle-ball
>>>
approach-and-turn
>>>
turn-and-release
>>>
kick
Option handle-ball
The striker playing
State Machine
This browser can't display the SVG file
svg/option_handle-ball.svg
.
The
Adobe SVG Viewer 3.0
can be downloaded from
http://www.adobe.com/svg/viewer/install/main.html
State approach-and-turn
If that state is active,
>
The option
approach-and-turn
is executed. Parameters:
approach-and-turn.angle
=
angle.perfect-angle-to-opponent-goal
;
approach-and-turn.y-offset
=
(-50
*
sin
(
angle.perfect-angle-to-opponent-goal
))
;
>
These output symbols are set:
angle.angle-shown-by-leds
=
angle.perfect-angle-to-opponent-goal
The decision tree:
This browser can't display the SVG file
svg/option_handle-ball_state_approach-and-turn.svg
.
The
Adobe SVG Viewer 3.0
can be downloaded from
http://www.adobe.com/svg/viewer/install/main.html
Pseudo code of the decision tree:
if
(
strategy.ball-is-handled-at-the-moment
)
// ball is handled
{
transition-to-state(
approach-and-turn
);
}
else if
(
abs
(
angle.perfect-angle-to-opponent-goal
)
> 100
)
// opponent goal is behind
{
transition-to-state(
turn-and-release
);
}
else if
(
(
strategy.time-since-last-kick
> 1000
)
&&
(
ball.just-seen
)
&&
(
abs
(
ball.seen.relative-speed.y
)
< 150
)
&&
(
ball.seen.relative-speed.x
< 150
)
)
// kick possible
{
transition-to-state(
kick
);
}
else
{
transition-to-state(
approach-and-turn
);
}
State turn-and-release
If that state is active,
>
The option
turn-and-release
is executed. Parameters:
turn-and-release.angle
=
(
angle.perfect-angle-to-opponent-goal
- (30
*
sgn
(
angle.perfect-angle-to-opponent-goal
))
)
;
>
These output symbols are set:
angle.angle-shown-by-leds
=
angle.perfect-angle-to-opponent-goal
The decision tree:
This browser can't display the SVG file
svg/option_handle-ball_state_turn-and-release.svg
.
The
Adobe SVG Viewer 3.0
can be downloaded from
http://www.adobe.com/svg/viewer/install/main.html
Pseudo code of the decision tree:
if
(
strategy.ball-is-handled-at-the-moment
)
// ball is handled
{
transition-to-state(
turn-and-release
);
}
else if
(
(
strategy.time-since-last-kick
> 1000
)
&&
(
ball.just-seen
)
&&
(
abs
(
ball.seen.relative-speed.y
)
< 150
)
&&
(
ball.seen.relative-speed.x
< 150
)
)
// kick possible
{
transition-to-state(
kick
);
}
else if
(
abs
(
angle.perfect-angle-to-opponent-goal
)
< 80
)
// opponent goal is in front
{
transition-to-state(
kick
);
}
else
{
transition-to-state(
turn-and-release
);
}
State kick
If that state is active,
>
The option
execute-kick
is executed. Parameters:
execute-kick.action
=
retrieve-kick
(
angle.best-angle-to-opponent-goal-no-obstacles
,
angle.best-width-of-opponent-goal-no-obstacles
,
kick-selection-table.in-center-of-field
) ;
>
These output symbols are set:
strategy.ball-handling
=
performing-a-kick
angle.angle-shown-by-leds
=
angle.best-angle-to-opponent-goal-no-obstacles
The decision tree:
This browser can't display the SVG file
svg/option_handle-ball_state_kick.svg
.
The
Adobe SVG Viewer 3.0
can be downloaded from
http://www.adobe.com/svg/viewer/install/main.html
Pseudo code of the decision tree:
if
(
subsequent-option-reached-target-state
)
// kick finished
{
transition-to-state(
approach-and-turn
);
}
else
{
transition-to-state(
kick
);
}