citbrains / GankenKun_webots

Control of humanoid robots on webots, walking, deep-learning, Bayesian-optimization
14 stars 4 forks source link

refereeのエラー #40

Closed yasuohayashibara closed 3 years ago

yasuohayashibara commented 3 years ago

refereeのエラーが発生するようになったので原因を探り対策する.

Traceback (most recent call last):
  File "referee.py", line 1945, in <module>
    list_solids()  # prepare lists of solids to monitor in each robot to compute the convex hulls
  File "referee.py", line 540, in list_solids
    list_team_solids(blue_team)
  File "referee.py", line 533, in list_team_solids
    append_solid(robot, solids)
  File "referee.py", line 524, in append_solid
    append_solid(solid, solids)
  File "referee.py", line 524, in append_solid
    append_solid(solid, solids)
  File "referee.py", line 524, in append_solid
    append_solid(solid, solids)
  [Previous line repeated 2 more times]
  File "referee.py", line 522, in append_solid
    if solid.getType() == Node.NO_NODE:
AttributeError: 'NoneType' object has no attribute 'getType'
Exception in thread "Thread-103" java.lang.NullPointerException
    at controller.net.AutoRefServer.run(Unknown Source)
    at java.base/java.lang.Thread.run(Thread.java:829)
yasuohayashibara commented 3 years ago

閉リンクの部分をHingeJointの部分から削除したらエラーが出力されなくなった. おそらく,HingeJoint -> Solid と検索して物体の位置を把握してレフリーに使用していると思われるが,閉リンクの場合,HingeJoint -> SolidReference となるので,Solidが無いといってエラーが出るのではないかと思います. ダミーのsolidを置こうかと思いましたが,できませんでしたので,referee.py側を変更してもらうしないかなと思います.

どなたか解決法が分かればお願いします.

yasuohayashibara commented 3 years ago

referee.pyを書き換えて対処しました. https://github.com/citbrains/webots/commit/a54267f7e7ff094fb47fc7f879e5687036d5698d

TCに問題を投げて対処してもらいたいと思います.

yasuohayashibara commented 3 years ago

起動時のメッセージを載せます. 問題なく起動できているようです.

