Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
72 commits
Select commit Hold shift + click to select a range
906638c
enable simulated dribbled
Andrewyx Mar 10, 2026
9180b1a
Merge branch 'master' of https://github.com/UBC-Thunderbots/Software …
Andrewyx Apr 3, 2026
7ab30e9
temporary working evaluation
StarrryNight Apr 4, 2026
d2c3153
add goalie_tactic_test evaluations
StarrryNight Apr 4, 2026
a0186d6
Remove all c++ simulated tests
nycrat Apr 4, 2026
9112248
Remove c++ simulated test fixtures and validations
nycrat Apr 4, 2026
0c55b0d
Resolve issue #2581 TODOs
nycrat Apr 4, 2026
d479146
Merge branch 'Andrewyx/realistic_dribble' of https://github.com/Andre…
StarrryNight Apr 5, 2026
0982bb0
Remove simulated test args from gtest main
nycrat Apr 4, 2026
2f84b6e
Remove TODO
nycrat Apr 4, 2026
b440d66
Remove visualizing c++ test flags from thunderscope and tbots.py
nycrat Apr 5, 2026
cf71504
init
StarrryNight Apr 5, 2026
1666a79
finish header file and some cpp
StarrryNight Apr 5, 2026
fc7076a
finish implmentation of kf
StarrryNight Apr 5, 2026
660c185
change ball filter
StarrryNight Apr 5, 2026
1ade146
finish WITHOUT TUNING
StarrryNight Apr 6, 2026
f5cfcd9
fix build issues
StarrryNight Apr 6, 2026
15f5042
change import issues
StarrryNight Apr 6, 2026
ca76a68
finish integrating kalman filter --> needs tuning
StarrryNight Apr 6, 2026
adaa05e
finish initial tuning
StarrryNight Apr 6, 2026
bb00252
tuning values...
StarrryNight Apr 7, 2026
b4444f5
merge
StarrryNight Apr 7, 2026
6fbb0ed
Tuning mostly done
StarrryNight Apr 7, 2026
f389730
Merge branch 'master' into avah/deprecate_cpp_tests
nycrat Apr 8, 2026
12f282c
Merge branch 'master' of github.com:UBC-Thunderbots/Software
StarrryNight Apr 11, 2026
72ee297
write javadoc and rename ball filter to ball_tracker
StarrryNight Apr 17, 2026
9d967fb
remove old filter
StarrryNight Apr 17, 2026
defd8dd
merge master
StarrryNight Apr 17, 2026
10c9de2
revert goalie tests
StarrryNight Apr 26, 2026
334c4de
test
StarrryNight Apr 26, 2026
8a960bb
try:
StarrryNight Apr 26, 2026
5dad31b
Update iterfzf version
nycrat May 11, 2026
7df095f
Merge branch 'master' into avah/deprecate_cpp_tests
nycrat May 12, 2026
cf03a69
temp
StarrryNight May 14, 2026
73d908b
fixed tests
StarrryNight May 14, 2026
4794b72
change implementation and interface to fit higher-level-mp
StarrryNight May 14, 2026
df3b4a7
add velocity initialization
StarrryNight May 14, 2026
e9ed81d
remove bad heuristics
StarrryNight May 14, 2026
9637323
add dribbling heuristic
StarrryNight May 14, 2026
597cf7e
add out of bounds heuristic
StarrryNight May 14, 2026
76be0ff
fix mahalanobis gating
StarrryNight May 14, 2026
e27a65e
cleanup
StarrryNight May 15, 2026
e4f2e13
init (just moved the kf branch stuff here
StarrryNight May 15, 2026
c85f370
Merge branch 'master' into tuned_kalman
StarrryNight May 15, 2026
9e445da
Merge branch 'use_true_locations' into tuned_kalman
StarrryNight May 15, 2026
c01a223
more cleanup
StarrryNight May 15, 2026
46b86b0
remove the ball tracker tests for now
StarrryNight May 15, 2026
815f028
pass argument for simulated hrvo test
StarrryNight May 15, 2026
fcdca8c
Merge branch 'use_true_locations' into tuned_kalman
StarrryNight May 15, 2026
0f583b2
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] May 15, 2026
3c349d7
Merge branch 'avah/deprecate_cpp_tests' into tuned_kalman
StarrryNight May 15, 2026
9f5e314
add dribbling heuristic -- Decrease measuerement noise when near drib…
StarrryNight May 15, 2026
079ba91
new
StarrryNight May 18, 2026
9c19dab
add validation
StarrryNight May 18, 2026
cc19549
Use simulator ball position and velocity
StarrryNight May 18, 2026
7984c37
fix merge
StarrryNight May 18, 2026
bdb6c7e
allow stale buffer
StarrryNight May 18, 2026
02503d6
// Merge branch 'use_true_locations' into tuned_kalman
StarrryNight May 18, 2026
13d7832
tuning fixes crease defender test
StarrryNight May 18, 2026
cb4ebd8
remove ball tracker
StarrryNight May 18, 2026
6812d27
add sme logs for goalie tactci test to debug
StarrryNight May 18, 2026
5368204
fix path
StarrryNight May 18, 2026
a3d9065
temp vision testing
StarrryNight May 19, 2026
a50d26a
Increase ball tracker damping during extended occlusion
StarrryNight May 19, 2026
fbaabd8
merge
StarrryNight May 20, 2026
925314f
temp
StarrryNight May 20, 2026
52691ad
add velocity initialization
StarrryNight May 20, 2026
ca54a5a
FIX GOALIE TACTIC TEST
StarrryNight May 20, 2026
e1f44be
a
StarrryNight May 20, 2026
51d9042
revert goalie chages
StarrryNight May 20, 2026
c8e8d96
dribbling test work
StarrryNight May 20, 2026
7768f1b
fix goalie crease defender tests
StarrryNight May 20, 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
2 changes: 1 addition & 1 deletion environment_setup/ubuntu24_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
ansible-lint==26.4.0
pyqtgraph==0.13.7
thefuzz==0.19.0
iterfzf==0.5.0.20.0
iterfzf==1.9.0.67.0
python-Levenshtein==0.25.1
psutil==5.9.0
PyOpenGL==3.1.6
Expand Down
1 change: 0 additions & 1 deletion src/software/ai/hl/stp/play/kickoff_friendly/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ cc_library(
],
alwayslink = True,
)

