diff --git a/ChangeLog.md b/ChangeLog.md index 04f4dfcd..40a0b5d3 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -1,5 +1,27 @@ # ChangeLog +## [1.1.1] - 2024-12-01 + +### Added + +- added Neck_OffensiveInterceptNeck into idls +- added HeliosBasicTackle into idls +- added start-debug-agent.sh file + +### Fixed + +- bug fixed in start-agent.sh + +### Changed + +- + +### Developers + +- [NaderZare](https://github.com/naderzare) + +======= + ## [1.1.0] - 2024-11-17 ### Added diff --git a/idl/grpc/service.proto b/idl/grpc/service.proto index bcac6a90..bc981b16 100644 --- a/idl/grpc/service.proto +++ b/idl/grpc/service.proto @@ -1,4 +1,4 @@ -// version 1.7 +// version 1.8 syntax = "proto3"; @@ -835,6 +835,9 @@ message Neck_TurnToRelative { float angle = 1; } +message Neck_OffensiveInterceptNeck { +} + message View_ChangeWidth { ViewWidth view_width = 1; } @@ -1284,6 +1287,11 @@ message HeliosPenalty {} message HeliosCommunicaion {} +message HeliosBasicTackle { + float min_prob = 1; + float body_thr = 2; +} + message bhv_doForceKick {} message bhv_doHeardPassRecieve {} @@ -1356,7 +1364,8 @@ message PlayerAction { HeliosCommunicaion helios_communication = 64; bhv_doForceKick bhv_do_force_kick = 65; bhv_doHeardPassRecieve bhv_do_heard_pass_recieve = 66; - + HeliosBasicTackle helios_basic_tackle = 67; + Neck_OffensiveInterceptNeck neck_offensive_intercept_neck = 68; } } diff --git a/idl/thrift/soccer_service.thrift b/idl/thrift/soccer_service.thrift index 26375140..264e26eb 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 @@ -743,6 +743,8 @@ struct Neck_TurnToRelative { 1: double angle } +struct Neck_OffensiveInterceptNeck {} + struct View_ChangeWidth { 1: ViewWidth view_width } @@ -839,6 +841,11 @@ struct HeliosPenalty {} struct HeliosCommunicaion {} +struct HeliosBasicTackle { + 1: double min_prob, + 2: double body_thr +} + struct bhv_doForceKick {} struct bhv_doHeardPassRecieve {} @@ -909,7 +916,9 @@ struct PlayerAction { 63: optional HeliosPenalty helios_penalty, 64: optional HeliosCommunicaion helios_communication, 65: optional bhv_doForceKick bhv_do_force_kick, - 66: optional bhv_doHeardPassRecieve bhv_do_heard_pass_recieve + 66: optional bhv_doHeardPassRecieve bhv_do_heard_pass_recieve, + 67: optional HeliosBasicTackle helios_basic_tackle, + 68: optional Neck_OffensiveInterceptNeck neck_offensive_intercept_neck } struct PlayerActions { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index b7425372..2574336a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -62,6 +62,6 @@ file( # copy other files to the binary direcotry file(COPY - formations-dt formations-keeper formations-taker player.conf coach.conf start-debug.sh start-offline.sh + formations-dt formations-keeper formations-taker player.conf coach.conf start-debug.sh start-offline.sh start-debug-agent.sh DESTINATION ${PROJECT_BINARY_DIR}/bin ) diff --git a/src/grpc-client/grpc_client_player.cpp b/src/grpc-client/grpc_client_player.cpp index cc466183..30f6c095 100644 --- a/src/grpc-client/grpc_client_player.cpp +++ b/src/grpc-client/grpc_client_player.cpp @@ -58,6 +58,8 @@ #include "planner/action_chain_holder.h" #include "planner/bhv_planned_action.h" #include "player/strategy.h" +#include "player/bhv_basic_tackle.h" +#include "player/neck_offensive_intercept_neck.h" #include #include @@ -1022,6 +1024,16 @@ void GrpcClientPlayer::getActions() rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_TurnToRelative failed" ); } } + else if (action.action_case() == PlayerAction::kNeckOffensiveInterceptNeck) { + if (Neck_OffensiveInterceptNeck().execute(agent)) + { + rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_OffensiveInterceptNeck performed" ); + } + else + { + rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_OffensiveInterceptNeck failed" ); + } + } else if (action.action_case() == PlayerAction::kViewChangeWidth) { const auto &viewChangeWidth = action.view_change_width(); const rcsc::ViewWidth view_width = GrpcClient::convertViewWidth(viewChangeWidth.view_width()); @@ -1167,6 +1179,19 @@ void GrpcClientPlayer::getActions() __FILE__": sample_communication failed" ); } } + else if (action.action_case() == PlayerAction::kHeliosBasicTackle && !action_performed) { + const auto &helios_basic_tackle = action.helios_basic_tackle(); + if (Bhv_BasicTackle( helios_basic_tackle.min_prob(), helios_basic_tackle.body_thr() ).execute(agent)) { + action_performed = true; + rcsc::dlog.addText( rcsc::Logger::TEAM, + __FILE__": Bhv_BasicTackle performed" ); + } + else + { + rcsc::dlog.addText( rcsc::Logger::TEAM, + __FILE__": Bhv_BasicTackle failed" ); + } + } else if (action.action_case() == PlayerAction::kBhvDoForceKick && !action_performed) { if(doForceKick(agent)) diff --git a/src/start-agent.sh.in b/src/start-agent.sh.in index cb5e3b1b..5dd57e1f 100644 --- a/src/start-agent.sh.in +++ b/src/start-agent.sh.in @@ -266,12 +266,14 @@ do --goalie) is_goalie="true" + is_player="false" ;; --player) is_player="true" ;; --coach) is_coach="true" + is_player="false" ;; --fullstate) if [ $# -lt 2 ]; then diff --git a/src/start-debug-agent.sh b/src/start-debug-agent.sh new file mode 100755 index 00000000..bbad344c --- /dev/null +++ b/src/start-debug-agent.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +./start-agent.sh --offline-logging --debug --debug-server-connect ${1+"$@"} diff --git a/src/thrift-client/thrift_client_player.cpp b/src/thrift-client/thrift_client_player.cpp index 9dcdb313..4e91af37 100644 --- a/src/thrift-client/thrift_client_player.cpp +++ b/src/thrift-client/thrift_client_player.cpp @@ -58,6 +58,8 @@ #include "planner/action_chain_holder.h" #include "planner/bhv_planned_action.h" #include "player/strategy.h" +#include "player/bhv_basic_tackle.h" +#include "player/neck_offensive_intercept_neck.h" #include #include @@ -1008,6 +1010,16 @@ void ThriftClientPlayer::getActions() __FILE__": Neck_TurnToRelative failed" ); } } + else if (action.__isset.neck_offensive_intercept_neck) { + if (Neck_OffensiveInterceptNeck().execute(agent)) + { + rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_OffensiveInterceptNeck performed" ); + } + else + { + rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_OffensiveInterceptNeck failed" ); + } + } else if (action.__isset.view_change_width) { const auto &viewChangeWidth = action.view_change_width; @@ -1178,7 +1190,19 @@ void ThriftClientPlayer::getActions() rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": sample_communication failed" ); } - + } + else if (action.__isset.helios_basic_tackle && !action_performed) { + const auto &helios_basic_tackle = action.helios_basic_tackle; + if (Bhv_BasicTackle( helios_basic_tackle.min_prob, helios_basic_tackle.body_thr ).execute(agent)) { + action_performed = true; + rcsc::dlog.addText( rcsc::Logger::TEAM, + __FILE__": Bhv_BasicTackle performed" ); + } + else + { + rcsc::dlog.addText( rcsc::Logger::TEAM, + __FILE__": Bhv_BasicTackle failed" ); + } } else if (action.__isset.bhv_do_force_kick && !action_performed) {