Skip to content

Commit 1193740

Browse files
authored
Merge pull request #50 from CLSFramework/develop-py2d
Update proto and thrift definitions to version 1.8, add Neck_Offensiv…
2 parents cb70fcc + dd481e0 commit 1193740

File tree

8 files changed

+100
-6
lines changed

8 files changed

+100
-6
lines changed

ChangeLog.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,27 @@
11
# ChangeLog
22

3+
## [1.1.1] - 2024-12-01
4+
5+
### Added
6+
7+
- added Neck_OffensiveInterceptNeck into idls
8+
- added HeliosBasicTackle into idls
9+
- added start-debug-agent.sh file
10+
11+
### Fixed
12+
13+
- bug fixed in start-agent.sh
14+
15+
### Changed
16+
17+
-
18+
19+
### Developers
20+
21+
- [NaderZare](https://github.com/naderzare)
22+
23+
=======
24+
325
## [1.1.0] - 2024-11-17
426

527
### Added

idl/grpc/service.proto

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// version 1.7
1+
// version 1.8
22

33
syntax = "proto3";
44

@@ -835,6 +835,9 @@ message Neck_TurnToRelative {
835835
float angle = 1;
836836
}
837837

838+
message Neck_OffensiveInterceptNeck {
839+
}
840+
838841
message View_ChangeWidth {
839842
ViewWidth view_width = 1;
840843
}
@@ -1284,6 +1287,11 @@ message HeliosPenalty {}
12841287

12851288
message HeliosCommunicaion {}
12861289

1290+
message HeliosBasicTackle {
1291+
float min_prob = 1;
1292+
float body_thr = 2;
1293+
}
1294+
12871295
message bhv_doForceKick {}
12881296

12891297
message bhv_doHeardPassRecieve {}
@@ -1356,7 +1364,8 @@ message PlayerAction {
13561364
HeliosCommunicaion helios_communication = 64;
13571365
bhv_doForceKick bhv_do_force_kick = 65;
13581366
bhv_doHeardPassRecieve bhv_do_heard_pass_recieve = 66;
1359-
1367+
HeliosBasicTackle helios_basic_tackle = 67;
1368+
Neck_OffensiveInterceptNeck neck_offensive_intercept_neck = 68;
13601369
}
13611370
}
13621371

idl/thrift/soccer_service.thrift

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// version 1.7
1+
// version 1.8
22

33
namespace cpp soccer
44
namespace py soccer
@@ -743,6 +743,8 @@ struct Neck_TurnToRelative {
743743
1: double angle
744744
}
745745

746+
struct Neck_OffensiveInterceptNeck {}
747+
746748
struct View_ChangeWidth {
747749
1: ViewWidth view_width
748750
}
@@ -839,6 +841,11 @@ struct HeliosPenalty {}
839841

840842
struct HeliosCommunicaion {}
841843

844+
struct HeliosBasicTackle {
845+
1: double min_prob,
846+
2: double body_thr
847+
}
848+
842849
struct bhv_doForceKick {}
843850

844851
struct bhv_doHeardPassRecieve {}
@@ -909,7 +916,9 @@ struct PlayerAction {
909916
63: optional HeliosPenalty helios_penalty,
910917
64: optional HeliosCommunicaion helios_communication,
911918
65: optional bhv_doForceKick bhv_do_force_kick,
912-
66: optional bhv_doHeardPassRecieve bhv_do_heard_pass_recieve
919+
66: optional bhv_doHeardPassRecieve bhv_do_heard_pass_recieve,
920+
67: optional HeliosBasicTackle helios_basic_tackle,
921+
68: optional Neck_OffensiveInterceptNeck neck_offensive_intercept_neck
913922
}
914923

