AllRounder
Description
Play soccer in the all rounder position, which is a multi-purpose position for when only one robot is active. Either bypass GameController and force play, or uses GameController information to decide what to do.
In the ready state, makes a Ready subtask.
In the playing state (for both normal game mode and penalty shootout), finds the ball, fixates on the ball, walks to the ball, and kicks the ball.
In other states, stands still.
Usage
Add this module to play as a all rounder in soccer!
Consumes
message::input::GameStateto get information about the state of the gamemessage::input::GameState::Data::Phaseto get specific information about the current game phase (initial, ready, set, playing, etc).message::strategy::AllRoundera Task requesting to play as a AllRoundermessage::strategy::NormalAllRoundera Test requesting to play as a AllRounder in the normal game statemessage::strategy::PenaltyShootoutAllRoundera Task requesting to play as a AllRounder in the penalty shootout game state
Emits
message::strategy::NormalAllRoundera Task requesting to play as a AllRounder in the normal game statemessage::strategy::PenaltyShootoutAllRoundera Task requesting to play as a AllRounder in the penalty shootout game statemessage::strategy::Readya Task requesting to walk to the ready positionmessage::strategy::StandStilla Task requesting to stand still and not movemessage::strategy::FindBalla Task requesting to look and move around to find the ballmessage::strategy::LookAtBalla Task requesting to look at a known ballmessage::strategy::WalkToBalla Task requesting to walk to a known ballmessage::strategy::AlignBallToGoala Task requesting to align the robot to face the goal with the ball infront of itmessage::planning::KickToGoala Task requesting to kick the ball towards the goal
Dependencies
Defender
Description
Play soccer in the defender position. Either bypass GameController and force play, or uses GameController information to decide what to do.
In the ready state, walks to a position on the field.
In the playing state for normal game mode, finds the ball, fixates on the ball, walks to the ball if the ball is in the defenders bounded box defensive area, and kicks the ball.
If ball is outside bounded box area and ball is in opposition half, defender is clamped to the edge of bounding box closest to ball.
If ball is outside bounded box area and ball is in own half, defender is clamped to the edge of bounding box closest to ball and position itself 1 meter behind the ball.
Usage
Add this module to play as a defender in soccer!
Consumes
message::input::GameStateto get information about the state of the gamemessage::input::GameState::Data::Phaseto get specific information about the current game phase (initial, ready, set, playing, etc).message::purpose::Defendera Task requesting to play as a Defender
Emits
message::strategy::WalkInsideBoundedBoxa Task requesting to stay within a bounded area on the field.message::strategy::StandStilla Task requesting to stand still and not movemessage::strategy::FindBalla Task requesting to look and move around to find the ballmessage::strategy::LookAtBalla Task requesting to look at a known ballmessage::strategy::WalkToBalla Task requesting to walk to a known ballmessage::strategy::AlignBallToGoala Task requesting to align the robot to face the goal with the ball in front of itmessage::planning::KickToGoala Task requesting to kick the ball towards the goal
Dependencies
Goalie
Description
Play soccer in the goalie position. Either bypasses GameController and force playing, or uses GameController information to decide what to do.
In the ready state, walks to the goals.
In the playing state (for both normal game mode and penalty shootout), finds the ball, fixates on the ball and dives if the ball is close.
Usage
Add this module to the role and emit a Goalie Task.
Consumes
message::input::GameStateto get information about the state of the gamemessage::input::GameState::Data::Phaseto get specific information about the current game phase (initial, ready, set, playing, etc).message::strategy::Goaliea Task requesting to play as a Goaliemessage::strategy::NormalGoaliea Test requesting to play as a Goalie in the normal game statemessage::strategy::PenaltyShootoutGoaliea Task requesting to play as a Goalie in the penalty shootout game state
Emits
message::strategy::NormalGoaliea Task requesting to play as a Goalie in the normal game statemessage::strategy::PenaltyShootoutGoaliea Task requesting to play as a Goalie in the penalty shootout game statemessage::strategy::StandStilla Task requesting to stand still and not movemessage::planning:::LookArounda Task requesting to look around for the ballmessage::strategy::LookAtBalla Task requesting to look at a known ballmessage::strategy::DiveToBalla Task requesting to dive to the ball if it is close enoughmessage::strategy::WalkToFieldPositionTask requesting to walk to position on field
Dependencies
KeyboardWalk
Description
Starts the Director graph for the KeyboardWalk scenario.
Keyboard walk uses keyboard inputs to control the robot. The inputs available are detailed in the following table.
| Command | Description |
|---|---|
| e | Toggles the walk on and off. Initially it is off. |
| w | Adds 0.01 to the walk command x-value. This value is in meters/second. |
| s | Adds -0.01 to the walk command x-value. This value is in meters/second. |
| a | Adds 0.01 to the walk command y-value. This value is in meters/second. |
| d | Adds -0.01 to the walk command y-value. This value is in meters/second. |
| z | Adds 0.1 to the walk command rotational value. This value is in radians/second. |
| x | Adds -0.1 to the walk command rotational value. This value is in radians/second. |
| , | Runs the kick with the left foot. |
| . | Runs the kick with the right foot. |
| g | Runs the get up. |
| ← | Head turns to the left. |
| → | Head turns to the right. |
| ↑ | Head turns upwards. |
| ↓ | Head turns downwards. |
| r | Resets keyboardwalk. Head rotation is set to 0. Walk command is set to 0. |
| q | Quits keyboardwalk. |
Usage
Include this in your role to start the Director tree to run KeyboardWalk.
Consumes
Emits
message::strategy::StandStillto make the robot still while not walkingmessage::behaviour::state::Stabilityto set the robot's initial stability statemessage::strategy::FallRecoveryto enable getting up when fallenmessage::skill::Kickto kick with left/right legmessage::skill::Lookto look in desired directionmessage::skill::Walkto walk with desired velocity
Dependencies
Script Runner
Description
Allows scripts to be run from the command line.
Usage
ScriptRunner will attempt to run each command line parameter as a script. Once the first script has completed it will run the next, and so on until all are finished at which point it terminates the program.
Consumes
NUClear::message::CommandLineArgumentscontaining the list of scripts from the command line
Emits
message::actuation::LimbsSequencethrough the Script utility, which populates the requested Script/s into LimbsSequences.
Dependencies
Script Tuner
Description
Provides a curses interface for creating, editing and tweaking scripts.
Usage
The program must be started with the name of a script file to edit as its sole command line argument. If the file does not exist then a new blank script is started and the file will be created when it is saved.
The keyboard controls are as follows:
- Up/Down arrow: Select servo
- Left/right arrow: Select angle or gain
- , (comma): Go to previous frame
- . (period): Go to next frame
- Enter: Edit selected field
- Space: Toggle motor lock
- : (colon): List available commands
- A: Save script as
- G: Allows multiple gain edits at once
- I: Delete current frame
- J: "jump" to frame without the robot moving
- M: Mirror script - flip about sagittal plane
- N: Insert a new frame before the current frame
- R: Refresh the view
- S: Save script
- T: edit frame duration
- X: Shutdown powerplant/stop binary
Consumes
NUClear::message::CommandLineArgumentscontaining the name of the script to editmodule::behaviour::tools::LockServo(internal to this class only) to trigger servo lock eventmessage::platform::RawSensorsto get position of specific servo when locking it
Emits
message::actuation::ServoTargetto control currently selected servo when locked or unlockedmessage::actuation::ServoTargetsto control all servos when transitioning between framesmessage::actuation::LimbsSequenceto play the scriptmodule::behaviour::tools::LockServo(internal to this class only) to trigger servo lock event
Dependencies
- libncurses is used for the user interface
Soccer
Description
Starts the Director graph for the soccer scenario. If the robot is penalised, it will make it stand still. Otherwise, it will emit the Task corresponding to the soccer position specified in configuration.
If the configuration is set to "dynamic" it will choose the appropriate position out of Defender and Striker. The robot listens for the positions of other robots and makes its decision.
Possible positions are Striker, Goalie and Defender.
Usage
Include this in your role to start the Director tree to play soccer.
Consumes
message::purpose::FindPurposeto find the right purpose to emitmessage::input::Robocupto dynamically determine the robot's purposemessage::localisation::Ballto determine the robot's distance to the ball, for comparison with other potential strikersmessage::input::Sensorsto transform the ball from world to robot spacemessage::input::GameEvents::Penalisationto find out if the robot has been penalised and should stop movingmessage::input::GameEvents::Unpenalisationto find out if the robot has been unpenalised and can play againmessage::input::ButtonMiddleDownto force play with a middle button press
Emits
message::purpose::FindPurposea Task to request to find the robot's soccer playing purpose, to start the Director graph to play soccermessage::purpose::Purposesto inform the other robots of their purposesmessage::strategy::StandStillto make the robot still while penalisedmessage::platform::ResetWebotsServosto reset the servos in Webots when penalisedmessage::behaviour::state::Stabilityto set the robot's initial stability state to standingmessage::strategy::FallRecoverya Task to request the robot to manage fallingmessage::purpose::Strikera Task to request the robot acts as a strikermessage::purpose::Goaliea Task to request the robot acts as a goaliemessage::purpose::Defendera Task to request the robot acts as a defender
Dependencies
Striker
Description
Play soccer in the striker position, which is an offensive position. Either bypass GameController and force play, or uses GameController information to decide what to do.
In the ready state, makes a Ready subtask.
In the playing state (for both normal game mode and penalty shootout), finds the ball, fixates on the ball, walks to the ball, and kicks the ball. It will not approach the ball if it is not in its own bounding box, and instead will stand nearby.
In other states, stands still.
Usage
Add this module to play as a striker in soccer!
Consumes
message::input::GameStateto get information about the state of the gamemessage::input::GameState::Data::Phaseto get specific information about the current game phase (initial, ready, set, playing, etc).message::strategy::Strikera Task requesting to play as a Strikermessage::strategy::NormalStrikera Test requesting to play as a Striker in the normal game statemessage::strategy::PenaltyShootoutStrikera Task requesting to play as a Striker in the penalty shootout game state
Emits
message::strategy::NormalStrikera Task requesting to play as a Striker in the normal game statemessage::strategy::PenaltyShootoutStrikera Task requesting to play as a Striker in the penalty shootout game statemessage::strategy::Readya Task requesting to walk to the ready positionmessage::strategy::StandStilla Task requesting to stand still and not movemessage::strategy::FindBalla Task requesting to look and move around to find the ballmessage::strategy::LookAtBalla Task requesting to look at a known ballmessage::strategy::WalkToBalla Task requesting to walk to a known ballmessage::strategy::AlignBallToGoala Task requesting to align the robot to face the goal with the ball infront of itmessage::planning::KickToGoala Task requesting to kick the ball towards the goalmessage::strategy::WalkInsideBoundedBoxa Task requesting that the robot stays within a defined bounded box
Dependencies
Tester
Description
This module allows the user to select various combinations of strategies and planners with different priorities for testing purposes. For example, you may want to only test walking to the ball and kicking, which can be achieved by only enabling the WalkToBal and KickTo tasks in the config.
Usage
Add this module and enable/disable strategies and planners in the config which you wish to test.
Consumes
Emits
If enabled in the config the module emits the following.
message::strategy::StandStilla Task requesting to stand still and not movemessage::strategy::FindBalla Task requesting to look and move around to find the ballmessage::strategy::LookAtBalla Task requesting to look at a known ballmessage::strategy::WalkToBalla Task requesting to walk to a known ballmessage::strategy::AlignBallToGoala Task requesting to align the robot to face the goal with the ball infront of itmessage::planning::KickToGoala Task requesting to kick the ball towards the goalmessage::planning::KickToa Task requesting to kick the ball if closemessage::strategy::StandStilla Task requesting the robot to stand stillmessage::strategy::LookArounda Task requesting the robot to look aroundmessage::strategy::WalkToFieldPositiona Task requesting the robot to walk to a specified position
Dependencies
- Eigen