Skip to content

Commit 0b2564a

Browse files
authored
Merge pull request #41 from CLSFramework/develop_issues
Develop issues
2 parents e701105 + f86f39c commit 0b2564a

File tree

7 files changed

+37
-6
lines changed

7 files changed

+37
-6
lines changed

ChangeLog.md

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

3+
## [1.1.2] - 2024-12-08
4+
5+
### Added
6+
- ServerParams.pitch_margin
7+
- Player.inertia_final_point, PenaltyKickState.cycle, self.get_safety_dash_power.
8+
9+
### Fixed
10+
-
11+
12+
### Changed
13+
-
14+
15+
### Developers
16+
- [SoroushMazloum](https://github.com/SoroushMazloum)
17+
18+
=======
19+
320
## [1.1.1] - 2024-12-01
421

522
### Added

idl/grpc/service.proto

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -135,6 +135,7 @@ message PenaltyKickState {
135135
int32 our_score = 5;
136136
int32 their_score = 6;
137137
bool is_kick_taker = 7;
138+
int32 cycle = 8;
138139
}
139140

140141
/**
@@ -172,6 +173,7 @@ message Player {
172173
int32 ball_reach_steps = 28; // How many cycles the player needs to reach the ball.
173174
bool is_tackling = 29; // Whether the player is tackling or not.
174175
int32 type_id = 30; // The type identifier of the player.
176+
RpcVector2D inertia_final_point = 31;
175177
}
176178

177179
/**
@@ -220,6 +222,7 @@ message Self {
220222
CardType card = 39; // The card type of the agent. It can be NO_CARD, YELLOW, or RED.
221223
int32 catch_time = 40; // The time when the last catch command is performed.
222224
float effort = 41; // The effort of the agent. TODO more info
225+
float get_safety_dash_power = 42;
223226
}
224227

225228
/**
@@ -1668,6 +1671,7 @@ message ServerParam {
16681671
float goal_area_length = 224;
16691672
float center_circle_r = 225;
16701673
float goal_post_radius = 226;
1674+
float pitch_margin = 227;
16711675
}
16721676

16731677
message PlayerParam {

idl/thrift/soccer_service.thrift

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ struct PenaltyKickState {
112112
4: i32 their_taker_counter,
113113
5: i32 our_score,
114114
6: i32 their_score,
115-
7: bool is_kick_taker
115+
7: bool is_kick_taker,
116+
8: i32 cycle
116117
}
117118

118119
struct Player {
@@ -145,7 +146,8 @@ struct Player {
145146
27: double angle_from_ball,
146147
28: i32 ball_reach_steps,
147148
29: bool is_tackling,
148-
30: i32 type_id
149+
30: i32 type_id,
150+
31: RpcVector2D inertia_final_point
149151
}
150152

151153
struct Self {
@@ -189,7 +191,8 @@ struct Self {
189191
38: double stamina_capacity,
190192
39: CardType card,
191193
40: i32 catch_time,
192-
41: double effort
194+
41: double effort,
195+
42: double get_safety_dash_power
193196
}
194197

195198
enum InterceptActionType {
@@ -1215,7 +1218,8 @@ struct ServerParam {
12151218
223: double goal_area_width,
12161219
224: double goal_area_length,
12171220
225: double center_circle_r,
1218-
226: double goal_post_radius
1221+
226: double goal_post_radius,
1222+
227: double pitch_margin
12191223
}
12201224

12211225
struct PlayerParam {

src/grpc-client/grpc_client.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,7 @@ void GrpcClient::sendServerParam() const
281281
serverParam.set_goal_area_length(SP.goalAreaLength());
282282
serverParam.set_center_circle_r(SP.centerCircleR());
283283
serverParam.set_goal_post_radius(SP.goalPostRadius());
284+
serverParam.set_pitch_margin(SP.pitchMargin());
284285
ClientContext context;
285286
protos::Empty empty;
286287
protos::RegisterResponse* response = new protos::RegisterResponse(*M_register_response);

src/grpc-client/state_generator.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ protos::Self *StateGenerator::convertSelf(const rcsc::SelfObject &self, const rc
174174
res->set_card(convertCardType(self.card()));
175175
res->set_catch_time(self.catchTime().cycle());
176176
res->set_effort(static_cast<float>(self.effort()));
177+
res->set_get_safety_dash_power(static_cast<float>(self.getSafetyDashPower(rcsc::ServerParam::i().maxDashPower())));
177178
return res;
178179
}
179180

@@ -246,7 +247,7 @@ protos::PenaltyKickState *StateGenerator::convertPenaltyKickState(const rcsc::Wo
246247
res->set_our_score(state->ourScore());
247248
res->set_their_score(state->theirScore());
248249
res->set_is_kick_taker(state->isKickTaker(wm.ourSide(), wm.self().unum()));
249-
250+
res->set_cycle(state->time().cycle());
250251
return res;
251252
}
252253

@@ -288,6 +289,7 @@ void StateGenerator::updatePlayerObject(protos::Player *p, const rcsc::PlayerObj
288289
p->set_ball_reach_steps(player->ballReachStep());
289290
p->set_is_tackling(player->isTackling());
290291
p->set_type_id(player->playerTypePtr()->id());
292+
p->set_allocated_inertia_final_point(convertVector2D(player->inertiaFinalPoint()));
291293
}
292294

293295
/**

src/thrift-client/thrift_client.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -262,6 +262,7 @@ void ThriftAgent::sendServerParam() const
262262
serverParam.goal_area_length = SP.goalAreaLength();
263263
serverParam.center_circle_r = SP.centerCircleR();
264264
serverParam.goal_post_radius = SP.goalPostRadius();
265+
serverParam.pitch_margin = SP.pitchMargin();
265266
try{
266267
soccer::Empty empty;
267268
serverParam.register_response = M_register_response;

src/thrift-client/thrift_state_generator.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -179,6 +179,7 @@ soccer::Self ThriftStateGenerator::convertSelf(const rcsc::SelfObject &self, con
179179
res.card = convertCardType(self.card());
180180
res.catch_time = self.catchTime().cycle();
181181
res.effort = static_cast<float>(self.effort());
182+
res.get_safety_dash_power = static_cast<float>(self.getSafetyDashPower(rcsc::ServerParam::i().maxDashPower()));
182183
return res;
183184
}
184185

@@ -255,7 +256,7 @@ soccer::PenaltyKickState ThriftStateGenerator::convertPenaltyKickState(const rcs
255256
res.our_score = state->ourScore();
256257
res.their_score = state->theirScore();
257258
res.is_kick_taker = state->isKickTaker(wm.ourSide(), wm.self().unum());
258-
259+
res.cycle = state->time().cycle();
259260
return res;
260261
}
261262

@@ -304,6 +305,7 @@ void ThriftStateGenerator::updatePlayerObject(soccer::Player & p, const rcsc::Pl
304305
{
305306
p.type_id = player->playerTypePtr()->id();
306307
}
308+
p.inertia_final_point = convertVector2D(player->inertiaFinalPoint());
307309
}
308310

309311
/**

0 commit comments

Comments
 (0)