From 8153f2f25af821ffe79096cea7b92ffa81fed299 Mon Sep 17 00:00:00 2001 From: Soroush Mazloum Date: Tue, 22 Oct 2024 22:07:45 +0330 Subject: [PATCH 1/2] PenaltyKick.cycle, Player.inertia_final_point, self.get_safety_dash_power --- ChangeLog.md | 16 ++++++++++++++++ idl/grpc/service.proto | 5 ++++- idl/thrift/soccer_service.thrift | 11 +++++++---- src/grpc-client/state_generator.cpp | 4 +++- src/thrift-client/thrift_state_generator.cpp | 4 +++- 5 files changed, 33 insertions(+), 7 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index f34ec20b..25cce82c 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,21 @@ # ChangeLog +## [1.0.7] - 2024-10-22 + +### Added +- Player.inertia_final_point, PenaltyKickState.cycle, self.get_safety_dash_power. + +### Fixed +- + +### Changed +- + +### Engineers +- [SoroushMazloum](https://github.com/SoroushMazloum) + +======= + ## [1.0.6] - 2024-10-19 ### Added diff --git a/idl/grpc/service.proto b/idl/grpc/service.proto index 349a692e..ade59358 100644 --- a/idl/grpc/service.proto +++ b/idl/grpc/service.proto @@ -1,4 +1,4 @@ -// version 1.6 +// version 1.7 syntax = "proto3"; @@ -110,6 +110,7 @@ message PenaltyKickState { int32 our_score = 5; int32 their_score = 6; bool is_kick_taker = 7; + int32 cycle = 8; } message Player { @@ -143,6 +144,7 @@ message Player { int32 ball_reach_steps = 28; bool is_tackling = 29; int32 type_id = 30; + RpcVector2D inertia_final_point = 31; } message Self { @@ -187,6 +189,7 @@ message Self { CardType card = 39; int32 catch_time = 40; float effort = 41; + float get_safety_dash_power = 42; } enum InterceptActionType { diff --git a/idl/thrift/soccer_service.thrift b/idl/thrift/soccer_service.thrift index 4377a5e0..c17bccc3 100644 --- a/idl/thrift/soccer_service.thrift +++ b/idl/thrift/soccer_service.thrift @@ -1,4 +1,4 @@ -// version 1.6 +// version 1.7 namespace cpp soccer namespace py soccer @@ -112,7 +112,8 @@ struct PenaltyKickState { 4: i32 their_taker_counter, 5: i32 our_score, 6: i32 their_score, - 7: bool is_kick_taker + 7: bool is_kick_taker, + 8: i32 cycle } struct Player { @@ -145,7 +146,8 @@ struct Player { 27: double angle_from_ball, 28: i32 ball_reach_steps, 29: bool is_tackling, - 30: i32 type_id + 30: i32 type_id, + 31: RpcVector2D inertia_final_point } struct Self { @@ -189,7 +191,8 @@ struct Self { 38: double stamina_capacity, 39: CardType card, 40: i32 catch_time, - 41: double effort + 41: double effort, + 42: double get_safety_dash_power } enum InterceptActionType { diff --git a/src/grpc-client/state_generator.cpp b/src/grpc-client/state_generator.cpp index ea35bf4b..4a06b86e 100644 --- a/src/grpc-client/state_generator.cpp +++ b/src/grpc-client/state_generator.cpp @@ -174,6 +174,7 @@ protos::Self *StateGenerator::convertSelf(const rcsc::SelfObject &self, const rc res->set_card(convertCardType(self.card())); res->set_catch_time(self.catchTime().cycle()); res->set_effort(static_cast(self.effort())); + res->set_get_safety_dash_power(static_cast(self.getSafetyDashPower(rcsc::ServerParam::i().maxDashPower()))); return res; } @@ -246,7 +247,7 @@ protos::PenaltyKickState *StateGenerator::convertPenaltyKickState(const rcsc::Wo res->set_our_score(state->ourScore()); res->set_their_score(state->theirScore()); res->set_is_kick_taker(state->isKickTaker(wm.ourSide(), wm.self().unum())); - + res->set_cycle(state->time().cycle()); return res; } @@ -288,6 +289,7 @@ void StateGenerator::updatePlayerObject(protos::Player *p, const rcsc::PlayerObj p->set_ball_reach_steps(player->ballReachStep()); p->set_is_tackling(player->isTackling()); p->set_type_id(player->playerTypePtr()->id()); + p->set_allocated_inertia_final_point(convertVector2D(player->inertiaFinalPoint())); } /** diff --git a/src/thrift-client/thrift_state_generator.cpp b/src/thrift-client/thrift_state_generator.cpp index 49e800cd..1bf30c5c 100644 --- a/src/thrift-client/thrift_state_generator.cpp +++ b/src/thrift-client/thrift_state_generator.cpp @@ -179,6 +179,7 @@ soccer::Self ThriftStateGenerator::convertSelf(const rcsc::SelfObject &self, con res.card = convertCardType(self.card()); res.catch_time = self.catchTime().cycle(); res.effort = static_cast(self.effort()); + res.get_safety_dash_power = static_cast(self.getSafetyDashPower(rcsc::ServerParam::i().maxDashPower())); return res; } @@ -255,7 +256,7 @@ soccer::PenaltyKickState ThriftStateGenerator::convertPenaltyKickState(const rcs res.our_score = state->ourScore(); res.their_score = state->theirScore(); res.is_kick_taker = state->isKickTaker(wm.ourSide(), wm.self().unum()); - + res.cycle = state->time().cycle(); return res; } @@ -304,6 +305,7 @@ void ThriftStateGenerator::updatePlayerObject(soccer::Player & p, const rcsc::Pl { p.type_id = player->playerTypePtr()->id(); } + p.inertia_final_point = convertVector2D(player->inertiaFinalPoint()); } /** From c1471c57ecfe2dbe0798445e5ec0985672263381 Mon Sep 17 00:00:00 2001 From: Soroush Mazloum Date: Thu, 24 Oct 2024 23:48:14 +0330 Subject: [PATCH 2/2] Serverparams.pitch_margin --- ChangeLog.md | 16 ++++++++++++++++ idl/grpc/service.proto | 3 ++- idl/thrift/soccer_service.thrift | 5 +++-- src/grpc-client/grpc_client.cpp | 1 + src/thrift-client/thrift_client.cpp | 1 + 5 files changed, 23 insertions(+), 3 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index 25cce82c..7ea0c6b3 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,21 @@ # ChangeLog +## [1.0.8] - 2024-10-24 + +### Added +- ServerParams.pitch_margin + +### Fixed +- + +### Changed +- + +### Engineers +- [SoroushMazloum](https://github.com/SoroushMazloum) + +======= + ## [1.0.7] - 2024-10-22 ### Added diff --git a/idl/grpc/service.proto b/idl/grpc/service.proto index ade59358..e5636310 100644 --- a/idl/grpc/service.proto +++ b/idl/grpc/service.proto @@ -1,4 +1,4 @@ -// version 1.7 +// version 1.8 syntax = "proto3"; @@ -1194,6 +1194,7 @@ message ServerParam { float goal_area_length = 224; float center_circle_r = 225; float goal_post_radius = 226; + float pitch_margin = 227; } message PlayerParam { diff --git a/idl/thrift/soccer_service.thrift b/idl/thrift/soccer_service.thrift index c17bccc3..abf13029 100644 --- a/idl/thrift/soccer_service.thrift +++ b/idl/thrift/soccer_service.thrift @@ -1,4 +1,4 @@ -// version 1.7 +// version 1.8 namespace cpp soccer namespace py soccer @@ -1152,7 +1152,8 @@ struct ServerParam { 223: double goal_area_width, 224: double goal_area_length, 225: double center_circle_r, - 226: double goal_post_radius + 226: double goal_post_radius, + 227: double pitch_margin } struct PlayerParam { diff --git a/src/grpc-client/grpc_client.cpp b/src/grpc-client/grpc_client.cpp index 4cb07185..8642ed46 100644 --- a/src/grpc-client/grpc_client.cpp +++ b/src/grpc-client/grpc_client.cpp @@ -281,6 +281,7 @@ void GrpcClient::sendServerParam() const serverParam.set_goal_area_length(SP.goalAreaLength()); serverParam.set_center_circle_r(SP.centerCircleR()); serverParam.set_goal_post_radius(SP.goalPostRadius()); + serverParam.set_pitch_margin(SP.pitchMargin()); ClientContext context; protos::Empty empty; protos::RegisterResponse* response = new protos::RegisterResponse(*M_register_response); diff --git a/src/thrift-client/thrift_client.cpp b/src/thrift-client/thrift_client.cpp index f2e7b0a4..7a92b33e 100644 --- a/src/thrift-client/thrift_client.cpp +++ b/src/thrift-client/thrift_client.cpp @@ -262,6 +262,7 @@ void ThriftAgent::sendServerParam() const serverParam.goal_area_length = SP.goalAreaLength(); serverParam.center_circle_r = SP.centerCircleR(); serverParam.goal_post_radius = SP.goalPostRadius(); + serverParam.pitch_margin = SP.pitchMargin(); try{ soccer::Empty empty; serverParam.register_response = M_register_response;