Skip to content
This repository was archived by the owner on Jan 28, 2023. It is now read-only.

Commit f9a52d0

Browse files
committed
imprement referee_wrapper
1 parent dc21b99 commit f9a52d0

12 files changed

Lines changed: 575 additions & 0 deletions

File tree

consai2r2_msgs/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ set(msg_files
3131
"msg/VisionDetections.msg"
3232
"msg/RobotInfo.msg"
3333
"msg/BallInfo.msg"
34+
"msg/DecodedReferee.msg"
35+
"msg/ReplaceBall.msg"
3436
"msg/RobotCommand.msg"
3537
"msg/RobotCommands.msg"
3638
)
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# game status for consai2_game
2+
3+
# ID : text
4+
# 0 : HALT
5+
# 1 : STOP
6+
# 2 : ---
7+
# 3 : FORCE_START
8+
# 11 : OUR_KICKOFF_PREPARATION
9+
# 12 : OUR_KICKOFF_START
10+
# 13 : OUR_PENALTY_PREPARATION
11+
# 14 : OUR_PENALTY_START
12+
# 15 : OUR_DIRECT_FREE
13+
# 16 : OUR_INDIRECT_FREE
14+
# 17 : OUR_TIMEOUT
15+
# 18 : OUR_GOAL
16+
# 19 : OUR_BALL_PLACEMENT
17+
# 20 : ---
18+
# 21 : THEIR_KICKOFF_PREPARATION
19+
# 22 : THEIR_KICKOFF_START
20+
# 23 : THEIR_PENALTY_PREPARATION
21+
# 24 : THEIR_PENALTY_START
22+
# 25 : THEIR_DIRECT_FREE
23+
# 26 : THEIR_INDIRECT_FREE
24+
# 27 : THEIR_TIMEOUT
25+
# 28 : THEIR_GOAL
26+
# 29 : THEIR_BALL_PLACEMENT
27+
28+
uint8 referee_id
29+
string referee_text
30+
31+
bool can_move_robot
32+
float64 speed_limit_of_robot # meter/sec
33+
bool can_kick_ball
34+
bool can_enter_their_side
35+
bool can_enter_center_circle
36+
bool is_inplay
37+
float64 keep_out_radius_from_ball # meter
38+
float64 keep_out_distance_from_their_defense_area # meter
39+
40+
geometry_msgs/Point placement_position

consai2r2_msgs/msg/ReplaceBall.msg

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# This msg file is copied from 'grSim_Replacement.proto'
2+
#
3+
float64 x
4+
float64 y
5+
float64 vx
6+
float64 vy
7+
8+
bool is_enabled

consai2r2_referee_wrapper/consai2r2_referee_wrapper/__init__.py

Whitespace-only changes.

consai2r2_referee_wrapper/consai2r2_referee_wrapper/referee_wrapper.py

Lines changed: 392 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?xml version="1.0"?>
2+
<?xml-model href="http://download.ros.org/schema/package_format2.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
3+
<package format="3">
4+
<name>consai2r2_referee_wrapper</name>
5+
<version>0.0.0</version>
6+
<description>Referee Wrapper</description>
7+
<maintainer email="macakasit@gmail.com">akshota</maintainer>
8+
<license>MIT</license>
9+
10+
<exec_depend>rclpy</exec_depend>
11+
<exec_depend>consai2r2_msgs</exec_depend>
12+
<exec_depend>consai2r2_receiver</exec_depend>
13+
<exec_depend>consai2r2_description</exec_depend>
14+
15+
<!-- These test dependencies are optional
16+
Their purpose is to make sure that the code passes the linters -->
17+
<test_depend>ament_copyright</test_depend>
18+
<test_depend>ament_flake8</test_depend>
19+
<test_depend>ament_pep257</test_depend>
20+
<test_depend>python3-pytest</test_depend>
21+
22+
<export>
23+
<build_type>ament_python</build_type>
24+
</export>
25+
</package>

consai2r2_referee_wrapper/resource/consai2r2_referee_wrapper

Whitespace-only changes.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
[develop]
2+
script-dir=$base/lib/consai2r2_referee_wrapper
3+
[install]
4+
install-scripts=$base/lib/consai2r2_referee_wrapper

consai2r2_referee_wrapper/setup.py

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
from setuptools import setup
2+
3+
package_name = 'consai2r2_referee_wrapper'
4+
5+
setup(
6+
name=package_name,
7+
version='0.0.0',
8+
packages=[package_name],
9+
data_files=[
10+
('share/ament_index/resource_index/packages',
11+
['resource/' + package_name]),
12+
('share/' + package_name, ['package.xml']),
13+
],
14+
install_requires=['setuptools'],
15+
zip_safe=True,
16+
author='akshota',
17+
author_email='macakasit@gmail.com',
18+
maintainer='akshota',
19+
maintainer_email='macakasit@gmail.com',
20+
keywords=['ROS'],
21+
classifiers=[
22+
'Intended Audience :: Developers',
23+
'License :: OSI Approved :: MIT License',
24+
'Programming Language :: Python',
25+
'Topic :: Software Development',
26+
],
27+
description='Translate raw referee message to AI-friendly message',
28+
license='MIT License',
29+
tests_require=['pytest'],
30+
entry_points={
31+
'console_scripts': [
32+
'referee_wrapper = consai2r2_referee_wrapper.referee_wrapper:main',
33+
],
34+
},
35+
)
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Copyright 2015 Open Source Robotics Foundation, Inc.
2+
#
3+
# Licensed under the Apache License, Version 2.0 (the "License");
4+
# you may not use this file except in compliance with the License.
5+
# You may obtain a copy of the License at
6+
#
7+
# http://www.apache.org/licenses/LICENSE-2.0
8+
#
9+
# Unless required by applicable law or agreed to in writing, software
10+
# distributed under the License is distributed on an "AS IS" BASIS,
11+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
# See the License for the specific language governing permissions and
13+
# limitations under the License.
14+
15+
from ament_copyright.main import main
16+
import pytest
17+
18+
19+
@pytest.mark.copyright
20+
@pytest.mark.linter
21+
def test_copyright():
22+
rc = main(argv=['.'])
23+
assert rc == 0, 'Found errors'

0 commit comments

Comments
 (0)