Skip to content

πŸš€ Getting Started

Gerson edited this page May 29, 2025 · 6 revisions

βš™οΈ Running the System on Windows

To test robot soccer strategies without real hardware, you'll use two components:

  • GrSim (the simulator) – creates a virtual SSL field with simulated robots and ball physics.

  • Sysmic Robotics Engine – acts as the AI/control system for your robots, making decisions and sending commands to the simulator.

These two programs work together: the engine decides what the robots should do, and GrSim shows the result on a virtual field.

Download

1️⃣ Download and Open the Simulator (GrSim)

πŸ“₯ Download GrSim

  1. Go to the following link and download the GrSim simulator:
    πŸ‘‰ Download GrSim (Google Drive)

πŸ“‚ Extract the Archive

  1. Once the download is complete, locate the .zip file in your Downloads folder.

  2. Right-click the file and choose Extract All...

  3. Choose a destination folder (e.g., C:\GrSim) and complete the extraction.

▢️ Launch GrSim

  1. Open the extracted folder.

  2. Navigate to the release subfolder.

  3. Double-click grsim.exe to start the simulator.

πŸ’‘ Tip: Right-click grsim.exe and select Send to β†’ Desktop (create shortcut) for quicker access next time!

2️⃣ Download and Open the Engine

  1. Go to the GitHub Releases page.
  2. Scroll down to the Assets section of the latest release.
  3. Click on build.zip to download the precompiled Windows build.
  4. After the download finishes, right-click build.zip and choose Extract All.
  5. Select a destination folder and finish the extraction.
  6. Open the extracted build folder.
  7. Double-click engine.exe to launch the Sysmic Robotics Engine.

πŸ“Œ Use Case: Running Your Custom Code

Once the engine is running, you can write and test your own robot behavior scripts using .lua files.

✍️ Step 1: Create Your Lua File

  1. Create a new file with a .lua extension (e.g., example_play.lua).

  2. Write your strategy or robot behavior logic in this file using the engine's Lua API.

    Example file path:

    C:\SysmicEngine\scripts\example_play.lua
    

▢️ Step 2: Run Your Lua Script in the Engine

  1. Start engine.exe.

  2. In the engine console, type the run command followed by the full path to your .lua file.

    Example:

    run C:\SysmicEngine\scripts\example_play.lua
    
  3. The engine will load and execute your Lua file, sending commands to GrSim.

πŸ” Step 3: Use Reload for Quick Iteration

  • If you make changes to the Lua file and want to re-run it without typing the full path again, just type:

    reload
    
  • This re-executes the last loaded script, making testing and development much faster.

πŸ’‘ Tip: Organize your Lua scripts in a dedicated scripts folder for easy access and versioning.

Here’s your updated Lua API Quick Reference, now including process() and print():


πŸ“„ Lua API Quick Reference

Function Description Parameters Returns
move_to(robotId, team, point) Moves a robot to a point. robotId: numberteam: 0 = blue, 1 = yellowpoint: {x, y} β€”
get_robot_state(robotId, team) Returns robot state. robotId, team {id, team, x, y, vel_x, vel_y, orientation, active}
face_to(robotId, team, point, kp?, ki?, kd?) Rotates robot to face a point. point: {x, y}Optional PID: kp, ki, kd β€”
get_ball_state() Returns ball position. β€” {x, y}
kickx(robotId, team) Triggers flat kick. robotId, team β€”
kickz(robotId, team) Triggers lob kick. robotId, team β€”
dribbler(robotId, team, speed) Sets dribbler speed (0–7). robotId, team, speed: number β€”
print(...) Outputs text to the engine console (for debugging). Any number of values β€”
process() Called every frame (~60 times/sec). Place your logic here. β€” β€”

ℹ️ Note: Define a global function process() in your Lua file. It will be called in a loop by the engine. Use print() for debugging output.

πŸ“‚ Example Scripts

Looking for ready-to-use Lua scripts?

You can find working examples and templates in the official strategy repository:

πŸ‘‰ Sysmic-Robotics/strategy

These scripts demonstrate how to:

  • Move robots to specific positions

  • Track and react to the ball

  • Use process() for continuous logic

  • Apply actions like kicking, dribbling, and rotating

πŸ’‘ Use these examples as a starting point to build your own strategies and behaviors!