915924
struct PlayerActions {

src/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,6 @@ file(
6262

6363
# copy other files to the binary direcotry
6464
file(COPY
65-
formations-dt formations-keeper formations-taker player.conf coach.conf start-debug.sh start-offline.sh
65+
formations-dt formations-keeper formations-taker player.conf coach.conf start-debug.sh start-offline.sh start-debug-agent.sh
6666
DESTINATION ${PROJECT_BINARY_DIR}/bin
6767
)

src/grpc-client/grpc_client_player.cpp

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
#include "planner/action_chain_holder.h"
5959
#include "planner/bhv_planned_action.h"
6060
#include "player/strategy.h"
61+
#include "player/bhv_basic_tackle.h"
62+
#include "player/neck_offensive_intercept_neck.h"
6163
#include <rcsc/player/say_message_builder.h>
6264
#include <rcsc/common/player_param.h>
6365

@@ -1022,6 +1024,16 @@ void GrpcClientPlayer::getActions()
10221024
rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_TurnToRelative failed" );
10231025
}
10241026
}
1027+
else if (action.action_case() == PlayerAction::kNeckOffensiveInterceptNeck) {
1028+
if (Neck_OffensiveInterceptNeck().execute(agent))
1029+
{
1030+
rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_OffensiveInterceptNeck performed" );
1031+
}
1032+
else
1033+
{
1034+
rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_OffensiveInterceptNeck failed" );
1035+
}
1036+
}
10251037
else if (action.action_case() == PlayerAction::kViewChangeWidth) {
10261038
const auto &viewChangeWidth = action.view_change_width();
10271039
const rcsc::ViewWidth view_width = GrpcClient::convertViewWidth(viewChangeWidth.view_width());
@@ -1167,6 +1179,19 @@ void GrpcClientPlayer::getActions()
11671179
__FILE__": sample_communication failed" );
11681180
}
11691181
}
1182+
else if (action.action_case() == PlayerAction::kHeliosBasicTackle && !action_performed) {
1183+
const auto &helios_basic_tackle = action.helios_basic_tackle();
1184+
if (Bhv_BasicTackle( helios_basic_tackle.min_prob(), helios_basic_tackle.body_thr() ).execute(agent)) {
1185+
action_performed = true;
1186+
rcsc::dlog.addText( rcsc::Logger::TEAM,
1187+
__FILE__": Bhv_BasicTackle performed" );
1188+
}
1189+
else
1190+
{
1191+
rcsc::dlog.addText( rcsc::Logger::TEAM,
1192+
__FILE__": Bhv_BasicTackle failed" );
1193+
}
1194+
}
11701195
else if (action.action_case() == PlayerAction::kBhvDoForceKick && !action_performed)
11711196
{
11721197
if(doForceKick(agent))

src/start-agent.sh.in

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -266,12 +266,14 @@ do
266266

267267
--goalie)
268268
is_goalie="true"
269+
is_player="false"
269270
;;
270271
--player)
271272
is_player="true"
272273
;;
273274
--coach)
274275
is_coach="true"
276+
is_player="false"
275277
;;
276278
--fullstate)
277279
if [ $# -lt 2 ]; then

src/start-debug-agent.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
./start-agent.sh --offline-logging --debug --debug-server-connect ${1+"$@"}

src/thrift-client/thrift_client_player.cpp

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,8 @@
5858
#include "planner/action_chain_holder.h"
5959
#include "planner/bhv_planned_action.h"
6060
#include "player/strategy.h"
61+
#include "player/bhv_basic_tackle.h"
62+
#include "player/neck_offensive_intercept_neck.h"
6163
#include <rcsc/player/say_message_builder.h>
6264
#include <rcsc/common/player_param.h>
6365

@@ -1008,6 +1010,16 @@ void ThriftClientPlayer::getActions()
10081010
__FILE__": Neck_TurnToRelative failed" );
10091011
}
10101012
}
1013+
else if (action.__isset.neck_offensive_intercept_neck) {
1014+
if (Neck_OffensiveInterceptNeck().execute(agent))
1015+
{
1016+
rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_OffensiveInterceptNeck performed" );
1017+
}
1018+
else
1019+
{
1020+
rcsc::dlog.addText( rcsc::Logger::TEAM, __FILE__": Neck_OffensiveInterceptNeck failed" );
1021+
}
1022+
}
10111023
else if (action.__isset.view_change_width)
10121024
{
10131025
const auto &viewChangeWidth = action.view_change_width;
@@ -1178,7 +1190,19 @@ void ThriftClientPlayer::getActions()
11781190
rcsc::dlog.addText( rcsc::Logger::TEAM,
11791191
__FILE__": sample_communication failed" );
11801192
}
1181-
1193+
}
1194+
else if (action.__isset.helios_basic_tackle && !action_performed) {
1195+
const auto &helios_basic_tackle = action.helios_basic_tackle;
1196+
if (Bhv_BasicTackle( helios_basic_tackle.min_prob, helios_basic_tackle.body_thr ).execute(agent)) {
1197+
action_performed = true;
1198+
rcsc::dlog.addText( rcsc::Logger::TEAM,
1199+
__FILE__": Bhv_BasicTackle performed" );
1200+
}
1201+
else
1202+
{
1203+
rcsc::dlog.addText( rcsc::Logger::TEAM,
1204+
__FILE__": Bhv_BasicTackle failed" );
1205+
}
11821206
}
11831207
else if (action.__isset.bhv_do_force_kick && !action_performed)
11841208
{

0 commit comments

Comments
 (0)