Skip to content

Reaction Time Tasks

Overview

This documentation covers four example scripts designed for reaction time and interaction experiments in virtual reality using the SightLab VR platform. These scripts demonstrate different ways to configure tasks, environments, and participant interactions.

1. Basic Reaction Time Task (reactionTime.py)

Purpose

To measure the time it takes for participants to visually locate and respond to a red sphere appearing in random positions.

Script Breakdown

  1. Setup Environment:
  2. Loads a modifiable environment.
  3. Configures a modifiable object (red sphere) that fades in when activated.
  4. Reaction Time Measurement:
  5. Object appears at random positions.
  6. Measures the time from the sphere's appearance to the participant’s interaction.

Customization

  • Modify positions to alter sphere locations.
  • Adjust FADE_IN_SPHERE for sphere’s fade-in speed.
  • Modify environment and target object

2. Reaction Time with Selector Tool (reactionTime_Selector_Tool.py)

Purpose

Tracks user interactions with a highlighter tool, measuring the time to highlight and confirm an object.

Script Breakdown

  1. Highlighter Setup:
  2. Enables highlighter tool to track gaze or cursor.
  3. Configures a red sphere as the target object.
  4. Interaction Flow:
  5. Sphere appears at a random position.
  6. Participant highlights and confirms selection.
  7. Reaction time is recorded.

Customization

  • Adjust positions to change sphere locations.
  • Update the trial count by modifying the loop range.
  • Modify environment and target object

3. Shoot/Don't Shoot Task (reactionTime_Shoot_Dont_Shoot.py)

Purpose

Tests decision-making under time pressure by requiring participants to "shoot" threat objects while ignoring neutral objects.

Script Breakdown

  1. Object Classification:
  2. Categorizes objects as "threat" or "neutral."
  3. Configures random spawn positions for these objects.
  4. Task Logic:
  5. Objects appear randomly.
  6. Participant must decide to shoot or ignore.
  7. Records reaction time and decision correctness.

Customization

  • Modify SET_TRIAL_COUNT to change the number of trials.
  • Update object_list to add or replace objects.
  • Modify environment and target objects

4. Shoot/Don't Shoot in a Maze (reactionTime_Shoot_Dont_Shoot_maze.py)

Purpose

Adds complexity to the shoot/don't-shoot task by embedding it in a maze environment with proximity sensors.

Script Breakdown

  1. Environment Setup:
  2. Loads a maze model (can be swapped with your own).
  3. Places proximity sensors within the maze.
  4. Task Logic:
  5. Similar to the shoot/don't-shoot task but requires navigation.
  6. Proximity sensors trigger interactions as participants explore.

Customization

  • Adjust TRIAL_LENGTH for task duration.
  • Use proximityAreaPlacer to configure sensor areas.
Was this page helpful?