py_test(
name = "kickoff_friendly_play_test",
srcs = ["kickoff_friendly_play_test.py"],
Expand Down
2 changes: 1 addition & 1 deletion src/software/ai/hl/stp/play/penalty_kick_enemy/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@ cc_test(
"//software/test_util",
],
)

py_test(
name = "penalty_kick_enemy_play_test",
srcs = ["penalty_kick_enemy_play_test.py"],
Expand All @@ -44,3 +43,4 @@ py_test(
requirement("pytest"),
],
)

1 change: 0 additions & 1 deletion src/software/ai/hl/stp/tactic/attacker/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ cc_test(
"//software/test_util",
],
)

py_test(
name = "attacker_tactic_test",
srcs = ["attacker_tactic_test.py"],
Expand Down
7 changes: 6 additions & 1 deletion src/software/ai/hl/stp/tactic/goalie/goalie_fsm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include "software/ai/evaluation/intercept.h"
#include "software/ai/hl/stp/tactic/move_primitive.h"
#include "software/math/math_functions.h"
#include "software/logger/logger.h"

GoalieFSM::GoalieFSM(std::shared_ptr<const TbotsProto::AiConfig> ai_config_ptr,
TbotsProto::MaxAllowedSpeedMode max_allowed_speed_mode)
Expand Down Expand Up @@ -167,9 +168,13 @@ bool GoalieFSM::shouldPanic(const Update& event)
bool GoalieFSM::shouldPivotChip(const Update& event)
{
double ball_speed_panic = ai_config_ptr->goalie_tactic_config().ball_speed_panic();
return event.common.world_ptr->ball().velocity().length() <= ball_speed_panic &&
bool chip = event.common.world_ptr->ball().velocity().length() <= ball_speed_panic &&
event.common.world_ptr->field().pointInFriendlyDefenseArea(
event.common.world_ptr->ball().position());
if (chip){LOG(INFO)<<"CHIPPED" <<std::endl;}


return chip;
}

bool GoalieFSM::panicDone(const Update& event)
Expand Down
18 changes: 9 additions & 9 deletions src/software/ai/hl/stp/tactic/goalie/goalie_tactic_test.py
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import pytest

import software.python_bindings as tbots_cpp

from proto.import_all_protos import *
from software.simulated_tests.validation.robot_enters_region import *
from proto.message_translation.tbots_protobuf import create_world_state
from software.simulated_tests.simulated_test_fixture import (
pytest_main,
)
from software.simulated_tests.validation.ball_enters_region import *
from software.simulated_tests.validation.ball_moves_in_direction import *
from software.simulated_tests.validation.friendly_has_ball_possession import *
from software.simulated_tests.validation.ball_speed_threshold import *
from software.simulated_tests.validation.robot_speed_threshold import *
from software.simulated_tests.validation.excessive_dribbling import *
from software.simulated_tests.simulated_test_fixture import (
pytest_main,
)
from proto.message_translation.tbots_protobuf import create_world_state
from software.simulated_tests.validation.friendly_has_ball_possession import *
from software.simulated_tests.validation.robot_enters_region import *
from software.simulated_tests.validation.robot_speed_threshold import *


@pytest.mark.parametrize(
Expand All @@ -28,7 +28,7 @@
+ tbots_cpp.Vector(0, -0.5),
),
# test ball very fast misses net
(tbots_cpp.Point(0, 0), tbots_cpp.Vector(-5, 1), tbots_cpp.Point(-4.5, 0)),
(tbots_cpp.Point(0, 0), tbots_cpp.Vector(-5, 1), tbots_cpp.Point(-4.3, 0)),
# test ball very fast get saved
# TODO (#3377): This test is flaky due to inconsistent goalie reach. The linked ticket may provide a permanent fix.
(
Expand Down
1 change: 0 additions & 1 deletion src/software/ai/hl/stp/tactic/kick/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ cc_test(
"//software/test_util",
],
)

py_test(
name = "kick_tactic_test",
srcs = ["kick_tactic_test.py"],
Expand Down
1 change: 0 additions & 1 deletion src/software/ai/hl/stp/tactic/pivot_kick/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@ cc_test(
"//software/test_util",
],
)

py_test(
name = "pivot_kick_tactic_test",
srcs = ["pivot_kick_tactic_test.py"],
Expand Down
1 change: 0 additions & 1 deletion src/software/ai/hl/stp/tactic/receiver/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ cc_test(
"@googletest//:gtest_main",
],
)

py_test(
name = "receiver_tactic_test",
srcs = ["receiver_tactic_test.py"],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,9 @@ def __init__(

self.is_stationary = True

def get_validation_status(self, world: tbots.World) -> ValidationStatus:
def get_validation_status(
self, world: tbots.World, simulator_state=None
) -> ValidationStatus:
"""Checks if a specific robot id is in the provided region
Then checks if that robot is stationary within a threshold for the provided number of ticks

Expand Down
6 changes: 3 additions & 3 deletions src/software/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ const std::string ROBOT_KICK_EXP_COEFF_CONFIG_KEY = "kick_coeff";
const std::string ROBOT_CHIP_PULSE_WIDTH_CONFIG_KEY = "chip_pulse_width";

const std::string SSL_VISION_ADDRESS = "224.5.23.2";
static constexpr unsigned int SSL_VISION_PORT = 10020;
static constexpr unsigned int SSL_VISION_PORT = 10006;

const std::string SSL_REFEREE_ADDRESS = "224.5.23.1";
static constexpr unsigned int SSL_REFEREE_PORT = 10003;
const std::string SSL_REFEREE_ADDRESS = "224.5.23.2";
static constexpr unsigned int SSL_REFEREE_PORT = 10005;
23 changes: 22 additions & 1 deletion src/software/er_force_simulator_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ int main(int argc, char** argv)
{
std::string runtime_dir = args.runtime_dir;
LoggerSingleton::initializeLogger(runtime_dir, nullptr);
LOG(CSV, "realism_kalman_filter_v12.csv") << "timestamp_s,fused_x,fused_y,fused_vel_x, fused_vel_y, truth_x,truth_y, true_vel_x, true_vel_y,is_occluded\n";

/**
* Creates a ER force simulator and sets up the appropriate
Expand Down Expand Up @@ -134,6 +135,7 @@ int main(int argc, char** argv)
runtime_dir + WORLD_STATE_RECEIVED_TRIGGER_PATH);

bool has_sent_world_state_trigger = false;
double start_timestamp_s = 0.0;

// Inputs
// World State Input: Configures the ERForceSimulator
Expand Down Expand Up @@ -222,7 +224,26 @@ int main(int argc, char** argv)
yellow_robot_status_output.sendProto(packet);
}

simulator_state_output.sendProto(er_force_sim->getSimulatorState());
auto sim_state = er_force_sim->getSimulatorState();
double current_ts = yellow_vision.time_sent().epoch_timestamp_seconds();
if (start_timestamp_s == 0.0)
{
start_timestamp_s = current_ts;
}
LOG(CSV, "realism_kalman_filter_v12.csv")
<< (current_ts - start_timestamp_s) << ","
<< yellow_vision.ball().current_state().global_position().x_meters()
<< ","
<< yellow_vision.ball().current_state().global_position().y_meters()
<< ","
<< yellow_vision.ball().current_state().global_velocity().x_component_meters()
<< ","
<< yellow_vision.ball().current_state().global_velocity().y_component_meters()
<< "," << sim_state.ball().p_x() << "," << sim_state.ball().p_y()
<< "," << sim_state.ball().v_x() << "," << sim_state.ball().v_y()
<< "," << !er_force_sim->isBallVisible()
<< "\n";
simulator_state_output.sendProto(sim_state);
});

// This blocks forever without using the CPU
Expand Down
3 changes: 3 additions & 0 deletions src/software/networking/unix/proto_unix_listener.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
#pragma once

#include <sys/stat.h>

#include <boost/asio.hpp>
#include <string>

Expand Down Expand Up @@ -73,6 +75,7 @@ ProtoUnixListener<ReceiveProtoT>::ProtoUnixListener(

socket_.open();
socket_.bind(listen_endpoint_);
::chmod(unix_path.c_str(), 0777);

boost::asio::local::datagram_protocol::socket::receive_buffer_size option(
UNIX_BUFFER_SIZE);
Expand Down
39 changes: 15 additions & 24 deletions src/software/sensor_fusion/filter/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,31 @@ cc_library(
)

cc_library(
name = "ball_filter",
srcs = ["ball_filter.cpp"],
hdrs = ["ball_filter.h"],
name = "kalman_filter",
srcs = ["kalman_filter.cpp"],
hdrs = ["kalman_filter.h"],
deps = [
"@eigen",
],
)
cc_library(
name = "ball_tracker",
srcs = ["ball_tracker.cpp"],
hdrs = ["ball_tracker.h"],
deps = [
":vision_detection",
":kalman_filter",
"//software/geom/algorithms",
"//software/math:math_functions",
"//software/world:ball",
"//software/world:field",
"//software/world:robot",
"//software:constants",
"@boost//:circular_buffer",
"@eigen",
],
)

cc_test(
name = "ball_filter_test",
srcs = ["ball_filter_test.cpp"],
deps = [
":ball_filter",
"//shared/test_util:tbots_gtest_main",
"//software/world:field",
],
)

cc_library(
name = "robot_filter",
Expand Down Expand Up @@ -83,18 +85,7 @@ cc_test(
cc_library(
name = "sensor_fusion_filters",
deps = [
":ball_filter",
":ball_tracker",
":robot_team_filter",
],
)

py_test(
name = "ball_occlusion_test",
srcs = ["ball_occlusion_test.py"],
tags = ["exclusive"],
deps = [
"//software:conftest",
"//software/simulated_tests/validation:validations",
requirement("pytest"),
],
)
Loading
Loading