Skip to content

Commit

Permalink
Merge pull request #44 from SoroushMazloum/develop_issues
Browse files Browse the repository at this point in the history
Added bhv_goalieFreeKick
  • Loading branch information
naderzare authored Dec 9, 2024
2 parents edcb330 + b6da520 commit 99a6afc
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 3 deletions.
1 change: 1 addition & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Added
- ServerParams.pitch_margin
- Player.inertia_final_point, PenaltyKickState.cycle, self.get_safety_dash_power.
- bhv_goalieFreeKick added

### Fixed
-
Expand Down
5 changes: 4 additions & 1 deletion idl/grpc/service.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// version 1.8
// version 1.9

syntax = "proto3";

Expand Down Expand Up @@ -1299,6 +1299,8 @@ message bhv_doForceKick {}

message bhv_doHeardPassRecieve {}

message bhv_goalieFreeKick {}

message PlayerAction {
oneof action {
Dash dash = 1;
Expand Down Expand Up @@ -1369,6 +1371,7 @@ message PlayerAction {
bhv_doHeardPassRecieve bhv_do_heard_pass_recieve = 66;
HeliosBasicTackle helios_basic_tackle = 67;
Neck_OffensiveInterceptNeck neck_offensive_intercept_neck = 68;
bhv_goalieFreeKick bhv_goalie_free_kick = 69;
}
}

Expand Down
5 changes: 4 additions & 1 deletion idl/thrift/soccer_service.thrift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// version 1.8
// version 1.9

namespace cpp soccer
namespace py soccer
Expand Down Expand Up @@ -853,6 +853,8 @@ struct bhv_doForceKick {}

struct bhv_doHeardPassRecieve {}

struct bhv_goalieFreeKick {}

struct PlayerAction {
1: optional Dash dash,
2: optional Turn turn,
Expand Down Expand Up @@ -922,6 +924,7 @@ struct PlayerAction {
66: optional bhv_doHeardPassRecieve bhv_do_heard_pass_recieve,
67: optional HeliosBasicTackle helios_basic_tackle,
68: optional Neck_OffensiveInterceptNeck neck_offensive_intercept_neck
69: optional bhv_goalieFreeKick bhv_goalie_free_kick
}

struct PlayerActions {
Expand Down
5 changes: 5 additions & 0 deletions src/grpc-client/grpc_client_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
#include "planner/actgen_action_chain_length_filter.h"
#include "planner/action_chain_holder.h"
#include "planner/bhv_planned_action.h"
#include "player/bhv_goalie_free_kick.h"
#include "player/strategy.h"
#include "player/bhv_basic_tackle.h"
#include "player/neck_offensive_intercept_neck.h"
Expand Down Expand Up @@ -898,6 +899,10 @@ void GrpcClientPlayer::getActions()
rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_ScanPlayers failed" );
}
}
else if (action.action_case() == PlayerAction::kBhvGoalieFreeKick) {
Bhv_GoalieFreeKick().execute(agent);
agent->debugClient().addMessage("Bhv_GoalieFreeKick");
}
else if (action.action_case() == PlayerAction::kNeckTurnToBallAndPlayer) {
const auto &neckTurnToBallAndPlayer = action.neck_turn_to_ball_and_player();
const rcsc::AbstractPlayerObject *player = nullptr;
Expand Down
16 changes: 15 additions & 1 deletion src/thrift-client/thrift_client_player.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
#include "planner/action_chain_holder.h"
#include "planner/bhv_planned_action.h"
#include "player/strategy.h"
#include "player/bhv_goalie_free_kick.h"
#include "player/bhv_basic_tackle.h"
#include "player/neck_offensive_intercept_neck.h"
#include <rcsc/player/say_message_builder.h>
Expand Down Expand Up @@ -1227,9 +1228,22 @@ void ThriftClientPlayer::getActions()
__FILE__": doHeardPassReceive performed" );
}
else
{
agent->debugClient().addMessage("doHeardPassReceive failed");
}
}
else if(action.__isset.bhv_goalie_free_kick && !action_performed)
{
if (Bhv_GoalieFreeKick().execute(agent))
{
action_performed = true;
rcsc::dlog.addText( rcsc::Logger::TEAM,
__FILE__": Bhv_GoalieFreeKick performed" );
}
else
{
rcsc::dlog.addText( rcsc::Logger::TEAM,
__FILE__": doHeardPassReceive failed" );
__FILE__": Bhv_GoalieFreeKick failed" );
}
}
else if (action.__isset.helios_offensive_planner && !action_performed)
Expand Down

0 comments on commit 99a6afc

Please sign in to comment.