ssl-roots / consai2 Goto Github PK
View Code? Open in Web Editor NEWhttps://github.com/SSL-Roots/consai_ros2 へ開発を移行しています
License: MIT License
https://github.com/SSL-Roots/consai_ros2 へ開発を移行しています
License: MIT License
defenseが巨大化してよくわからなくなったので
それぞれ分割します
#16 の処置に追記する。
game_event内のいくつかのパラメータはoptionalなので、HasFieldで存在をチェックしてから値を取得する。
アルゴリズム上ボールの後ろに回り込んでball_placementを行う
そのため、壁際にボールが存在する場合は確実に失敗する(できない)
ロボット台数変更に伴い
今のディフェンス数の数え方だと色々つらい点があるので
台数の管理と各roleの管理をちゃんとさせます
goalie.pyの整理
consai2_receiver/scripts/referee_receiver.py
の47行目においてGameEventに関して「protobufによってデシリアライズされたパケット」から「ROSメッセージ」への代入が行われているが両者のもつフィールド名は微妙に違うことからこの代入は失敗し,下に示すようなエラーを生じる.
roslaunch consai2_examples visualizer.launch
上記のコマンドを実行した上で公式サイトで公開されている大会ログを再生すると本現象が発生する.
今回使用したログファイルは以下のとおりである.
使用ログファイル
RoboCupSSL2019世界大会決勝戦(ER-Force vs ZJUNlict)
https://tigers-mannheim.de/download/gamelogs/2019/div-a/
なお,PC上でも
の2通りの環境で試してみたがreferee.proto
でoptional
指定されているフィールドgameEvent
が使われる状況を発生させることができなかったのか,本現象が発生することはなかった.
setting /run_id to da047ff2-bd15-11e9-bf6a-88b1119fee3a
process[rosout-1]: started with pid [20031]
started core service [/rosout]
process[vision_receiver-2]: started with pid [20045]
process[referee_receiver-3]: started with pid [20049]
process[vision_wrapper-4]: started with pid [20050]
process[referee_wrapper-5]: started with pid [20051]
process[consai2_visualizer-6]: started with pid [20052]
Traceback (most recent call last):
File "/home/hans/catkin_ws/src/consai2/consai2_receiver/scripts/referee_receiver.py", line 59, in <module>
receiver.receive()
File "/home/hans/catkin_ws/src/consai2/consai2_receiver/scripts/referee_receiver.py", line 27, in receive
self._publish_referee(buf)
File "/home/hans/catkin_ws/src/consai2/consai2_receiver/scripts/referee_receiver.py", line 49, in _publish_referee
self._pub_referee.publish(referee)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 882, in publish
self.impl.publish(data)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/topics.py", line 1066, in publish
serialize_message(b, self.seq, message)
File "/opt/ros/kinetic/lib/python2.7/dist-packages/rospy/msg.py", line 152, in serialize_message
msg.serialize(b)
File "/home/hans/catkin_ws/devel/lib/python2.7/dist-packages/consai2_msgs/msg/_Referee.py", line 168, in serialize
buff.write(_get_struct_4I3d2BI().pack(_x.blue.yellow_cards, _x.blue.timeouts, _x.blue.timeout_time, _x.blue.goalie, _x.designated_position.x, _x.designated_position.y, _x.designated_position.z, _x.game_event.game_event_type, _x.game_event.originator_team, _x.game_event.originator_bot_id))
AttributeError: 'SSL_Referee_Game_Event' object has no attribute 'game_event_type'
================================================================================REQUIRED process [referee_receiver-3] has died!
process has died [pid 20049, exit code 1, cmd /home/hans/catkin_ws/src/consai2/consai2_receiver/scripts/referee_receiver.py __name:=referee_receiver __log:=/home/hans/.ros/log/da047ff2-bd15-11e9-bf6a-88b1119fee3a/referee_receiver-3.log].
log file: /home/hans/.ros/log/da047ff2-bd15-11e9-bf6a-88b1119fee3a/referee_receiver-3*.log
Initiating shutdown!
================================================================================
8台前提のrole設定となっていたので、11台に対応する
roleは以下を想定
いくつかのパッケージにREADME.mdファイルが存在しないため追加する。
consai2_control
や、consai2_game
はexampleコードがほとんどであるが、パッケージとしての役割は明記すべきである。
field.pyについて
小さいフィールドでテストするときは全ての白線が存在しない場合がある。
線分を取得するときに線分名が存在するかチェックしてほしい。
また、デフォルト値を所持して、返すようにしてほしい。
consai2_receiver/vision_receiverでチームサイドの反転をしているが、vision_receiverはできるだか無編集なデータをPublishすべきである。
consai2/consai2_receiver/scripts/vision_receiver.py
Lines 91 to 94 in a0aa3ed
チームサイドの反転は上位層のvision_wrapperに実行させる。
CON-SAI2はROS 2にも対応させます。ブランチを切り分けて、ROS1とROS2の両方を残します。
詳細な開発方針はこのissueや、別の方法で議論し、決定します。
CON-SAI2には、ユーザにコントリビュート(issue, pullreq)してほしいコードと、ユーザに用意してほしいコード、編集して欲しくないコードがある。
それらがどの部分なのかをReadmeに記載する。
ゴーリー以外のフィールドロボットが0台になったあと
前回アタッカーだったロボットが復活しても
アタッカーにはならず、ディフェンスになってしまう。
原因
マージンを設けて、アタッカーの切り替わりの発振を防ぐ処理によって
切り替え処理が働かない。
自分とボールの距離 < 自分とボールの距離 - MARGIN
という判定になる。
Pose2Dは非推奨なメッセージ型なので、Poseに直す。
その際、Pose2D.theta を Pose.orientationに変換しなければならないので、変換用の関数を設けること。
game.pyがRootsのAIの本体なので、プログラムの流れを簡単に説明する。
exampleディレクトリ直下にREADMEを作成して、そこに説明文を書く。
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.