Avalon-Benchmark/avalon

Changes needed to complete the tutorial_add_task tutorial

Opened this issue · 0 comments

dfm794 commented

While I was able to successfully complete this tutorial, there are a number of issues in the directions. I catalog them here in case others encounter the same:
Some of these issues are already known from #30

(1) The tutorial directs one to install avalon per instructions in the repo's readme file. These steps fail installing godot as the install code depends on PyTorch. Installing PyTorch will fix it

(2) Step1 contains two errors

  • the instructions ask to open godot.project, but the file is actually project.godot
  • The expected view on opening and running main.tscn does not agree with the tutorial. To fix this "is_teleporter_enabled" must be changed in the config.json file to false

(3) Steps 2 through 5 have missing imports

  • The instructions are to strip down stack.py, to yield something like baseball.template.py. If one just uses baseball.template.py as the starting point, one will encounter many missing imports. These should be added to baseball.template.py
  • Step 5 calls out that certain constants can be imported from from avalon.datagen.world_creation.constant, but this is not correct for one of the constants. it's should be avalon.datagen.world_creation.indoor.constants for DEFAULT_FLOOR_THICKNESS
    -Here's the complete list of added imports, in the order added
from avalon.common.utils import only
from avalon.datagen.world_creation.indoor.task_generator import add_food_island
from avalon.datagen.world_creation.geometry import BuildingTile
from avalon.datagen.world_creation.constants import AGENT_HEIGHT
from avalon.datagen.world_creation.constants import FOOD_HOVER_DIST
from avalon.datagen.world_creation.geometry import local_to_global_coords
from avalon.datagen.world_creation.entities.tools.weapons import LargeStick
from itertools import product
from avalon.datagen.world_creation.indoor.tiles import decide_tiles_by_distance
from avalon.datagen.world_creation.constants import MAX_JUMP_HEIGHT_METERS
from avalon.datagen.world_creation.constants import STANDING_REACH_HEIGHT
from avalon.datagen.world_creation.indoor.constants import DEFAULT_FLOOR_THICKNESS

(4) Step2 add import to datagen/world_creation/world_generator.py
When adding the task-to-generator mapping, you must also import the task generator function in datagen/world_creation/world_generator.py, else generate_baseball_task is not defined
from baseball import generate_baseball_task

(5) Step3 make sure room_position_3d is defined before use
The ordering of edits in this block, if followed blindly will have rood_position_3d used before defined as previous step first set spawn_location, then target_location, but in step3 target is defined first, then spawn.

(6) Step 5 plinth_height is set, when it was meant to be min_plinth_height
The following line

plinth_height = MAX_JUMP_HEIGHT_METERS + STANDING_REACH_HEIGHT + DEFAULT_FLOOR_THICKNESS + 0.1

was probably meant to be

min_plinth_height = MAX_JUMP_HEIGHT_METERS + STANDING_REACH_HEIGHT + DEFAULT_FLOOR_THICKNESS + 0.1