Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
ec7010a
Added NeverExcessivelyDribbles functionality into OffensePlayTest
adrianchan787 Nov 1, 2025
b690a45
intermediate commit
adrianchan787 Nov 30, 2025
c339388
intermediate change
adrianchan787 Nov 30, 2025
a4f6bc0
Switched to world proto subscription measurement
adrianchan787 Nov 30, 2025
544bc55
Added excessive dribbling functionality and testing
adrianchan787 Nov 30, 2025
d928b5d
Reverted verbosity change which was for print testing previously
adrianchan787 Nov 30, 2025
a3929cf
Merge branch 'master' into adrian/offense_play_test_dribble
adrianchan787 Nov 30, 2025
32cc42d
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Nov 30, 2025
5b0b98c
Added error margin of 0.05 to max dribbling distance
adrianchan787 Nov 30, 2025
2fb03f8
Merge branch 'adrian/offense_play_test_dribble' of https://github.com…
adrianchan787 Nov 30, 2025
dff8853
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Nov 30, 2025
8336df9
Made testing file one function
adrianchan787 Jan 9, 2026
8d1354f
Increased max dribble margin to 0.06 to reduce flakiness
adrianchan787 Jan 9, 2026
75141c3
Fixed import statements for test file
adrianchan787 Jan 9, 2026
2d235e3
Changed get validation to reflect correct start point
adrianchan787 Jan 9, 2026
ed1102e
Merge conflict fix
adrianchan787 Jan 9, 2026
e3afcc5
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jan 9, 2026
7edc073
Added constants to the excessive dribbling
adrianchan787 Jan 10, 2026
87eb7b9
Removed allow excessive dribbling for the tests
adrianchan787 Jan 10, 2026
20f5cfd
Merged master
adrianchan787 Jan 10, 2026
e9d2ff6
Fixed merge conflict
adrianchan787 Jan 10, 2026
0e8e809
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jan 10, 2026
fd5ceec
Merge branch 'master' into adrian/offense_play_test_dribble
adrianchan787 Jan 15, 2026
da98427
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Jan 15, 2026
0916bcb
Added back import
adrianchan787 Jan 31, 2026
82532bd
Added back import
adrianchan787 Jan 31, 2026
7e46bdf
Merge conflicts fixed
adrianchan787 Jan 31, 2026
6d9a363
Added overrides
adrianchan787 Jan 31, 2026
9812bc1
pulled from master
adrianchan787 Feb 7, 2026
871d210
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Feb 7, 2026
9022e22
test
adrianchan787 Feb 7, 2026
8a2bf29
fixed syntax
adrianchan787 Feb 7, 2026
22ec418
Merge conflicts fixed
adrianchan787 Feb 7, 2026
57e14e9
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Feb 7, 2026
1d98837
i think it's finally good now?
adrianchan787 Feb 7, 2026
14ef1b0
test push to see if it fixes the 59 changed files...
adrianchan787 Feb 7, 2026
5e15f1a
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Feb 7, 2026
c0632cd
Revert "Added overrides"
adrianchan787 Feb 7, 2026
d36bd78
revert
adrianchan787 Feb 7, 2026
3edb21c
revert
adrianchan787 Feb 7, 2026
6cef848
revert merge
adrianchan787 Feb 7, 2026
41344a3
revert
adrianchan787 Feb 7, 2026
417a094
merge
adrianchan787 Feb 7, 2026
6e3cb23
Revert
adrianchan787 Feb 7, 2026
212b4db
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] Feb 7, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
100 changes: 24 additions & 76 deletions docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,35 +5,30 @@
<!--TOC-->

