hsr-project / tmc_wrs_gazebo

BSD 3-Clause Clear License
3 stars 13 forks source link

Error to spawn object with specific seed #7

Open EtienneSchmitz opened 3 years ago

EtienneSchmitz commented 3 years ago

During our tests, we set the seed 65. An error occurs and only the objects in the first room spawn.

See below the error :

Traceback (most recent call last):
simulator_1  |   File "/opt/ros/melodic/lib/tmc_wrs_gazebo_worlds/spawn_objects", line 300, in <module>
simulator_1  |     X = generate_scatter(place[0][0], place[1][0], place[0][1], place[1][1], n, 0.2)
simulator_1  |   File "/opt/ros/melodic/lib/tmc_wrs_gazebo_worlds/spawn_objects", line 222, in generate_scatter
simulator_1  |     dist = np.min(pdist(X))
simulator_1  |   File "/usr/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 2372, in amin
simulator_1  |     out=out, **kwargs)
simulator_1  |   File "/usr/lib/python2.7/dist-packages/numpy/core/_methods.py", line 29, in _amin
simulator_1  |     return umr_minimum(a, axis, None, out, keepdims)
simulator_1  | ValueError: zero-size array to reduction operation minimum which has no identity
simulator_1  | ct_in_box_detector)
simulator_1  |     fork_in_containerb_detector (tmc_gazebo_task_evaluators/object_in_box_detector)
simulator_1  |     gazebo (gazebo_ros/gzserver)
simulator_1  |     gazebo_gui (gazebo_ros/gzclient)
simulator_1  |     gripper_controllers_spawner (controller_manager/spawner)
simulator_1  |     home_gripper (pal_gripper_controller_configuration/home_gripper.py)
simulator_1  |     hsrb_in_humanleftfront_detector (tmc_gazebo_task_evaluators/object_in_box_detector)
yosuke commented 3 years ago

Same problem with seed 33.

[INFO] [1624324028.296741, 0.000000]: Spawn status: SpawnModel: Successfully spawned entity
Traceback (most recent call last):
  File "/workspace/src/tmc_wrs_gazebo/tmc_wrs_gazebo_worlds/scripts/spawn_objects", line 300, in <module>
    X = generate_scatter(place[0][0], place[1][0], place[0][1], place[1][1], n, 0.2)
  File "/workspace/src/tmc_wrs_gazebo/tmc_wrs_gazebo_worlds/scripts/spawn_objects", line 222, in generate_scatter
    dist = np.min(pdist(X))
  File "/usr/local/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 2618, in amin
    initial=initial)
  File "/usr/local/lib/python2.7/dist-packages/numpy/core/fromnumeric.py", line 86, in _wrapreduction
    return ufunc.reduce(obj, axis, dtype, out, **passkwargs)
ValueError: zero-size array to reduction operation minimum which has no identity
[spawn_objects-35] process has died [pid 43523, exit code 1, cmd /workspace/src/tmc_wrs_gazebo/tmc_wrs_gazebo_worlds/scripts/spawn_objects --seed 33 --percategory 2 --obstacles 2 --perrow 4 __name:=spawn_objects __log:=/home/developer/.ros/log/22c977a4-d2f6-11eb-b333-0242ac130003/spawn_objects-35.log].
log file: /home/developer/.ros/log/22c977a4-d2f6-11eb-b333-0242ac130003/spawn_objects-35*.log

Should be fixed after the RoboCup event.