WWW-POSIMCourse & competition
Documentation menu
WWW-POSIM / Course & competition

Submit your competition program

Write your code in VS Code, upload it on the website and receive your score by email. The server runs your program and robot simulation, so you can close the website after submitting.

1. Prepare your account and VS Code

  1. Create an account at www-posim.vercel.app.
  2. Open the verification email and press its button. Sign in with that account.
  3. Your account needs server access. Ask your course organizer if the submission page says access is needed.
  4. Install VS Code. In Extensions, install Python by Microsoft.
  5. Create a folder called posim-competition in Documents. In VS Code, choose File → Open Folder and select it.

For website submissions you do not need to install ROS or Docker. Python and the simulation connection are prepared on the server. Keep passwords out of your code.

2. Create main.py

Create a file named main.py in VS Code. Paste the code below and save it. You can also download this starter.

The starter reads WAM-V's position, moves toward the station target and turns to the required heading. It supports surface_station only. Upload it unchanged for your first measured result, then improve the program by comparing its recorded paths and errors.

The example's leaderboard record keeps its five measured paths and scores: 46.73, 9.35, 4.02, 0.00 and 3.92. The average is 12.81 / 100; the competition score is 10.24 / 100, because the rules also weight the lowest score. These native simulator measurements use the downloadable code and the current scoring rules. Your run can vary slightly with computer performance.

# WWW-POSIM station starter · IOES-Lab · MIT
import math
from www_posim_ros import Session


def angle(value):
    return (value + math.pi) % (2 * math.pi) - math.pi


with Session.local(control=True) as sim:
    mission = sim.profile.get("mission")
    if not mission or mission["task"] != "surface_station":
        raise ValueError("Choose the surface_station competition task")
    goal = mission["targets"][0]
    topic = next(name for name, kind in sim.topics.items()
                 if kind == "nav_msgs/msg/Odometry")
    print("Moving toward the station target:", goal, flush=True)

    holding = False
    while True:
        message = sim.latest(topic, max_age=0.5)
        pose = message["pose"]["pose"]
        p, q = pose["position"], pose["orientation"]
        yaw = math.atan2(2 * (q["w"] * q["z"] + q["x"] * q["y"]),
                         1 - 2 * (q["y"] ** 2 + q["z"] ** 2))
        dx, dy = goal["x"] - p["x"], goal["y"] - p["y"]
        distance = math.hypot(dx, dy)
        if distance < 0.25:
            holding = True
        elif distance > 0.6:
            holding = False
        wanted_yaw = goal["yaw"]
        if goal.get("yaw_current_follow"):
            stamp = message["header"]["stamp"]
            elapsed = stamp["sec"] + stamp["nanosec"] * 1e-9 - mission["current_epoch_sim_time"]
            wanted_yaw += math.radians(mission["current_swing"]) * math.sin(
                2 * math.pi * elapsed / mission["current_period"] + mission["current_phase"])
        desired = wanted_yaw if holding else math.atan2(dy, dx)
        error = angle(desired - yaw)
        forward = min(0.4, 0.15 * distance) if not holding and abs(error) < 0.6 else 0.0
        turn = max(-0.5, min(0.5, 0.6 * error))
        sim.set_velocity(forward=forward, yaw_rate=turn, duration=0.25)

Session connects to the robot assigned to your run. The course provides a different target for each evaluation. This program reads that target instead of fixing one coordinate in its code.

3. Upload your code

  1. Open Competition submissions.
  2. Choose surface_station for the starter.
  3. Enter a public team name such as MyTeam.
  4. Choose your saved main.py file.
  5. Press Submit and evaluate. Wait until a submission number and Queued appear.

For a program split across several files, upload a ZIP containing main.py and the helper Python files. Put main.py at the project root. ZIP only the source files; leave out .venv, downloaded packages and result folders. The upload limit is 1 MiB.

