From b88713c365cc0eca6bb2fa65db6936cf3d6a8042 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Feb 2026 11:50:57 -0800 Subject: [PATCH 01/16] testing github --- src/proto/message_translation/tbots_protobuf.h | 1 + 1 file changed, 1 insertion(+) diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index 50ab53c374..c51a273b1c 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -10,6 +10,7 @@ #include "software/ai/passing/pass_with_rating.h" #include "software/world/world.h" +/** testing */ /** * Returns a TbotsProto::World proto given a World. * From 7cd3c4d8e9dea021d49cf8d9346984e11cdbfcb9 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:03:47 -0700 Subject: [PATCH 02/16] createWorldProto --- src/proto/message_translation/tbots_protobuf.cpp | 2 +- src/proto/message_translation/tbots_protobuf.h | 2 +- .../simulated_er_force_sim_play_test_fixture.cpp | 2 +- .../simulated_tests/simulated_er_force_sim_test_fixture.cpp | 2 +- src/software/world/world_test.cpp | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index cc21417cd7..43ef5d79ee 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -4,7 +4,7 @@ #include "software/logger/logger.h" -std::unique_ptr createWorld(const World& world) +std::unique_ptr createWorldProto(const World& world) { // create msg auto world_msg = std::make_unique(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index c51a273b1c..962a8f499e 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -19,7 +19,7 @@ * @return The unique_ptr to a TbotsProto::World proto containing the field, friendly * team, enemy team, ball, and the game state. */ -std::unique_ptr createWorld(const World& world); +std::unique_ptr createWorldProto(const World& world); /** * Returns a TbotsProto::World proto with a sequence number given a World and a sequence diff --git a/src/software/simulated_tests/simulated_er_force_sim_play_test_fixture.cpp b/src/software/simulated_tests/simulated_er_force_sim_play_test_fixture.cpp index 3f7d1bad72..246d67a56b 100644 --- a/src/software/simulated_tests/simulated_er_force_sim_play_test_fixture.cpp +++ b/src/software/simulated_tests/simulated_er_force_sim_play_test_fixture.cpp @@ -92,7 +92,7 @@ void SimulatedErForceSimPlayTestFixture::updatePrimitives( double duration_ms = ::TestUtil::millisecondsSince(start_tick_time); registerFriendlyTickTime(duration_ms); - auto world_msg = createWorld(world_with_updated_game_state); + auto world_msg = createWorldProto(world_with_updated_game_state); simulator_to_update->setYellowRobotPrimitiveSet(*primitive_set_msg, std::move(world_msg)); } diff --git a/src/software/simulated_tests/simulated_er_force_sim_test_fixture.cpp b/src/software/simulated_tests/simulated_er_force_sim_test_fixture.cpp index a855576af0..c8b0068ce8 100644 --- a/src/software/simulated_tests/simulated_er_force_sim_test_fixture.cpp +++ b/src/software/simulated_tests/simulated_er_force_sim_test_fixture.cpp @@ -533,7 +533,7 @@ bool SimulatedErForceSimTestFixture::tickTest( { *friendly_world = friendly_sensor_fusion.getWorld().value(); *enemy_world = enemy_sensor_fusion.getWorld().value(); - LOG(VISUALIZE) << *createWorld(*friendly_world); + LOG(VISUALIZE) << *createWorldProto(*friendly_world); validation_functions_done = validateAndCheckCompletion( terminating_function_validators, non_terminating_function_validators); diff --git a/src/software/world/world_test.cpp b/src/software/world/world_test.cpp index 76059fd78b..5a26b2d361 100644 --- a/src/software/world/world_test.cpp +++ b/src/software/world/world_test.cpp @@ -65,7 +65,7 @@ TEST_F(WorldTest, construction_with_parameters) TEST_F(WorldTest, construct_with_protobuf) { - auto world_proto = createWorld(world); + auto world_proto = createWorldProto(world); World proto_converted_world(*world_proto); // Can not compare the two World objects since TbotsProto::Team does not store the From a116769ed360b32fff738754217dbf7d52c28f63 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:04:55 -0700 Subject: [PATCH 03/16] createWorldWithSequenceNumberProto --- src/proto/message_translation/tbots_protobuf.cpp | 2 +- src/proto/message_translation/tbots_protobuf.h | 2 +- src/software/backend/unix_simulator_backend.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index 43ef5d79ee..805a649908 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -22,7 +22,7 @@ std::unique_ptr createWorldProto(const World& world) return world_msg; } -std::unique_ptr createWorldWithSequenceNumber( +std::unique_ptr createWorldWithSequenceNumberProto( const World& world, const uint64_t sequence_number) { // create msg diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index 962a8f499e..fc16b0782e 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -31,7 +31,7 @@ std::unique_ptr createWorldProto(const World& world); * @return The unique_ptr to a TbotsProto::World proto containing the field, friendly * team, enemy team, ball, game state, and the sequence number. */ -std::unique_ptr createWorldWithSequenceNumber( +std::unique_ptr createWorldWithSequenceNumberProto( const World& world, const uint64_t sequence_number); /** diff --git a/src/software/backend/unix_simulator_backend.cpp b/src/software/backend/unix_simulator_backend.cpp index 66c7d33aaf..5d3d12484a 100644 --- a/src/software/backend/unix_simulator_backend.cpp +++ b/src/software/backend/unix_simulator_backend.cpp @@ -98,7 +98,7 @@ void UnixSimulatorBackend::onValueReceived(TbotsProto::PrimitiveSet primitives) void UnixSimulatorBackend::onValueReceived(World world) { - world_output->sendProto(*createWorldWithSequenceNumber(world, sequence_number++)); + world_output->sendProto(*createWorldWithSequenceNumberProto(world, sequence_number++)); LOG(VISUALIZE) << *createNamedValue( "World Hz", From 252835022a02a937c98f03df5369cf5640f0198e Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:07:57 -0700 Subject: [PATCH 04/16] createTeamProto --- src/proto/message_translation/tbots_protobuf.cpp | 10 +++++----- src/proto/message_translation/tbots_protobuf.h | 2 +- src/software/world/team_test.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index 805a649908..c031ad2f1c 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -10,8 +10,8 @@ std::unique_ptr createWorldProto(const World& world) auto world_msg = std::make_unique(); *(world_msg->mutable_time_sent()) = *createCurrentTimestamp(); *(world_msg->mutable_field()) = *createField(world.field()); - *(world_msg->mutable_friendly_team()) = *createTeam(world.friendlyTeam()); - *(world_msg->mutable_enemy_team()) = *createTeam(world.enemyTeam()); + *(world_msg->mutable_friendly_team()) = *createTeamProto(world.friendlyTeam()); + *(world_msg->mutable_enemy_team()) = *createTeamProto(world.enemyTeam()); *(world_msg->mutable_ball()) = *createBall(world.ball()); *(world_msg->mutable_game_state()) = *createGameState(world.gameState()); if (world.getDribbleDisplacement().has_value()) @@ -29,8 +29,8 @@ std::unique_ptr createWorldWithSequenceNumberProto( auto world_msg = std::make_unique(); *(world_msg->mutable_time_sent()) = *createCurrentTimestamp(); *(world_msg->mutable_field()) = *createField(world.field()); - *(world_msg->mutable_friendly_team()) = *createTeam(world.friendlyTeam()); - *(world_msg->mutable_enemy_team()) = *createTeam(world.enemyTeam()); + *(world_msg->mutable_friendly_team()) = *createTeamProto(world.friendlyTeam()); + *(world_msg->mutable_enemy_team()) = *createTeamProto(world.enemyTeam()); *(world_msg->mutable_ball()) = *createBall(world.ball()); *(world_msg->mutable_game_state()) = *createGameState(world.gameState()); world_msg->set_sequence_number(sequence_number); @@ -43,7 +43,7 @@ std::unique_ptr createWorldWithSequenceNumberProto( } -std::unique_ptr createTeam(const Team& team) +std::unique_ptr createTeamProto(const Team& team) { // create msg auto team_msg = std::make_unique(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index fc16b0782e..65c3c9778c 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -42,7 +42,7 @@ std::unique_ptr createWorldWithSequenceNumberProto( * @return The unique_ptr to a TbotsProto::Team proto containing a list of robots and * goalie ID */ -std::unique_ptr createTeam(const Team& team); +std::unique_ptr createTeamProto(const Team& team); /** * Returns a TbotsProto::Robot proto given a Robot. diff --git a/src/software/world/team_test.cpp b/src/software/world/team_test.cpp index c0e55065f8..9941ed5a20 100644 --- a/src/software/world/team_test.cpp +++ b/src/software/world/team_test.cpp @@ -85,7 +85,7 @@ TEST_F(TeamTest, construct_with_protobuf) std::vector robot_list = {robot_0, robot_1, robot_2}; Team original_team = Team(robot_list); - auto proto_team = createTeam(original_team); + auto proto_team = createTeamProto(original_team); Team proto_converted_team(*proto_team); // Proto representation of Team does not store the robot_expiry_buffer_duration, so we From 1bfa0e0ff3dc220b7d90659bf6238287193871a5 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:14:15 -0700 Subject: [PATCH 05/16] createRobotProto --- src/proto/message_translation/tbots_protobuf.cpp | 4 ++-- src/proto/message_translation/tbots_protobuf.h | 2 +- src/software/world/robot_test.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index c031ad2f1c..7e31238f71 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -51,7 +51,7 @@ std::unique_ptr createTeamProto(const Team& team) std::for_each(robots.begin(), robots.end(), [&](const Robot& robot) - { *(team_msg->add_team_robots()) = *createRobot(robot); }); + { *(team_msg->add_team_robots()) = *createRobotProto(robot); }); auto goalie_id = team.getGoalieId(); if (goalie_id.has_value()) @@ -62,7 +62,7 @@ std::unique_ptr createTeamProto(const Team& team) return team_msg; } -std::unique_ptr createRobot(const Robot& robot) +std::unique_ptr createRobotProto(const Robot& robot) { // create msg auto robot_msg = std::make_unique(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index 65c3c9778c..4a8bf11884 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -52,7 +52,7 @@ std::unique_ptr createTeamProto(const Team& team); * @return The unique_ptr to a TbotsProto::Robot proto containing the robot ID and robot * state */ -std::unique_ptr createRobot(const Robot& robot); +std::unique_ptr createRobotProto(const Robot& robot); /** * Returns a TbotsProto::Ball proto given a Ball. diff --git a/src/software/world/robot_test.cpp b/src/software/world/robot_test.cpp index e3bda4b593..4ae2e5f79f 100644 --- a/src/software/world/robot_test.cpp +++ b/src/software/world/robot_test.cpp @@ -79,7 +79,7 @@ TEST_F(RobotTest, construct_with_protobuf) current_time, std::set{RobotCapability::Chip, RobotCapability::Move, RobotCapability::Kick, RobotCapability::Dribble}); - auto robot_proto = createRobot(original_robot); + auto robot_proto = createRobotProto(original_robot); Robot proto_converted_robot(*robot_proto); EXPECT_THAT( From 703f70a77d2cdac0d1e6e71ec0691888ebddb061 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:16:43 -0700 Subject: [PATCH 06/16] createBallProto --- src/proto/message_translation/tbots_protobuf.cpp | 8 ++++---- src/proto/message_translation/tbots_protobuf.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index 7e31238f71..7033b9b99f 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -12,7 +12,7 @@ std::unique_ptr createWorldProto(const World& world) *(world_msg->mutable_field()) = *createField(world.field()); *(world_msg->mutable_friendly_team()) = *createTeamProto(world.friendlyTeam()); *(world_msg->mutable_enemy_team()) = *createTeamProto(world.enemyTeam()); - *(world_msg->mutable_ball()) = *createBall(world.ball()); + *(world_msg->mutable_ball()) = *createBallProto(world.ball()); *(world_msg->mutable_game_state()) = *createGameState(world.gameState()); if (world.getDribbleDisplacement().has_value()) { @@ -31,7 +31,7 @@ std::unique_ptr createWorldWithSequenceNumberProto( *(world_msg->mutable_field()) = *createField(world.field()); *(world_msg->mutable_friendly_team()) = *createTeamProto(world.friendlyTeam()); *(world_msg->mutable_enemy_team()) = *createTeamProto(world.enemyTeam()); - *(world_msg->mutable_ball()) = *createBall(world.ball()); + *(world_msg->mutable_ball()) = *createBallProto(world.ball()); *(world_msg->mutable_game_state()) = *createGameState(world.gameState()); world_msg->set_sequence_number(sequence_number); if (world.getDribbleDisplacement().has_value()) @@ -96,7 +96,7 @@ std::unique_ptr createRobotProto(const Robot& robot) return robot_msg; } -std::unique_ptr createBall(const Ball& ball) +std::unique_ptr createBallProto(const Ball& ball) { // create msg auto ball_msg = std::make_unique(); @@ -283,7 +283,7 @@ std::unique_ptr createGameState(const GameState& game_sta auto ball_state = game_state.getBall(); if (ball_state.has_value()) { - *(game_state_msg->mutable_ball()) = *createBall(ball_state.value()); + *(game_state_msg->mutable_ball()) = *createBallProto(ball_state.value()); } auto ball_placement_point = game_state.getBallPlacementPoint(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index 4a8bf11884..f7c33d3fc6 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -62,7 +62,7 @@ std::unique_ptr createRobotProto(const Robot& robot); * @return The unique_ptr to a TbotsProto::Ball proto containing the ball state and the * ball acceleration */ -std::unique_ptr createBall(const Ball& ball); +std::unique_ptr createBallProto(const Ball& ball); /** * Returns a TbotsProto::Field proto given a Field. From bbfdbec0a4ac7fa6673818bf70900ab7c43e89be Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:25:16 -0700 Subject: [PATCH 07/16] createFieldProto --- src/proto/message_translation/tbots_protobuf.cpp | 6 +++--- src/proto/message_translation/tbots_protobuf.h | 2 +- src/software/world/ball_test.cpp | 2 +- src/software/world/field_test.cpp | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index 7033b9b99f..dd68bc3742 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -9,7 +9,7 @@ std::unique_ptr createWorldProto(const World& world) // create msg auto world_msg = std::make_unique(); *(world_msg->mutable_time_sent()) = *createCurrentTimestamp(); - *(world_msg->mutable_field()) = *createField(world.field()); + *(world_msg->mutable_field()) = *createFieldProto(world.field()); *(world_msg->mutable_friendly_team()) = *createTeamProto(world.friendlyTeam()); *(world_msg->mutable_enemy_team()) = *createTeamProto(world.enemyTeam()); *(world_msg->mutable_ball()) = *createBallProto(world.ball()); @@ -28,7 +28,7 @@ std::unique_ptr createWorldWithSequenceNumberProto( // create msg auto world_msg = std::make_unique(); *(world_msg->mutable_time_sent()) = *createCurrentTimestamp(); - *(world_msg->mutable_field()) = *createField(world.field()); + *(world_msg->mutable_field()) = *createFieldProto(world.field()); *(world_msg->mutable_friendly_team()) = *createTeamProto(world.friendlyTeam()); *(world_msg->mutable_enemy_team()) = *createTeamProto(world.enemyTeam()); *(world_msg->mutable_ball()) = *createBallProto(world.ball()); @@ -106,7 +106,7 @@ std::unique_ptr createBallProto(const Ball& ball) return ball_msg; } -std::unique_ptr createField(const Field& field) +std::unique_ptr createFieldProto(const Field& field) { // create msg auto field_msg = std::make_unique(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index f7c33d3fc6..7a35a14259 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -72,7 +72,7 @@ std::unique_ptr createBallProto(const Ball& ball); * @return The unique_ptr to a TbotsProto::Field proto containing the Ball ID and Ball * state */ -std::unique_ptr createField(const Field& field); +std::unique_ptr createFieldProto(const Field& field); /** * Returns (Robot, Game, Ball) State given a (Robot, Game, Ball) diff --git a/src/software/world/ball_test.cpp b/src/software/world/ball_test.cpp index 4d0870a994..4b9ddba2e4 100644 --- a/src/software/world/ball_test.cpp +++ b/src/software/world/ball_test.cpp @@ -58,7 +58,7 @@ TEST_F(BallTest, construct_with_initial_state) TEST_F(BallTest, construct_with_protobuf) { Ball original_ball(Point(1.0, 1.0), Vector(2.0, 2.0), Timestamp::fromSeconds(3.0)); - std::unique_ptr ball_proto = createBall(original_ball); + std::unique_ptr ball_proto = createBallProto(original_ball); Ball proto_converted_ball(*ball_proto); EXPECT_EQ(original_ball, proto_converted_ball); diff --git a/src/software/world/field_test.cpp b/src/software/world/field_test.cpp index 15b98f179b..04b7ae5dea 100644 --- a/src/software/world/field_test.cpp +++ b/src/software/world/field_test.cpp @@ -209,7 +209,7 @@ TEST_F(FieldTest, construct_with_parameters) TEST_F(FieldTest, construct_with_protobuf) { Field original_field = Field::createSSLDivisionAField(); - auto field_proto = createField(original_field); + auto field_proto = createFieldProto(original_field); Field proto_converted_field(*field_proto); EXPECT_EQ(original_field, proto_converted_field); From 080b521e6cf574255212178155b8d7e8a4b47849 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:41:16 -0700 Subject: [PATCH 08/16] createGameStateProto --- src/proto/message_translation/tbots_protobuf.cpp | 6 +++--- src/proto/message_translation/tbots_protobuf.h | 2 +- src/software/world/game_state_test.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index dd68bc3742..386c8fd807 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -13,7 +13,7 @@ std::unique_ptr createWorldProto(const World& world) *(world_msg->mutable_friendly_team()) = *createTeamProto(world.friendlyTeam()); *(world_msg->mutable_enemy_team()) = *createTeamProto(world.enemyTeam()); *(world_msg->mutable_ball()) = *createBallProto(world.ball()); - *(world_msg->mutable_game_state()) = *createGameState(world.gameState()); + *(world_msg->mutable_game_state()) = *createGameStateProto(world.gameState()); if (world.getDribbleDisplacement().has_value()) { *(world_msg->mutable_dribble_displacement()) = @@ -32,7 +32,7 @@ std::unique_ptr createWorldWithSequenceNumberProto( *(world_msg->mutable_friendly_team()) = *createTeamProto(world.friendlyTeam()); *(world_msg->mutable_enemy_team()) = *createTeamProto(world.enemyTeam()); *(world_msg->mutable_ball()) = *createBallProto(world.ball()); - *(world_msg->mutable_game_state()) = *createGameState(world.gameState()); + *(world_msg->mutable_game_state()) = *createGameStateProto(world.gameState()); world_msg->set_sequence_number(sequence_number); if (world.getDribbleDisplacement().has_value()) { @@ -146,7 +146,7 @@ std::unique_ptr createRobotStateProto( return robot_state_msg; } -std::unique_ptr createGameState(const GameState& game_state) +std::unique_ptr createGameStateProto(const GameState& game_state) { auto game_state_msg = std::make_unique(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index 7a35a14259..283e1a4b42 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -84,7 +84,7 @@ std::unique_ptr createFieldProto(const Field& field); std::unique_ptr createRobotStateProto(const Robot& robot); std::unique_ptr createRobotStateProto( const RobotState& robot_state); -std::unique_ptr createGameState(const GameState& game_state); +std::unique_ptr createGameStateProto(const GameState& game_state); std::unique_ptr createBallState(const Ball& ball); /** diff --git a/src/software/world/game_state_test.cpp b/src/software/world/game_state_test.cpp index 4f256a7068..d0fa1d020f 100644 --- a/src/software/world/game_state_test.cpp +++ b/src/software/world/game_state_test.cpp @@ -69,7 +69,7 @@ TEST(GameStateTest, construct_with_protobuf) { GameState original_game_state; original_game_state.updateRefereeCommand(RefereeCommand::DIRECT_FREE_US); - auto proto_game_state = createGameState(original_game_state); + auto proto_game_state = createGameStateProto(original_game_state); GameState proto_converted_game_state(*proto_game_state); EXPECT_EQ(original_game_state, proto_converted_game_state); From 683d54ca32b5b985948275db1a78221e46e5bd58 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:49:41 -0700 Subject: [PATCH 09/16] createBallStateProto --- src/proto/message_translation/tbots_protobuf.cpp | 4 ++-- src/proto/message_translation/tbots_protobuf.h | 2 +- src/proto/message_translation/tbots_protobuf_test.cpp | 2 +- src/software/world/ball_state_test.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index 386c8fd807..dd80534324 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -100,7 +100,7 @@ std::unique_ptr createBallProto(const Ball& ball) { // create msg auto ball_msg = std::make_unique(); - *(ball_msg->mutable_current_state()) = *createBallState(ball); + *(ball_msg->mutable_current_state()) = *createBallStateProto(ball); *(ball_msg->mutable_timestamp()) = *createTimestamp(ball.timestamp()); return ball_msg; @@ -296,7 +296,7 @@ std::unique_ptr createGameStateProto(const GameState& gam return game_state_msg; } -std::unique_ptr createBallState(const Ball& ball) +std::unique_ptr createBallStateProto(const Ball& ball) { auto position = createPointProto(ball.position()); auto velocity = createVectorProto(ball.velocity()); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index 283e1a4b42..48cb88c2af 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -85,7 +85,7 @@ std::unique_ptr createRobotStateProto(const Robot& robot std::unique_ptr createRobotStateProto( const RobotState& robot_state); std::unique_ptr createGameStateProto(const GameState& game_state); -std::unique_ptr createBallState(const Ball& ball); +std::unique_ptr createBallStateProto(const Ball& ball); /** * Returns a TbotsProto::Timestamp proto given a timestamp. diff --git a/src/proto/message_translation/tbots_protobuf_test.cpp b/src/proto/message_translation/tbots_protobuf_test.cpp index 9cdde04170..8ba908cb83 100644 --- a/src/proto/message_translation/tbots_protobuf_test.cpp +++ b/src/proto/message_translation/tbots_protobuf_test.cpp @@ -137,7 +137,7 @@ TEST(TbotsProtobufTest, ball_state_msg_test) auto velocity = Vector(4.20, 4.20); Ball ball(position, velocity, Timestamp::fromSeconds(0)); - auto ball_state_msg = createBallState(ball); + auto ball_state_msg = createBallStateProto(ball); TbotsProtobufTest::assertBallStateMessageFromBall(ball, *ball_state_msg); } diff --git a/src/software/world/ball_state_test.cpp b/src/software/world/ball_state_test.cpp index 099473f140..927e1daf07 100644 --- a/src/software/world/ball_state_test.cpp +++ b/src/software/world/ball_state_test.cpp @@ -64,7 +64,7 @@ TEST(BallStateTest, construct_with_protobuf) { BallState ball_state_1(Point(1, -2.3), Vector(0, 0.4), 0.1); Ball ball(ball_state_1, Timestamp()); - std::unique_ptr ball_state_proto = createBallState(ball); + std::unique_ptr ball_state_proto = createBallStateProto(ball); BallState ball_state_2(*ball_state_proto); EXPECT_TRUE(ball_state_1 == ball_state_2); From 80773172b5e072402246b0bb52e3816a86e2c110 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:51:07 -0700 Subject: [PATCH 10/16] createTimestampProto --- src/proto/message_translation/tbots_protobuf.cpp | 6 +++--- src/proto/message_translation/tbots_protobuf.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index dd80534324..9169851ca4 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -68,7 +68,7 @@ std::unique_ptr createRobotProto(const Robot& robot) auto robot_msg = std::make_unique(); robot_msg->set_id(robot.id()); *(robot_msg->mutable_current_state()) = *createRobotStateProto(robot); - *(robot_msg->mutable_timestamp()) = *createTimestamp(robot.timestamp()); + *(robot_msg->mutable_timestamp()) = *createTimestampProto(robot.timestamp()); for (RobotCapability capability : robot.getUnavailableCapabilities()) { @@ -101,7 +101,7 @@ std::unique_ptr createBallProto(const Ball& ball) // create msg auto ball_msg = std::make_unique(); *(ball_msg->mutable_current_state()) = *createBallStateProto(ball); - *(ball_msg->mutable_timestamp()) = *createTimestamp(ball.timestamp()); + *(ball_msg->mutable_timestamp()) = *createTimestampProto(ball.timestamp()); return ball_msg; } @@ -309,7 +309,7 @@ std::unique_ptr createBallStateProto(const Ball& ball) return ball_state_msg; } -std::unique_ptr createTimestamp(const Timestamp& timestamp) +std::unique_ptr createTimestampProto(const Timestamp& timestamp) { auto timestamp_msg = std::make_unique(); timestamp_msg->set_epoch_timestamp_seconds(timestamp.toSeconds()); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index 48cb88c2af..c6b621ff3f 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -95,7 +95,7 @@ std::unique_ptr createBallStateProto(const Ball& ball); * @return The unique_ptr to a TbotsProto::Timestamp proto containing the timestamp with * the same time zone as the timestamp argument. */ -std::unique_ptr createTimestamp(const Timestamp& timestamp); +std::unique_ptr createTimestampProto(const Timestamp& timestamp); /** * Returns a TbotsProto::NamedValue proto given a name and value. From 032faabb1eab60fa6083a57fcb1dd9cf99e261b7 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:52:13 -0700 Subject: [PATCH 11/16] createNamedValueProto --- src/proto/message_translation/tbots_protobuf.cpp | 2 +- src/proto/message_translation/tbots_protobuf.h | 2 +- src/software/backend/unix_simulator_backend.cpp | 6 +++--- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index 9169851ca4..ad5edd1581 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -316,7 +316,7 @@ std::unique_ptr createTimestampProto(const Timestamp& tim return timestamp_msg; } -std::unique_ptr createNamedValue(const std::string name, +std::unique_ptr createNamedValueProto(const std::string name, float value) { auto named_value_msg = std::make_unique(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index c6b621ff3f..2377d82488 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -106,7 +106,7 @@ std::unique_ptr createTimestampProto(const Timestamp& tim * @return The unique_ptr to a TbotsProto::NamedValue proto containing data with * specified name and value */ -std::unique_ptr createNamedValue(const std::string name, +std::unique_ptr createNamedValueProto(const std::string name, float value); /** diff --git a/src/software/backend/unix_simulator_backend.cpp b/src/software/backend/unix_simulator_backend.cpp index 5d3d12484a..9eaf971b09 100644 --- a/src/software/backend/unix_simulator_backend.cpp +++ b/src/software/backend/unix_simulator_backend.cpp @@ -90,7 +90,7 @@ void UnixSimulatorBackend::onValueReceived(TbotsProto::PrimitiveSet primitives) { primitive_output->sendProto(primitives); - LOG(VISUALIZE) << *createNamedValue( + LOG(VISUALIZE) << *createNamedValueProto( "Primitive Hz", static_cast(FirstInFirstOutThreadedObserver< TbotsProto::PrimitiveSet>::getDataReceivedPerSecond())); @@ -98,9 +98,9 @@ void UnixSimulatorBackend::onValueReceived(TbotsProto::PrimitiveSet primitives) void UnixSimulatorBackend::onValueReceived(World world) { - world_output->sendProto(*createWorldWithSequenceNumberProto(world, sequence_number++)); + world_output->sendProto(*createWorldWithSequenceNumber(world, sequence_number++)); - LOG(VISUALIZE) << *createNamedValue( + LOG(VISUALIZE) << *createNamedValueProto( "World Hz", static_cast( FirstInFirstOutThreadedObserver::getDataReceivedPerSecond())); From 4250cfdcc573d5df803d29fbcc4f6c359acc06dc Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:55:31 -0700 Subject: [PATCH 12/16] createDebugShapeProto --- src/proto/message_translation/tbots_protobuf.cpp | 2 +- src/proto/message_translation/tbots_protobuf.h | 12 ++++++------ src/software/ai/passing/pass_generator.cpp | 4 ++-- .../ai/passing/receiver_position_generator.hpp | 4 ++-- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index ad5edd1581..788da53331 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -325,7 +325,7 @@ std::unique_ptr createNamedValueProto(const std::string return named_value_msg; } -std::unique_ptr createPlotJugglerValue( +std::unique_ptr createPlotJugglerValueProto( const std::map& values) { auto plot_juggler_value_msg = std::make_unique(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index 2377d82488..2fd5bd32e0 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -114,7 +114,7 @@ std::unique_ptr createNamedValueProto(const std::string * value pairs of the map. * * Could use LOG(PLOTJUGGLER) to plot the values. Example: - * LOG(PLOTJUGGLER) << *createPlotJugglerValue({ + * LOG(PLOTJUGGLER) << *createPlotJugglerValueProto({ * {"vx", velocity.x()}, * {"vy", velocity.y()} * }); @@ -124,7 +124,7 @@ std::unique_ptr createNamedValueProto(const std::string * @return The unique_ptr to a TbotsProto::PlotJugglerValue proto containing data with * specified names and values */ -std::unique_ptr createPlotJugglerValue( +std::unique_ptr createPlotJugglerValueProto( const std::map& values); /** @@ -142,7 +142,7 @@ std::unique_ptr createPlotJugglerValue( * @return The unique_ptr to a TbotsProto::DebugShapes::DebugShape proto */ template -std::unique_ptr createDebugShape( +std::unique_ptr createDebugShapeProto( const Shape& shape, const std::string& unique_id, const std::string& debug_text = "") { auto debug_shape = std::make_unique(); @@ -157,9 +157,9 @@ std::unique_ptr createDebugShape( * * Could use LOG(VISUALIZE) to plot these values. Example: * LOG(VISUALIZE) << *createDebugShapes({ - * *createDebugShape(circle, unique_id1, optional_text), - * *createDebugShape(polygon, unique_id2, optional_text), - * *createDebugShape(stadium, unique_id3, optional_text) + * *createDebugShapeProto(circle, unique_id1, optional_text), + * *createDebugShapeProto(polygon, unique_id2, optional_text), + * *createDebugShapeProto(stadium, unique_id3, optional_text) * }); * * @param debug_shapes A list of debug shapes proto to plot diff --git a/src/software/ai/passing/pass_generator.cpp b/src/software/ai/passing/pass_generator.cpp index ab9618d9f4..247fd26bf9 100644 --- a/src/software/ai/passing/pass_generator.cpp +++ b/src/software/ai/passing/pass_generator.cpp @@ -36,7 +36,7 @@ PassWithRating PassGenerator::getBestPass(const World& world, { for (const Point& receiving_position : receiving_positions) { - debug_shapes.push_back(*createDebugShape( + debug_shapes.push_back(*createDebugShapeProto( Stadium(world.friendlyTeam().getRobotById(robot_id)->position(), receiving_position, 0.02), std::to_string(debug_shapes.size()) + "pg")); @@ -45,7 +45,7 @@ PassWithRating PassGenerator::getBestPass(const World& world, std::stringstream stream; stream << "BP:" << std::fixed << std::setprecision(3) << best_pass.rating; debug_shapes.push_back( - *createDebugShape(Circle(best_pass.pass.receiverPoint(), 0.05), + *createDebugShapeProto(Circle(best_pass.pass.receiverPoint(), 0.05), std::to_string(debug_shapes.size()) + "pg", stream.str())); LOG(VISUALIZE) << *createDebugShapes(debug_shapes); } diff --git a/src/software/ai/passing/receiver_position_generator.hpp b/src/software/ai/passing/receiver_position_generator.hpp index d7a691db25..413aee92f0 100644 --- a/src/software/ai/passing/receiver_position_generator.hpp +++ b/src/software/ai/passing/receiver_position_generator.hpp @@ -214,11 +214,11 @@ void ReceiverPositionGenerator::visualizeBestReceivingPositionsAndZone { for (unsigned int i = 0; i < top_zones.size(); i++) { - debug_shapes.push_back(*createDebugShape(pitch_division_->getZone(top_zones[i]), + debug_shapes.push_back(*createDebugShapeProto(pitch_division_->getZone(top_zones[i]), std::to_string(i + 1), std::to_string(i + 1))); - debug_shapes.push_back(*createDebugShape( + debug_shapes.push_back(*createDebugShapeProto( Circle( best_receiving_positions.find(top_zones[i])->second.pass.receiverPoint(), 0.15), From c9737b3fd81c7a0e417a2ac7ffb974eb64a6d555 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:57:21 -0700 Subject: [PATCH 13/16] createDebugShapesProto --- src/proto/message_translation/tbots_protobuf.cpp | 2 +- src/proto/message_translation/tbots_protobuf.h | 4 ++-- src/software/ai/passing/pass_generator.cpp | 2 +- src/software/ai/passing/receiver_position_generator.hpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index 788da53331..c52f84d1fe 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -340,7 +340,7 @@ std::unique_ptr createPlotJugglerValueProto( return plot_juggler_value_msg; } -std::unique_ptr createDebugShapes( +std::unique_ptr createDebugShapesProto( const std::vector& debug_shapes) { auto debug_shape_list_msg = std::make_unique(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index 2fd5bd32e0..13852450d3 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -156,7 +156,7 @@ std::unique_ptr createDebugShapeProto( * Returns a TbotsProto::DebugShapes proto containing the debug shapes * * Could use LOG(VISUALIZE) to plot these values. Example: - * LOG(VISUALIZE) << *createDebugShapes({ + * LOG(VISUALIZE) << *createDebugShapesProto({ * *createDebugShapeProto(circle, unique_id1, optional_text), * *createDebugShapeProto(polygon, unique_id2, optional_text), * *createDebugShapeProto(stadium, unique_id3, optional_text) @@ -167,7 +167,7 @@ std::unique_ptr createDebugShapeProto( * @return The unique_ptr to a TbotsProto::DebugShapes proto containing data with * specified names and shapes */ -std::unique_ptr createDebugShapes( +std::unique_ptr createDebugShapesProto( const std::vector& debug_shapes); /** diff --git a/src/software/ai/passing/pass_generator.cpp b/src/software/ai/passing/pass_generator.cpp index 247fd26bf9..5120e01c69 100644 --- a/src/software/ai/passing/pass_generator.cpp +++ b/src/software/ai/passing/pass_generator.cpp @@ -47,7 +47,7 @@ PassWithRating PassGenerator::getBestPass(const World& world, debug_shapes.push_back( *createDebugShapeProto(Circle(best_pass.pass.receiverPoint(), 0.05), std::to_string(debug_shapes.size()) + "pg", stream.str())); - LOG(VISUALIZE) << *createDebugShapes(debug_shapes); + LOG(VISUALIZE) << *createDebugShapesProto(debug_shapes); } // Generate sample passes across the field for cost visualization diff --git a/src/software/ai/passing/receiver_position_generator.hpp b/src/software/ai/passing/receiver_position_generator.hpp index 413aee92f0..8fb196653c 100644 --- a/src/software/ai/passing/receiver_position_generator.hpp +++ b/src/software/ai/passing/receiver_position_generator.hpp @@ -225,7 +225,7 @@ void ReceiverPositionGenerator::visualizeBestReceivingPositionsAndZone std::to_string(i + 1) + "rpg", std::to_string(i + 1) + "rpg")); } - LOG(VISUALIZE) << *createDebugShapes(debug_shapes); + LOG(VISUALIZE) << *createDebugShapesProto(debug_shapes); } template From 052dee9238be17b0c0e1f3c9fdcc9d763e0a06a1 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 12:59:59 -0700 Subject: [PATCH 14/16] createCurrentTimestampProto --- src/proto/message_translation/tbots_protobuf.cpp | 6 +++--- src/proto/message_translation/tbots_protobuf.h | 2 +- src/proto/message_translation/tbots_protobuf_test.cpp | 2 +- src/software/backend/backend.cpp | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index c52f84d1fe..c892daeaee 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -8,7 +8,7 @@ std::unique_ptr createWorldProto(const World& world) { // create msg auto world_msg = std::make_unique(); - *(world_msg->mutable_time_sent()) = *createCurrentTimestamp(); + *(world_msg->mutable_time_sent()) = *createCurrentTimestampProto(); *(world_msg->mutable_field()) = *createFieldProto(world.field()); *(world_msg->mutable_friendly_team()) = *createTeamProto(world.friendlyTeam()); *(world_msg->mutable_enemy_team()) = *createTeamProto(world.enemyTeam()); @@ -27,7 +27,7 @@ std::unique_ptr createWorldWithSequenceNumberProto( { // create msg auto world_msg = std::make_unique(); - *(world_msg->mutable_time_sent()) = *createCurrentTimestamp(); + *(world_msg->mutable_time_sent()) = *createCurrentTimestampProto(); *(world_msg->mutable_field()) = *createFieldProto(world.field()); *(world_msg->mutable_friendly_team()) = *createTeamProto(world.friendlyTeam()); *(world_msg->mutable_enemy_team()) = *createTeamProto(world.enemyTeam()); @@ -349,7 +349,7 @@ std::unique_ptr createDebugShapesProto( return debug_shape_list_msg; } -std::unique_ptr createCurrentTimestamp() +std::unique_ptr createCurrentTimestampProto() { auto timestamp_msg = std::make_unique(); const auto clock_time = std::chrono::system_clock::now(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index 13852450d3..969a9c47e8 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -186,7 +186,7 @@ std::unique_ptr createShapeProto(const Stadium& stadium); * * @return The unique_ptr to a TbotsProto::Timestamp with the current UTC time */ -std::unique_ptr createCurrentTimestamp(); +std::unique_ptr createCurrentTimestampProto(); /** * Return RobotState given the TbotsProto::RobotState protobuf diff --git a/src/proto/message_translation/tbots_protobuf_test.cpp b/src/proto/message_translation/tbots_protobuf_test.cpp index 8ba908cb83..200672801a 100644 --- a/src/proto/message_translation/tbots_protobuf_test.cpp +++ b/src/proto/message_translation/tbots_protobuf_test.cpp @@ -112,7 +112,7 @@ class TbotsProtobufTest : public ::testing::Test TEST(TbotsProtobufTest, timestamp_msg_test) { - auto timestamp_msg = createCurrentTimestamp(); + auto timestamp_msg = createCurrentTimestampProto(); TbotsProtobufTest::assertSaneTimestamp(*timestamp_msg); } diff --git a/src/software/backend/backend.cpp b/src/software/backend/backend.cpp index e3ceb9a8b7..0c4e5821bd 100644 --- a/src/software/backend/backend.cpp +++ b/src/software/backend/backend.cpp @@ -9,7 +9,7 @@ void Backend::receiveRobotStatus(TbotsProto::RobotStatus msg) { SensorProto sensor_msg; *(sensor_msg.add_robot_status_msgs()) = msg; - *(sensor_msg.mutable_backend_received_time()) = *createCurrentTimestamp(); + *(sensor_msg.mutable_backend_received_time()) = *createCurrentTimestampProto(); Subject::sendValueToObservers(sensor_msg); } @@ -17,7 +17,7 @@ void Backend::receiveSSLWrapperPacket(SSLProto::SSL_WrapperPacket msg) { SensorProto sensor_msg; *(sensor_msg.mutable_ssl_vision_msg()) = msg; - *(sensor_msg.mutable_backend_received_time()) = *createCurrentTimestamp(); + *(sensor_msg.mutable_backend_received_time()) = *createCurrentTimestampProto(); Subject::sendValueToObservers(sensor_msg); } @@ -25,7 +25,7 @@ void Backend::receiveSSLReferee(SSLProto::Referee msg) { SensorProto sensor_msg; *(sensor_msg.mutable_ssl_referee_msg()) = msg; - *(sensor_msg.mutable_backend_received_time()) = *createCurrentTimestamp(); + *(sensor_msg.mutable_backend_received_time()) = *createCurrentTimestampProto(); Subject::sendValueToObservers(sensor_msg); } From e4cc4413b3693109482f1c3dc48c3ca32093ba18 Mon Sep 17 00:00:00 2001 From: Maggie Tu Date: Sat, 28 Mar 2026 13:03:36 -0700 Subject: [PATCH 15/16] timestamp, passvis,trigger --- src/proto/message_translation/tbots_protobuf.cpp | 6 +++--- src/proto/message_translation/tbots_protobuf.h | 6 +++--- src/software/ai/passing/cost_function.cpp | 2 +- src/software/er_force_simulator_main.cpp | 2 +- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index c892daeaee..fbf1bc6394 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -378,7 +378,7 @@ BallState createBallState(const TbotsProto::BallState ball_state) ball_state.distance_from_ground()); } -std::unique_ptr createPassVisualization( +std::unique_ptr createPassVisualizationProto( const std::vector& passes_with_rating) { auto pass_visualization_msg = std::make_unique(); @@ -401,7 +401,7 @@ std::unique_ptr createPassVisualization( return pass_visualization_msg; } -std::unique_ptr createWorldStateReceivedTrigger() +std::unique_ptr createWorldStateReceivedTriggerProto() { auto world_state_received_trigger_msg = std::make_unique(); @@ -409,7 +409,7 @@ std::unique_ptr createWorldStateReceivedT return world_state_received_trigger_msg; } -std::unique_ptr createCostVisualization( +std::unique_ptr createCostVisualizationProto( const std::vector& costs, int num_rows, int num_cols) { auto cost_visualization_msg = std::make_unique(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index 969a9c47e8..c4a3baf181 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -211,7 +211,7 @@ BallState createBallState(const TbotsProto::BallState ball_state); * * @return The unique_ptr to a PassVisualization proto */ -std::unique_ptr createPassVisualization( +std::unique_ptr createPassVisualizationProto( const std::vector& passes_with_rating); /** @@ -221,7 +221,7 @@ std::unique_ptr createPassVisualization( * a boolean value for whether world state proto has been received * */ -std::unique_ptr createWorldStateReceivedTrigger(); +std::unique_ptr createWorldStateReceivedTriggerProto(); /** * Returns a cost visualization given a vector of costs @@ -232,7 +232,7 @@ std::unique_ptr createWorldStateReceivedT * * @return The unique_ptr to a CostVisualization proto */ -std::unique_ptr createCostVisualization( +std::unique_ptr createCostVisualizationProto( const std::vector& costs, int num_rows, int num_cols); /** diff --git a/src/software/ai/passing/cost_function.cpp b/src/software/ai/passing/cost_function.cpp index 7b5506911a..7746ff7ca7 100644 --- a/src/software/ai/passing/cost_function.cpp +++ b/src/software/ai/passing/cost_function.cpp @@ -475,5 +475,5 @@ void samplePassesForVisualization(const World& world, } } - LOG(VISUALIZE) << *createCostVisualization(costs, num_rows, num_cols); + LOG(VISUALIZE) << *createCostVisualizationProto(costs, num_rows, num_cols); } diff --git a/src/software/er_force_simulator_main.cpp b/src/software/er_force_simulator_main.cpp index 8f8261b025..afc4de98af 100644 --- a/src/software/er_force_simulator_main.cpp +++ b/src/software/er_force_simulator_main.cpp @@ -145,7 +145,7 @@ int main(int argc, char **argv) if (!has_sent_world_state_trigger) { auto world_state_received_trigger_msg = - *createWorldStateReceivedTrigger(); + *createWorldStateReceivedTriggerProto(); world_state_received_trigger.sendProto( world_state_received_trigger_msg); has_sent_world_state_trigger = true; From fbd6b4219b7339303e421211ae47002c0b3c74ae Mon Sep 17 00:00:00 2001 From: "pre-commit-ci-lite[bot]" <117423508+pre-commit-ci-lite[bot]@users.noreply.github.com> Date: Sat, 28 Mar 2026 20:16:44 +0000 Subject: [PATCH 16/16] [pre-commit.ci lite] apply automatic fixes --- src/proto/message_translation/tbots_protobuf.cpp | 5 +++-- src/proto/message_translation/tbots_protobuf.h | 5 +++-- src/software/ai/passing/pass_generator.cpp | 6 +++--- src/software/ai/passing/receiver_position_generator.hpp | 6 +++--- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/src/proto/message_translation/tbots_protobuf.cpp b/src/proto/message_translation/tbots_protobuf.cpp index fbf1bc6394..087f70b1ce 100644 --- a/src/proto/message_translation/tbots_protobuf.cpp +++ b/src/proto/message_translation/tbots_protobuf.cpp @@ -317,7 +317,7 @@ std::unique_ptr createTimestampProto(const Timestamp& tim } std::unique_ptr createNamedValueProto(const std::string name, - float value) + float value) { auto named_value_msg = std::make_unique(); named_value_msg->set_name(name); @@ -401,7 +401,8 @@ std::unique_ptr createPassVisualizationProto( return pass_visualization_msg; } -std::unique_ptr createWorldStateReceivedTriggerProto() +std::unique_ptr +createWorldStateReceivedTriggerProto() { auto world_state_received_trigger_msg = std::make_unique(); diff --git a/src/proto/message_translation/tbots_protobuf.h b/src/proto/message_translation/tbots_protobuf.h index c4a3baf181..2a58515edb 100644 --- a/src/proto/message_translation/tbots_protobuf.h +++ b/src/proto/message_translation/tbots_protobuf.h @@ -107,7 +107,7 @@ std::unique_ptr createTimestampProto(const Timestamp& tim * specified name and value */ std::unique_ptr createNamedValueProto(const std::string name, - float value); + float value); /** * Returns a TbotsProto::PlotJugglerValue proto containing the name @@ -221,7 +221,8 @@ std::unique_ptr createPassVisualizationProto( * a boolean value for whether world state proto has been received * */ -std::unique_ptr createWorldStateReceivedTriggerProto(); +std::unique_ptr +createWorldStateReceivedTriggerProto(); /** * Returns a cost visualization given a vector of costs diff --git a/src/software/ai/passing/pass_generator.cpp b/src/software/ai/passing/pass_generator.cpp index 5120e01c69..861405123b 100644 --- a/src/software/ai/passing/pass_generator.cpp +++ b/src/software/ai/passing/pass_generator.cpp @@ -44,9 +44,9 @@ PassWithRating PassGenerator::getBestPass(const World& world, } std::stringstream stream; stream << "BP:" << std::fixed << std::setprecision(3) << best_pass.rating; - debug_shapes.push_back( - *createDebugShapeProto(Circle(best_pass.pass.receiverPoint(), 0.05), - std::to_string(debug_shapes.size()) + "pg", stream.str())); + debug_shapes.push_back(*createDebugShapeProto( + Circle(best_pass.pass.receiverPoint(), 0.05), + std::to_string(debug_shapes.size()) + "pg", stream.str())); LOG(VISUALIZE) << *createDebugShapesProto(debug_shapes); } diff --git a/src/software/ai/passing/receiver_position_generator.hpp b/src/software/ai/passing/receiver_position_generator.hpp index 8fb196653c..2fd8102b23 100644 --- a/src/software/ai/passing/receiver_position_generator.hpp +++ b/src/software/ai/passing/receiver_position_generator.hpp @@ -214,9 +214,9 @@ void ReceiverPositionGenerator::visualizeBestReceivingPositionsAndZone { for (unsigned int i = 0; i < top_zones.size(); i++) { - debug_shapes.push_back(*createDebugShapeProto(pitch_division_->getZone(top_zones[i]), - std::to_string(i + 1), - std::to_string(i + 1))); + debug_shapes.push_back( + *createDebugShapeProto(pitch_division_->getZone(top_zones[i]), + std::to_string(i + 1), std::to_string(i + 1))); debug_shapes.push_back(*createDebugShapeProto( Circle(