Skip to content

Commit

Permalink
Ruta's shorter tutorial changes
Browse files Browse the repository at this point in the history
  • Loading branch information
rpartsey committed Nov 4, 2023
1 parent a655dfd commit f011755
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions examples/siro_sandbox/app_states/app_state_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ def _sim_update_tutorial(self, dt: float):
if self._sandbox_service.gui_input.get_key_down(GuiInput.KeyNS.SPACE):
self._tutorial.skip_stage()

if self._sandbox_service.gui_input.get_key_down(GuiInput.KeyNS.Q):
while not self._tutorial.is_completed():
self._tutorial.skip_stage()

if self._tutorial.is_completed():
self._tutorial.stop_animations()
else:
Expand Down
4 changes: 2 additions & 2 deletions examples/siro_sandbox/hitl_tutorial.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
TEXT_ROBOT_FOCUS: str = (
"This is your robot assistant.\nIt will help you accomplish your tasks.\n"
)
TEXT_AVATAR_FOCUS: str = "This is your avatar.\nYou will now gain control."
TEXT_HELP: str = "Spacebar: Skip"
TEXT_AVATAR_FOCUS: str = "You will now gain control of your avatar."
TEXT_HELP: str = "Q: Skip \nSpacebar: Skip to the next stage of the tutorial"


class ObjectAnimation:
Expand Down
14 changes: 14 additions & 0 deletions examples/siro_sandbox/sandbox_app.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,14 @@ def _reset_environment(self):
self._app_state_index = (
0 # start from the first app state for each episode
)
# if short_tutorial enabled we show the tutorial only once - before the first episode
# (skip the first app state (tutorial) after the first episode)
if (
self._args.show_tutorial
and self._args.short_tutorial
and self._episode_helper.num_episodes_done > 0
):
self._app_state_index = 1
self._app_state = self._app_states[self._app_state_index]
self._app_state.on_enter(
prev_state=self._get_prev_app_state(),
Expand Down Expand Up @@ -710,6 +718,12 @@ def _parse_debug_third_person(args, framebuffer_size):
default=False,
help="Shows an intro sequence that helps familiarize the user to the scene and task in a HITL context.",
)
parser.add_argument(
"--short-tutorial",
action="store_true",
default=False,
help="Shows an intro sequence that helps familiarize the user to the scene and task in a HITL context, ONLY for 1 episode. Requires --show-tutorial arguement to be specified as well.",
)
parser.add_argument(
"--hide-humanoid-in-gui",
action="store_true",
Expand Down

0 comments on commit f011755

Please sign in to comment.