- [Table of Contents](#table-of-contents)
- [Software Setup](#software-setup)
- [Introduction](#introduction)
- [Installation and Setup](#installation-and-setup)
- [Operating systems](#operating-systems)
- [Getting the Code](#getting-the-code)
- [Installing Software Dependencies](#installing-software-dependencies)
- [Installing an IDE](#installing-an-ide)
- [Installing an IDE: CLion](#installing-an-ide-clion)
- [Getting your Student License](#getting-your-student-license)
- [Installing CLion](#installing-clion)
- [Installing an IDE: VS Code](#installing-an-ide-vs-code)
- [Editing with Vim or NeoVim](#editing-with-vim-or-neovim)
- [Building and Running the Code](#building-and-running-the-code)
- [Building from the command line](#building-from-the-command-line)
- [Building from the command line using the fuzzy finder](#building-from-the-command-line-using-the-fuzzy-finder)
- [Building with CLion](#building-with-clion)
- [Building with VS Code](#building-with-vs-code)
- [Running our AI, Simulator, SimulatedTests or Robot Diagnostics](#running-our-ai-simulator-simulatedtests-or-robot-diagnostics)
- [Debugging](#debugging)
- [Debugging with CLion](#debugging-with-clion)
- [Debugging from the Command Line](#debugging-from-the-command-line)
- [Profiling](#profiling)
- [Callgrind](#callgrind)
- [Tracy](#tracy)
- [Building for the robot](#building-for-the-robot)
- [Deploying Robot Software to the robot](#deploying-robot-software-to-the-robot)
- [Testing Robot Software locally](#testing-robot-software-locally)
- [Setting up Virtual Robocup 2021](#setting-up-virtual-robocup-2021)
- [Setting up the SSL Simulation Environment](#setting-up-the-ssl-simulation-environment)
- [Installing Software Dependencies](#installing-software-dependencies)
- [Installing an IDE](#installing-an-ide)
- [Installing an IDE: CLion](#installing-an-ide-clion)
- [Getting your Student License](#getting-your-student-license)
- [Installing CLion](#installing-clion)
- [Installing an IDE: VS Code](#installing-an-ide-vs-code)
- [Editing with Vim or NeoVim](#editing-with-vim-or-neovim)
- [Building and Running the Code](#building-and-running-the-code)
- [Building from the command line](#building-from-the-command-line)
- [Building from the command line using the fuzzy finder](#building-from-the-command-line-using-the-fuzzy-finder)
- [Building with CLion](#building-with-clion)
- [Building with VS Code](#building-with-vs-code)
- [Running our AI, Simulator, SimulatedTests or Robot Diagnostics](#running-our-ai-simulator-simulatedtests-or-robot-diagnostics)
- [Debugging](#debugging)
- [Debugging with CLion](#debugging-with-clion)
- [Debugging from the Command Line](#debugging-from-the-command-line)
- [Profiling](#profiling)
- [Callgrind](#callgrind)
- [Tracy](#tracy)
- [Building for the robot](#building-for-the-robot)
- [Deploying Robot Software to the robot](#deploying-robot-software-to-the-robot)
- [Testing Robot Software locally](#testing-robot-software-locally)
- [Setting up Virtual Robocup 2021](#setting-up-virtual-robocup-2021)
- [Setting up the SSL Simulation Environment](#setting-up-the-ssl-simulation-environment)
- [Workflow](#workflow)
- [Issue and Project Tracking](#issue-and-project-tracking)
- [Issues](#issues)
Expand All @@ -49,53 +44,6 @@
- [Testing](#testing)

<!--TOC-->

# Software Setup

## Introduction

These instructions assume that you have the following accounts setup:
- [GitHub](https://github.com/login)
- [Discord](https://discord.com). Please contact a Thunderbots lead to receive the invite link.

These instructions assume you have a basic understanding of Linux and the command line. There are many great tutorials online, such as [LinuxCommand](http://linuxcommand.org/). The most important things you'll need to know are how to move around the filesystem and how to run programs or scripts.

## Installation and Setup

### Operating systems

We currently only support Linux, specifically Ubuntu.

If you have a X86_64 machine, we support Ubuntu 22.04 LTS and Ubuntu 24.04 LTS.

If you have a ARM64 (also known as AARCH64) machine, we support Ubuntu 24.04 LTS.

You are welcome to use a different version or distribution of Linux, but may need to make some tweaks in order for things to work.

You can use Ubuntu 22.04 LTS or Ubuntu 24.04 LTS inside Windows through Windows Subsystem for Linux, by following [this guide](./getting-started-wsl.md). **Running and developing Thunderbots on Windows is experimental and not officially supported.**

### Getting the Code

1. Open a new terminal
2. Install git by running `sudo apt-get install git`
3. Go to the [software repository](https://github.com/UBC-Thunderbots/Software)
4. Click the `Fork` button in the top-right to fork the repository ([click here to learn about Forks](https://help.github.com/en/articles/fork-a-repo))
1. Click on your user when prompted
2. You should be automatically redirected to your new fork
5. Clone your fork of the repository. As GitHub is forcing users to stop using usernames and passwords for authorization, we will be using the SSH link.

To clone using SSH:

1. If not setup prior, you will need to add an SSH key to your GitHub account. Instructions can be found [here](https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent). For each computer you contribute to GitHub with, you will need an additional SSH Key pair linked to your account.
2. After you have successfully set up a SSH key for your device and added it to GitHub, you can clone the repository using the following command:
1. e.g. `git clone git@github.com:<your_username>/Software.git`
2. You can find this link under the green `Code` button on the main page of your fork on GitHub, under the SSH tab. (This should now be available after adding your SSH key to GitHub successfully.)

Alternatively, you can clone using HTTPS. You'll need to either use a credential helper (Git Credential Manager, GitHub CLI, etc.) or a personal access token ([details here](https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls)).
6. Set up your git remotes ([what is a remote and how does it work?](https://git-scm.com/book/en/v2/Git-Basics-Working-with-Remotes))
1. You should have a remote named `origin` that points to your fork of the repository. Git will have set this up automatically when you cloned your fork in the previous step.
2. You will need to add a second remote, named `upstream`, that points to our main Software repository, which is where you created your fork from. (**Note:** This is _not_ your fork)
1. Open a terminal and navigate to the folder you cloned (your fork): `cd path/to/the/repository/Software`
2. Navigate to our main Software repository in your browser and copy the url from the green `Code` button. Copy the SSH url if you originally cloned with SSH, or use the HTTPS url if you previously cloned with HTTPS
3. From your terminal, add the new remote by running `git remote add upstream <the url>` (without the angle brackets)
1. e.g. `git remote add upstream git@github.com:UBC-Thunderbots/Software.git`
Expand Down
26 changes: 0 additions & 26 deletions docs/useful-robot-commands.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,6 @@
<!--TOC-->

- [Table of Contents](#table-of-contents)
- [Common Debugging Steps](#common-debugging-steps)
- [Off Robot Commands](#off-robot-commands)
- [Wifi Disclaimer](#wifi-disclaimer)
- [Miscellaneous Ansible Tasks & Options](#miscellaneous-ansible-tasks--options)
- [Flashing the robot's compute module](#flashing-the-robots-compute-module)
- [Flashing the powerboard](#flashing-the-powerboard)
- [Setting up the embedded host](#setting-up-the-embedded-host)
Expand All @@ -24,28 +20,6 @@
- [Redis](#redis)

<!--TOC-->

# Common Debugging Steps
```mermaid
---
title: Robot Debugging Steps
---
flowchart TD
ssh("Can you SSH into the robot?
`ssh robot@192.168.0.20RobotID` (for Nanos) OR `ssh robot@192.168.5.20RobotID` (for Pis) OR `ssh robot@robot_name.local`
e.g. `ssh robot@192.168.0.203` (for Nanos) or `ssh robot@192.168.5.203` (for Pis) or `ssh robot@robert.local`
for a robot called robert with robot id 3")
ssh ---> |Yes| tloop_status
ssh --> |No - Second Try| monitor("Connect Jetson or Pi to an external monitor and check wifi connection or SSH using an ethernet cable")
ssh --> |No - First Try| restart(Restart robot)
restart --> ssh

diagnostics("`Run Diagnostics while connected to '**tbots**' wifi`") --> robot_view
robot_view(Robot is shown as connected in 'Robot View' widget?) --> |Yes| check_motors(All motors move?)
style diagnostics stroke:#f66,stroke-width:2px,stroke-dasharray: 5 5

check_motors -->|Yes| field_test(Running AI?)
field_test -->|No| done(Done)
style done stroke:#30fa02,stroke-width:2px,stroke-dasharray: 5 5
field_test -->|Yes| field_test_moves(Does robot move during field test?)
field_test_moves --> |No| check_shell("`Check that the correct shell is placed on the robot`")
Expand Down
5 changes: 4 additions & 1 deletion src/software/ai/hl/stp/play/offense/offense_play_test.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import software.python_bindings as tbots_cpp
from proto.play_pb2 import Play, PlayName

from software.simulated_tests.excessive_dribbling import NeverExcessivelyDribbles
from software.simulated_tests.friendly_team_scored import *
from software.simulated_tests.ball_enters_region import *
from software.simulated_tests.friendly_has_ball_possession import *
Expand Down Expand Up @@ -76,7 +78,8 @@ def setup(start_point):

# Always Validation
inv_always_validation_sequence_set = [
[BallAlwaysStaysInRegion(regions=[field.fieldBoundary()])]
[BallAlwaysStaysInRegion(regions=[field.fieldBoundary()])],
[NeverExcessivelyDribbles()],
]

ag_always_validation_sequence_set = [[FriendlyAlwaysHasBallPossession()]]
Expand Down
19 changes: 19 additions & 0 deletions src/software/ai/hl/stp/tactic/dribble/BUILD
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@simulated_tests_deps//:requirements.bzl", "requirement")

package(default_visibility = ["//visibility:public"])

cc_library(
Expand Down Expand Up @@ -60,3 +62,20 @@ cc_test(
"//software/world",
],
)

py_test(
name = "excessive_dribble_test",
srcs = [
"excessive_dribble_test.py",
],
# TODO (#2619) Remove tag to run in parallel
tags = [
"exclusive",
],
deps = [
"//software:conftest",
"//software/simulated_tests:speed_threshold_helpers",
"//software/simulated_tests:validation",
requirement("pytest"),
],
)
134 changes: 134 additions & 0 deletions src/software/ai/hl/stp/tactic/dribble/excessive_dribble_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
import pytest

import software.python_bindings as tbots_cpp
from software.simulated_tests.excessive_dribbling import (
NeverExcessivelyDribbles,
EventuallyStartsExcessivelyDribbling,
)
from proto.message_translation.tbots_protobuf import (
WorldState,
AssignedTacticPlayControlParams,
DribbleTactic,
)
from software.simulated_tests.simulated_test_fixture import (
pytest_main,
)
from proto.message_translation.tbots_protobuf import create_world_state


@pytest.mark.parametrize(
"initial_location,dribble_destination,final_dribble_orientation, should_excessively_dribble",
[
# Tests Should not excessively dribble
# Dribble Destination for the ball < 1.0 from its starting position
(tbots_cpp.Point(0.5, 0), tbots_cpp.Point(1.02, 0), tbots_cpp.Angle(), False),
# Dribble Testing diagonally
(
tbots_cpp.Point(0.25, 0.25),
tbots_cpp.Point(0.80, 0.50),
tbots_cpp.Angle.fromRadians(50),
False,
),
# Boundary Testing, because of the autoref implementation (initial of position Bot to final of Ball),
# a conservative max dribble distance (0.95 m) is used
# Test vertical dribbling
(tbots_cpp.Point(0.01, 0), tbots_cpp.Point(0.96, 0), tbots_cpp.Angle(), False),
# Test horizontal dribbling
(tbots_cpp.Point(1, 1.5), tbots_cpp.Point(1.95, 1.5), tbots_cpp.Angle(), False),
# Test bot and ball in same position
(tbots_cpp.Point(0, 1), tbots_cpp.Point(0.95, 1), tbots_cpp.Angle(), False),
# Tests Should excessively dribble
# Dribble Destination for the ball > 1.0 from its starting position
(tbots_cpp.Point(0, 2), tbots_cpp.Point(0, 0.5), tbots_cpp.Angle(), True),
# Dribble Testing diagonally
(
tbots_cpp.Point(0.1, 1.1),
tbots_cpp.Point(1.1, 0.1),
tbots_cpp.Angle.fromRadians(50),
True,
),
# Boundary Testing, due to the conservative implementation a dribble distance of 1 m should fail
# Test Vertical Dribbling
(tbots_cpp.Point(0, 1), tbots_cpp.Point(0, 2), tbots_cpp.Angle(), True),
# Test Horizontal Dribbling
(tbots_cpp.Point(1, 2), tbots_cpp.Point(0, 2), tbots_cpp.Angle(), True),
# Test Diagonal Dribbling
(tbots_cpp.Point(0, 1), tbots_cpp.Point(0.6, 1.8), tbots_cpp.Angle(), True),
# Test robot and ball at same position (affects dribbling orientation and therefore perceived dribble distance)
(tbots_cpp.Point(0, 0), tbots_cpp.Point(0, 1), tbots_cpp.Angle(), True),
(
tbots_cpp.Point(0.0, 0.01),
tbots_cpp.Point(0.81, 0.61),
tbots_cpp.Angle(),
True,
),
(
tbots_cpp.Point(0.01, 0.00),
tbots_cpp.Point(0.81, 0.61),
tbots_cpp.Angle(),
True,
),
],
)
def test_excessive_dribbling(
initial_location,
dribble_destination,
final_dribble_orientation,
should_excessively_dribble,
simulated_test_runner,
):
if should_excessively_dribble:
blue_robot_locations = [tbots_cpp.Point(0, 0.0)]

# Always and Eventually validation sets for excessive dribbling
always_validation_sequence_set = [[]]
eventually_validation_sequence_set = [[EventuallyStartsExcessivelyDribbling()]]
else:
blue_robot_locations = [tbots_cpp.Point(0, 1)]

# Always and Eventually validation sets for not excessive dribbling
always_validation_sequence_set = [[NeverExcessivelyDribbles()]]
eventually_validation_sequence_set = [[]]

simulated_test_runner.simulator_proto_unix_io.send_proto(
WorldState,
create_world_state(
[],
blue_robot_locations=blue_robot_locations,
ball_location=initial_location,
ball_velocity=tbots_cpp.Vector(0, 0),
),
)

# Setup Tactic
params = AssignedTacticPlayControlParams()
params.assigned_tactics[0].dribble.CopyFrom(
DribbleTactic(
dribble_destination=tbots_cpp.createPointProto(dribble_destination),
final_dribble_orientation=tbots_cpp.createAngleProto(
final_dribble_orientation
),
allow_excessive_dribbling=True,
)
)

simulated_test_runner.blue_full_system_proto_unix_io.send_proto(
AssignedTacticPlayControlParams, params
)

# Setup no tactics on the enemy side
params = AssignedTacticPlayControlParams()
simulated_test_runner.yellow_full_system_proto_unix_io.send_proto(
AssignedTacticPlayControlParams, params
)

simulated_test_runner.run_test(
inv_eventually_validation_sequence_set=eventually_validation_sequence_set,
inv_always_validation_sequence_set=always_validation_sequence_set,
ag_eventually_validation_sequence_set=eventually_validation_sequence_set,
ag_always_validation_sequence_set=always_validation_sequence_set,
)


if __name__ == "__main__":
pytest_main(__file__)
Loading