Skip to content

Commit 5e0ebc7

Browse files
committed
Add support for Rescue Line Entry 2023 rule (Japan)
1 parent ab87e1e commit 5e0ebc7

31 files changed

+605
-749
lines changed

README.md

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# ロボカップジュニア RoboCupJunior CMS 2022
1+
# ロボカップジュニア RoboCupJunior CMS 2023
22
### Competition Management System
33
#### (former Rescue Scoring System)
44
This is a Competition Management System used in RoboCupJunior's rescue line & maze competitions in word wide.
@@ -11,8 +11,8 @@ Please refer to the [English version README](https://github.com/rrrobo/rcj-rescu
1111
これは,ロボカップジュニアレスキュー競技で用いられる大会管理システムです.
1212

1313
#### 対応ルール
14-
* International RoboCupJunior Rescue Technical Committee により発行された2021最終ルール / [Line](https://cdn.robocup.org/junior/wp/2021/06/2021_RescueLine_Rules_final02.pdf) / [Maze](https://cdn.robocup.org/junior/wp/2021/06/2021_RescueMaze_Rules_final02.pdf)
15-
* 日本のレスキュー技術委員会により発行された日本リーグ2022ルール / [Nippon-League](https://drive.google.com/file/d/1bjoNF_jOcQ0M4QSeDRKg0GmDSSl9gxAO/view?usp=sharing)
14+
* International RoboCupJunior Rescue Technical Committee により発行された2022最終ルール / [Line](https://junior.robocup.org/wp-content/uploads/2022Rules/2022_RescueLine_Rules_final01.pdf) / [Maze](https://junior.robocup.org/wp-content/uploads/2022Rules/2022_RescueMaze_Rules_final01.pdf)
15+
* 日本のレスキュー技術委員会により発行されたレスキュー・ライン・エントリー2023ルール / [レスキュー・ライン・エントリー](https://drive.google.com/file/d/1IYhlUrF7h3xu1rkToTjPjyYoZ9viGTuY/view)
1616

1717
--
1818

@@ -25,13 +25,14 @@ Please refer to the [English version README](https://github.com/rrrobo/rcj-rescu
2525
* ユーザー管理機能を強化
2626
* マップの回転機能を追加
2727
* インタビュー機能を追加
28-
* 2022ルールに対応
28+
* 国際2022ルールに対応
2929
* ラインのタイルセットの在庫管理に対応
3030
* 大会データーのバックアップ/リストアに対応
3131
* トラブル発生時のハンドオーバーに対応
3232
* 紙のスコアシートの出力に対応
3333
* ドキュメント提出/レビューシステムを統合
3434
* システムからのメール配信が可能
35+
* レスキュー・ライン・エントリー2023ルールに対応
3536

3637
特別な理由がない限り,本リポジトリで提供しているバージョンを使用することをお勧めします.
3738

@@ -41,6 +42,7 @@ Please refer to the [English version README](https://github.com/rrrobo/rcj-rescu
4142
[https://osaka.rcj.cloud](https://osaka.rcj.cloud)
4243

4344
## 更新情報
45+
* [2022/09/17] レスキュー・ライン・エントリー 2023ルールに対応しました
4446
* [2021/10/02] 2022ルールに暫定対応しました.
4547
* [2021/03/07] 2021ルールに正式に対応しました.
4648
* [2020/11/28] ドキュメント系システムを本システムに統合しました.また,システムからのチームへのメール配信も可能になりました.
@@ -92,6 +94,9 @@ Please refer to the [English version README](https://github.com/rrrobo/rcj-rescu
9294
* ロボカップジュニア 日本大会2021 オンライン
9395
* RoboCup2021 WORLDWIDE
9496

97+
### 2022年ルール対応版
98+
* RoboCup 2022 Bangkok Thailand
99+
95100
## 使用方法
96101
### Dockerを利用(推奨)
97102
[公式Dockerイメージ](https://hub.docker.com/repository/docker/ryorobo/rcj-cms)を用意しています.本イメージからの利用を推奨します.

helper/scoreCalculator-2022.js renamed to helper/scoreCalculator-2023.js

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,18 +120,23 @@ module.exports.calculateLineScore = function (run) {
120120
}
121121
}
122122

123+
if (run.nl) {
124+
for (let victim of run.nl.liveVictim) {
125+
if (victim.found) score += 10
126+
if (victim.identified) score += 20
127+
}
128+
for (let victim of run.nl.deadVictim) {
129+
if (victim.found) score += 10
130+
if (victim.identified) score += 5
131+
}
132+
}
133+
123134
// 5 points for placing robot on first droptile (start)
124135
// Implicit showedUp if anything else is scored
125136
if (run.showedUp || score > 0) {
126137
score += 5;
127138
}
128139

129-
if (run.nl) {
130-
score += 15 * run.nl.silverTape;
131-
score += 30 * run.nl.greenTape;
132-
//score -= 5 * run.nl.misidentification; //Removed from 2022
133-
}
134-
135140
final_score = Math.round(score * multiplier);
136141

137142
const ret = {};

helper/scoreCalculator.js

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,38 @@
11
const logger = require('../config/logger').mainLogger;
2-
const rule2022 = require('./scoreCalculator-2022');
2+
const rule2023 = require('./scoreCalculator-2023');
33

44
module.exports.calculateLineScore = function (run) {
55
const { rule } = run.competition;
66
switch (rule) {
7-
case '2022':
7+
case '2023':
88
default:
9-
return rule2022.calculateLineScore(run);
9+
return rule2023.calculateLineScore(run);
1010
}
1111
};
1212

1313
module.exports.calculateLineScoreManual = function (run) {
1414
const { rule } = run.competition;
1515
switch (rule) {
16-
case '2022':
16+
case '2023':
1717
default:
18-
return rule2022.calculateLineScoreManual(run);
18+
return rule2023.calculateLineScoreManual(run);
1919
}
2020
};
2121

2222
module.exports.calculateMazeScore = function (run) {
2323
const { rule } = run.competition;
2424
switch (rule) {
25-
case '2022':
25+
case '2023':
2626
default:
27-
return rule2022.calculateMazeScore(run);
27+
return rule2023.calculateMazeScore(run);
2828
}
2929
};
3030

3131
module.exports.calculateMazeScoreManual = function (run) {
3232
const { rule } = run.competition;
3333
switch (rule) {
34-
case '2022':
34+
case '2023':
3535
default:
36-
return rule2022.calculateMazeScoreManual(run);
36+
return rule2023.calculateMazeScoreManual(run);
3737
}
3838
};
File renamed without changes.

helper/scoreSheetPDFLine2.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const logger = require('../config/logger').mainLogger;
2-
const rule2022 = require('./scoreSheetPDFLine2-2022');
2+
const rule2023 = require('./scoreSheetPDFLine2-2023');
33

44
module.exports.generateScoreSheet = function (res, runs) {
55
let rule;
66
if (runs.length > 0) {
77
rule = runs[0].competition.rule;
88
}
99
switch (rule) {
10-
case '2022':
10+
case '2023':
1111
default:
12-
return rule2022.generateScoreSheet(res, runs);
12+
return rule2023.generateScoreSheet(res, runs);
1313
}
1414
};
File renamed without changes.

helper/scoreSheetPDFMaze2.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
const logger = require('../config/logger').mainLogger;
2-
const rule2022 = require('./scoreSheetPDFMaze2-2022');
2+
const rule2023 = require('./scoreSheetPDFMaze2-2023');
33

44
module.exports.generateScoreSheet = function (res, runs) {
55
let rule;
66
if (runs.length > 0) {
77
rule = runs[0].competition.rule;
88
}
99
switch (rule) {
10-
case '2022':
10+
case '2023':
1111
default:
12-
return rule2022.generateScoreSheet(res, runs);
12+
return rule2023.generateScoreSheet(res, runs);
1313
}
1414
};

models/competition.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ if(cluster.isMaster){
2929

3030

3131

32-
const SUPPORT_RULES = ["2022"];
32+
const SUPPORT_RULES = ["2023"];
3333

3434
const LEAGUES = [].concat(LINE_LEAGUES, MAZE_LEAGUES, OTHER_LEAGUES);
3535

models/lineRun.js

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -79,20 +79,16 @@ const lineRunSchema = new Schema({
7979
startTime : {type: Number, default: 0},
8080
test: {type: Boolean, default: false},
8181
nl : {
82-
silverTape: {type: Number, min:0, default:0},
83-
greenTape: {type: Number, min:0, default:0},
84-
misidentification: {type: Number, min:0, default:0},
82+
liveVictim: [{
83+
found: {type: Boolean, default: false},
84+
identified: {type: Boolean, default: false}
85+
}],
86+
deadVictim: [{
87+
found: {type: Boolean, default: false},
88+
identified: {type: Boolean, default: false}
89+
}]
8590
},
86-
isNL: {type: Boolean, default: false},
87-
manual : {
88-
gap: {type: Number, default: 0},
89-
obstacle: {type: Number, default: 0},
90-
speedbump: {type: Number, default: 0},
91-
intersection: {type: Number, default: 0},
92-
deadend: {type: Number, default: 0},
93-
rampUP: {type: Number, default: 0},
94-
rampDOWN: {type: Number, default: 0},
95-
}
91+
isNL: {type: Boolean, default: false}
9692
});
9793

9894
lineRunSchema.pre('save', function (next) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "rcj-scoring",
3-
"version": "22.0.16",
3+
"version": "23.0.0",
44
"copyright": "2016-2022 RCJ-CMS Development Team",
55
"private": true,
66
"scripts": {

0 commit comments

Comments
 (0)