Each submitted version has its own number and result. Retrying an upload after a connection error uses the same submission number. To submit edited code as a new version, select the saved file again.

4. Wait for the server and email

You may close the page or sign out after the submission is accepted. Your computer no longer needs to stay connected.

Server capacity is limited, so evaluations wait in a queue. A submission evaluates the same task five times, with different target and wind conditions shared by all entrants, taking turns with other queued entrants between courses. The website uses lower graphics quality than the installed app; scores come from the measured simulation state.

The submission page shows the queue position and completed evaluations, such as 2 / 5. Five runs can take several minutes, plus queue and preparation time. When evaluation ends, an email contains the score and a result link. Sign in to open that link. Check Spam if the email is missing; the saved website result is also available.

5. Read your result and improve

  1. Open Your submissions and press View result.
  2. Select an evaluation and use Play record and its time slider to inspect the path. Compare targets reached, distance, time and errors. Check the five-run score and status. Expand Program output to read your Python print() messages or errors.
  3. Press Download result to save the detailed JSON record. Open it in VS Code.
  4. Inspect each course's report: completion, position_rms_m, heading_rms_rad and collision_proxies.
  5. Change one part of your program, save it and upload a new version.

A completed five-run submission can enter the Leaderboard. Failed or cancelled submissions retain diagnostic information. Their incomplete courses do not replace a completed submission's ranking. Use Cancel beside a queued or running submission when you want to stop it.

If something fails

Practice the same task in the installed app

  1. Install and open WWW-POSIM, then sign in with your verified account.
  2. In Workspace → Location, press Prepare competition arena. The app creates the common arena without downloading a map.
  3. In Vehicle → Optional competition, choose a task and Evaluation condition 1–5. The app selects the matching layout seed automatically.
  4. Leave ROS 2 direct control selected. Go to Confirm and press Start generated world. Wait for the robot to be ready.
  5. Create a Python project from the launcher and open it in VS Code using the prepared Python guide. Save your controller as main.py.
  6. In the workspace, press Start scoring before starting your code. Current and the score timer start together.
  7. Open the prepared terminal in VS Code and paste:
python main.py

Stop your code with Ctrl+C. Export the score and recorded path from the workspace. Restart the practice world before the next trial. Try each of the five conditions, improve your controller, then upload main.py or your ZIP on the website for an official result.

The arena, starting point, layout, wind, current and scoring rules match the corresponding website evaluation. Local scores are practice records. Actual speed and floating-point results can vary with the computer; the physics target is 1× with a 10 ms timestep.

Advanced: program interfaces and limits

Multiple files, dependencies and limits

A ZIP can contain packages and relative Python imports. Its expanded source must fit within 4 MiB and 100 files. Files use UTF-8 encoding. The server prepares the Session SDK, standard Python, NumPy, SciPy, PyYAML and ROS libraries. It does not install arbitrary dependencies from uploaded requirements files. Network access and writes to the source folder are disabled; temporary files belong under /tmp.

Up to five submissions can be pending and ten can be accepted per hour. Code storage is limited to 50 MiB per account. Server simulation time uses the account's hosted daily allowance. Ending a personal web session does not cancel an accepted code submission; use its Cancel button.

Sensor and command interfaces

sim.profile["mission"] contains the current task, targets, home and timing. sim.topics lists the assigned robot's sensor topics. sim.latest(topic) raises an error rather than silently returning old data.

WAM-V accepts forward velocity within ±1.5 m/s and yaw rate within ±0.5 rad/s. Thruster commands use two WAM-V values within ±200 N or six BlueROV2 values within ±50 N. The underwater tasks need a depth controller. For ROS nodes, the runner provides WWW_POSIM_PROFILE, a temporary course JSON file, and a local ROS relay in domain 76.

The server starts scoring before it starts main.py. Printing a claimed score cannot award points. See Tasks, scores and standings for the formulas, permitted inputs and fairness limits. The public autonomy template contains additional ROS controller examples under MIT.