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
- Setup Environment:
- Loads a modifiable environment.
- Configures a modifiable object (red sphere) that fades in when activated.
- Reaction Time Measurement:
- Object appears at random positions.
- 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
- Highlighter Setup:
- Enables highlighter tool to track gaze or cursor.
- Configures a red sphere as the target object.
- Interaction Flow:
- Sphere appears at a random position.
- Participant highlights and confirms selection.
- 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
- Object Classification:
- Categorizes objects as "threat" or "neutral."
- Configures random spawn positions for these objects.
- Task Logic:
- Objects appear randomly.
- Participant must decide to shoot or ignore.
- 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
- Environment Setup:
- Loads a maze model (can be swapped with your own).
- Places proximity sensors within the maze.
- Task Logic:
- Similar to the shoot/don't-shoot task but requires navigation.
- Proximity sensors trigger interactions as participants explore.
Customization
- Adjust
TRIAL_LENGTH
for task duration. - Use
proximityAreaPlacer
to configure sensor areas.