Skip to content

Commit

Permalink
Merge pull request #36 from CLSFramework/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
naderzare authored Oct 19, 2024
2 parents 3903a0a + 7616cd7 commit dcbd50f
Show file tree
Hide file tree
Showing 7 changed files with 67 additions and 7 deletions.
34 changes: 34 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,39 @@
# ChangeLog

## [1.0.6] - 2024-10-19

### Added
- ServerParam.center_circle_r, ServerParam.goal_post_radius, WorldModel.game_mode_side

### Fixed
-

### Changed
-

### Engineers
- [ErfanFathi](https://github.com/ErfanFathii)

=======

## [1.0.5] - 2024-10-16

### Added
- wm.time_stopped, wm.set_play_count, serverParams.goal_area_width/length

### Fixed
-

### Changed
-

### Engineers
- [NaderZare](https://github.com/naderzare)
- [SadraKhanjari](https://github.com/SK2iP)
- [SoroushMazloum](https://github.com/SoroushMazloum)

=======

## [1.0.4] - 2024-10-8

### Added
Expand Down
11 changes: 9 additions & 2 deletions idl/grpc/service.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// version 1.4
// version 1.6

syntax = "proto3";

Expand Down Expand Up @@ -313,7 +313,7 @@ message WorldModel {
repeated Player unknowns = 10;
map<int32, Player> our_players_dict = 11;
map<int32, Player> their_players_dict = 12;
int32 our_goalie_uniform_number = 13; // The uniform number of our goalie.
int32 our_goalie_uniform_number = 13; // The uniform number of our goalie.
int32 their_goalie_uniform_number = 14; // The uniform number of their goalie.
float offside_line_x = 15; // The x-coordinate of the offside line of opponent team.
int32 ofside_line_x_count = 16; // How many cycles ago the agent has seen (calculated) the offside line.
Expand All @@ -340,6 +340,9 @@ message WorldModel {
bool kickable_opponent_existance = 37; // Whether the kickable opponent exists or not.
PenaltyKickState penalty_kick_state = 38; // The penalty kick state.
int32 see_time = 39; // The time that the agent has seen the world model.
int32 time_stopped = 40;
int32 set_play_count = 41;
Side game_mode_side = 42;
}

/**
Expand Down Expand Up @@ -1249,6 +1252,10 @@ message ServerParam {
float penalty_area_half_width = 220;
float penalty_area_length = 221;
float goal_width = 222;
float goal_area_width = 223;
float goal_area_length = 224;
float center_circle_r = 225;
float goal_post_radius = 226;
}

message PlayerParam {
Expand Down
13 changes: 10 additions & 3 deletions idl/thrift/soccer_service.thrift
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// version 1.4
// version 1.6

namespace cpp soccer
namespace py soccer
Expand Down Expand Up @@ -300,7 +300,10 @@ struct WorldModel {
36: bool kickable_teammate_existance,
37: bool kickable_opponent_existance,
38: PenaltyKickState penalty_kick_state,
39: i32 see_time
39: i32 see_time,
40: i32 time_stopped,
41: i32 set_play_count,
42: Side game_mode_side
}

struct State {
Expand Down Expand Up @@ -1142,7 +1145,11 @@ struct ServerParam {
219: double their_penalty_area_line_x,
220: double penalty_area_half_width,
221: double penalty_area_length,
222: double goal_width
222: double goal_width,
223: double goal_area_width,
224: double goal_area_length,
225: double center_circle_r,
226: double goal_post_radius
}

struct PlayerParam {
Expand Down
5 changes: 4 additions & 1 deletion src/grpc-client/grpc_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -277,7 +277,10 @@ void GrpcClient::sendServerParam() const
serverParam.set_their_penalty_area_line_x(SP.theirPenaltyAreaLineX());
serverParam.set_penalty_area_half_width(SP.penaltyAreaHalfWidth());
serverParam.set_penalty_area_length(SP.penaltyAreaLength());

serverParam.set_goal_area_width(SP.goalAreaWidth());
serverParam.set_goal_area_length(SP.goalAreaLength());
serverParam.set_center_circle_r(SP.centerCircleR());
serverParam.set_goal_post_radius(SP.goalPostRadius());
ClientContext context;
protos::Empty empty;
protos::RegisterResponse* response = new protos::RegisterResponse(*M_register_response);
Expand Down
3 changes: 3 additions & 0 deletions src/grpc-client/state_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,9 @@ protos::WorldModel *StateGenerator::convertWorldModel(const rcsc::WorldModel &wm
res->set_allocated_penalty_kick_state(convertPenaltyKickState(wm, wm.penaltyKickState()));
}
res->set_see_time(wm.seeTime().cycle());
res->set_time_stopped(wm.time().stopped());
res->set_set_play_count(wm.getSetPlayCount());
res->set_game_mode_side(convertSide(wm.gameMode().side()));
return res;
}

Expand Down
5 changes: 4 additions & 1 deletion src/thrift-client/thrift_client.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,10 @@ void ThriftAgent::sendServerParam() const
serverParam.their_penalty_area_line_x = SP.theirPenaltyAreaLineX();
serverParam.penalty_area_half_width = SP.penaltyAreaHalfWidth();
serverParam.penalty_area_length = SP.penaltyAreaLength();

serverParam.goal_area_width = SP.goalAreaWidth();
serverParam.goal_area_length = SP.goalAreaLength();
serverParam.center_circle_r = SP.centerCircleR();
serverParam.goal_post_radius = SP.goalPostRadius();
try{
soccer::Empty empty;
serverParam.register_response = M_register_response;
Expand Down
3 changes: 3 additions & 0 deletions src/thrift-client/thrift_state_generator.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,6 +561,9 @@ soccer::WorldModel ThriftStateGenerator::convertWorldModel(const rcsc::WorldMode
res.penalty_kick_state = convertPenaltyKickState(wm, wm.penaltyKickState());
}
res.see_time = wm.seeTime().cycle();
res.time_stopped = wm.time().stopped();
res.set_play_count = wm.getSetPlayCount();
res.game_mode_side = convertSide(wm.gameMode().side());
return res;
}

Expand Down

0 comments on commit dcbd50f

Please sign in to comment.