Since the old engine was to heavy to install I decided to migrate to a light version using Rust and Iced.
A Rust-based engine for RoboCup Small Size League (SSL) robots. It handles vision data (SSL-Vision), the game controller (ssl-game-controller), robot control via radio or grSim simulation, and exposes a Lua scripting interface for strategy code. A desktop GUI is built with Iced.
Install Rust via rustup:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | shRequires Rust 1.75+ (edition 2021). No external protoc binary is needed — protobuf code generation is handled by a pure-Rust build script.
On Debian/Ubuntu, install the libraries required by the GUI and serial-port crates:
sudo apt-get update
sudo apt-get install -y \
pkg-config \
libudev-dev \
libxkbcommon-dev \
libx11-xcb-dev \
libxcb1-dev \
libxcb-render0-dev \
libxcb-shape0-dev \
libxcb-xfixes0-dev \
libxcb-icccm4-dev \
libxcb-image0-dev \
libxcb-keysyms1-dev \
libxcb-randr0-dev \
libxcb-render-util0-dev \
libxcb-xinerama0-dev \
libglvnd-dev \
libgl1-mesa-dev \
libwayland-dev \
libdbus-1-devNo additional system dependencies are required on Windows.
cargo buildcargo build --releaseThe compiled binary will be located at:
- Linux:
target/release/engine - Windows:
target\release\engine.exe
cargo run --releaseOr run the pre-built binary directly:
# Linux
./target/release/engine
# Windows
.\target\release\engine.exeThe engine opens a desktop GUI window. Use the sidebar panels to configure:
- Vision — SSL-Vision multicast address and port (default
224.5.23.2:10020) - Control — manual control
- Radio — serial port and baud rate for hardware robots
- Recording — log robot states to CSV
- Kalman — tracker filter settings
Strategy logic is written in Lua 5.4 scripts. Example scripts are provided in scripts-test/:
| Script | Description |
|---|---|
script.lua |
Minimal example: move robot 0 to the origin |
draw_demo.lua |
Square path following with visual overlay |
Load a script from the GUI toolbar or pass the path through the interface. The engine reloads the script on each tick, calling the process() function.
The engine exposes these functions to Lua scripts.
Conventions:
team:0= blue,1= yellow- Point/table arg:
{x = number, y = number} - Optional args marked with
?use the default values shown below
send_velocity(id, team, vx, vy, omega)Sends direct velocity commands.move_to(id, team, {x=, y=})Move robot toward a target point using the default motion controller.move_direct(id, team, {x=, y=})Move robot directly toward a point (no path planning).face_to(id, team, {x=, y=}, kp?, ki?, kd?)Rotates robot to face a target point. Defaults:kp=1.0,ki=1.0,kd=0.1.kickx(id, team)Trigger straight kick.kickz(id, team)Trigger chip kick.dribbler(id, team, speed)Set dribbler speed, clamped to[0.0, 10.0].
get_robot_state(id, team) -> tableReturns:{id, team, x, y, vel_x, vel_y, orientation, omega, active}.get_ball_state() -> tableReturns:{x, y, vel_x, vel_y}.get_blue_team_state() -> table[]Array of robot state tables for the blue team.get_yellow_team_state() -> table[]Array of robot state tables for the yellow team.get_ref_message() -> stringReturns current referee message/state as a string.
draw_point(x, y[, draw_x][, color])Draw a point marker on the field view.draw_xis optional (true/false) and draws an 'X' instead of a circle whentrue.coloris optional and can be{r,g,b}or{r=, g=, b=}with values in[0.0, 1.0]. Defaults to green.draw_line({{x,y}, {x,y}, ...}[, draw_points_between][, color])Draw a polyline on the field view (2 or more points). Can use indexed points ({x, y}) or keyed points ({x=, y=}).draw_points_betweenis optional (true/false) and draws small interpolated points between line vertices.coloris optional and can be{r,g,b}or{r=, g=, b=}with values in[0.0, 1.0].draw_text(x, y, text[, color])Draw text at a field coordinate.textis a string to display.coloris optional and can be{r,g,b}or{r=, g=, b=}with values in[0.0, 1.0]. Defaults to white.highlight_robot(id, team)Highlight a robot in the field view.
grsim.teleport_robot(id, team, x, y, dir)Teleport robot in simulation.grsim.teleport_ball(x, y)Teleport ball in simulation.
engine/
├── build.rs # Protobuf codegen (pure Rust, no protoc needed)
├── Cargo.toml
├── scripts-test/ # Example Lua strategy scripts
├── src/
│ ├── main.rs # Entry point — Iced GUI + async engine loop
│ ├── game_controller.rs # ssl-game-controller client
│ ├── world.rs # Shared game state
│ ├── lua_interface.rs # Lua 5.4 scripting bridge
│ ├── receiver/ # Receiver-side modules
│ │ ├── vision.rs # SSL-Vision UDP multicast receiver
│ │ └── tracker.rs # Kalman filter tracker
│ ├── sender/ # Sender-side modules
│ │ ├── radio.rs # Serial radio dispatcher
│ │ ├── grsim.rs # grSim UDP command sender
│ │ └── packet_serializer.rs # Serial packet encoding
│ ├── motion/ # Controllers (PID, bang-bang) and path planning
│ ├── gui/ # Iced GUI panels and field canvas
│ └── protobuf/protos/ # SSL and grSim .proto definitions
└── build/ # Pre-built web assets for GUI panels
Apache License 2.0 — see LICENSE.