INFO: referee: Starting controller: python -u referee.py
Minimum real time factor is set to 0.
Simulation will run as fast as possible, real time waiting times will be minimal.
INFO: player: Starting controller: /home/mirai/webots/projects/samples/contests/robocup/controllers/player/player 10001 4 127.0.0.1 192.168.123.21 192.168.123.22 192.168.123.23 192.168.123.24
INFO: player: Starting controller: /home/mirai/webots/projects/samples/contests/robocup/controllers/player/player 10002 4 127.0.0.1 192.168.123.21 192.168.123.22 192.168.123.23 192.168.123.24
INFO: player: Starting controller: /home/mirai/webots/projects/samples/contests/robocup/controllers/player/player 10003 4 127.0.0.1 192.168.123.21 192.168.123.22 192.168.123.23 192.168.123.24
INFO: player: Starting controller: /home/mirai/webots/projects/samples/contests/robocup/controllers/player/player 10004 4 127.0.0.1 192.168.123.21 192.168.123.22 192.168.123.23 192.168.123.24
INFO: player: Starting controller: /home/mirai/webots/projects/samples/contests/robocup/controllers/player/player 10021 4 127.0.0.1 192.168.123.41 192.168.123.42 192.168.123.43 192.168.123.44
INFO: player: Starting controller: /home/mirai/webots/projects/samples/contests/robocup/controllers/player/player 10022 4 127.0.0.1 192.168.123.41 192.168.123.42 192.168.123.43 192.168.123.44
INFO: player: Starting controller: /home/mirai/webots/projects/samples/contests/robocup/controllers/player/player 10023 4 127.0.0.1 192.168.123.41 192.168.123.42 192.168.123.43 192.168.123.44
INFO: player: Starting controller: /home/mirai/webots/projects/samples/contests/robocup/controllers/player/player 10024 4 127.0.0.1 192.168.123.41 192.168.123.42 192.168.123.43 192.168.123.44
Spawned RED_PLAYER_1 RobocupRobot on port 10001 at halfTimeStartingPose: translation (3.5 -3.06 0.24), rotation (0 0 1 1.571592653589793).
Spawned RED_PLAYER_2 RobocupRobot on port 10002 at halfTimeStartingPose: translation (3.5 3.06 0.24), rotation (0 0 1 4.711592653589793).
Spawned RED_PLAYER_3 RobocupRobot on port 10003 at halfTimeStartingPose: translation (0.75 -3.06 0.24), rotation (0 0 1 1.571592653589793).
Spawned RED_PLAYER_4 RobocupRobot on port 10004 at halfTimeStartingPose: translation (0.75 3.06 0.24), rotation (0 0 1 4.711592653589793).
GameController setup of both teams successful
Spawned BLUE_PLAYER_1 RoboCup_GankenKun on port 10021 at halfTimeStartingPose: translation (-3.5 -3.1 0.439), rotation (0 0 1 1.57).
Spawned BLUE_PLAYER_2 RoboCup_GankenKun on port 10022 at halfTimeStartingPose: translation (-3.5 3.1 0.439), rotation (0 0 1 -1.57).
Start listening to AutoReferee connection on port 8750
Spawned BLUE_PLAYER_3 RoboCup_GankenKun on port 10023 at halfTimeStartingPose: translation (-0.75 -3.1 0.439), rotation (0 0 1 1.57).
config/icons/goalkeeper_fade.png
config/icons/goalkeeper.png
config/icons/goalkeeper_fade.png
config/icons/goalkeeper.png
config/icons/goalkeeper_fade.png
config/icons/goalkeeper.png
Spawned BLUE_PLAYER_4 RoboCup_GankenKun on port 10024 at halfTimeStartingPose: translation (-0.75 3.1 0.439), rotation (0 0 1 -1.57).
Connected to GameControllerSimulator at localhost:8750.
AutoReferee connected
config/icons/goalkeeper_fade.png
config/icons/goalkeeper.png
config/icons/goalkeeper_fade.png
config/icons/goalkeeper.png
config/icons/goalkeeper_fade.png
config/icons/goalkeeper.png
config/icons/goalkeeper_fade.png
config/icons/goalkeeper.png
config/icons/goalkeeper_fade.png
config/icons/goalkeeper.png
Game type is NORMAL.
Red team is "Funny Dingos", playing on right side.
Blue team is "CIT Brains", playing on left side.
Sending 1:SIDE_LEFT:25 to GameController.
Waiting for GameController to answer to 1:SIDE_LEFT:25.
Waiting for GameController to answer to 1:SIDE_LEFT:25.
Waiting for GameController to answer to 1:SIDE_LEFT:25.
Waiting for GameController to answer to 1:SIDE_LEFT:25.
Latest command is : 1:SIDE_LEFT:25
Message with ID 1 was returned with status OK
Waiting for GameController to answer to 1:SIDE_LEFT:25.
Kick-off is red.
Ball not in play, will be kicked by a player from the red team.
Sending 7:KICKOFF:8 to GameController.
Waiting for GameController to answer to 7:KICKOFF:8.
Latest command is : 7:KICKOFF:8
Message with ID 7 was returned with status OK
Waiting for GameController to answer to 7:KICKOFF:8.
RED 1: server started on port 10001
RED 2: server started on port 10002
RED 3: server started on port 10003
RED 4: server started on port 10004
BLUE 1: server started on port 10021
BLUE 2: server started on port 10022
BLUE 3: server started on port 10023
BLUE 4: server started on port 10024
New state received from GameController: STATE_INITIAL.
State has succesfully changed to INITIAL
New secondary state received from GameController: STATE_NORMAL, phase 0.
Sending 52:STATE:READY to GameController.
Waiting for GameController to answer to 52:STATE:READY.
Latest command is : 52:STATE:READY
Message with ID 52 was returned with status OK
Waiting for GameController to answer to 52:STATE:READY.
New state received from GameController: STATE_READY.
State has succesfully changed to READY
yasuohayashibara commented 3 years ago

対処してもらえたようですので,issueを閉じます.