Touch Motors
Independent Research - Spring 2024 - XR Collaboratory, Cornell Tech
Student: Michael Hanlon
Overview
This package is an implementation of the Touch Motors interaction technique, using the XR Interaction Toolkit. The package includes two data types, three components, and a sample, as described below.
Components
TouchMotors
This component implements the logic for the Touch Motors technique as presented in our paper. This script is responsible for monitioring the state and position of the left and right index touches, using their positions to select and manipulate motors.
Property | Description |
---|---|
motorGroups | The array representing all possible motor groups that the user can manipulate. Defined by the user based on their motor configuration. |
dragMultiplierX | The constant multiplier applied when calculating the distance of dragging one's index finger along the X axis, or side to side relative to the user. |
dragMultiplierY | The constant multiplier applied when calculating the distance of dragging one's index finger along the Y axis, or towards and away from the user. |
dragIncrement | The amount of distance needed to drag the left index touch in order to switch the currently selected motor group. |
motorTool | The Motor Tool component reference used to get and set the positions of motors. |
TouchMotorsInput
This component implements the input for the Touch Motors technique as presented in our paper. This script is responsible for sending touch data to the logic component whenever a touch is initiated, updated, or ended.
Property | Description |
---|---|
touch1 | The input action reference corresponding to the left index touch. |
touch2 | The input action reference corresponding to the right index touch. |
TouchMotorsFeedback
This component implements the feedback for the Touch Motors technique as presented in our paper. This script is responsible for changing the materials of the anchors to provide visual feedback of the currently selected motor group, as well as playing audio feedback whenever the currently selected motor group changes.
Property | Description |
---|---|
anchors | The list of anchors corresponding to motor groups. |
selectedMaterial | The material used to render the anchor corresponding to the currently selected motor group. |
unselectedMaterial | The material used to render the anchors corresponding to every motor group other than the currently selected motor group. |
unsetMaterial | The material used to render unset anchors until they have been loaded with an AR Anchor component. |
ratchetAudio | The audio clip played whenever the currently selected motor group is changed. |
Data types
Motor
The data type corresponding to an individual motor. Fields like id, min and max are defined by the user based on their individual motor setup, while pos and startPos are maintained internally by the Touch Motors logic component.
Property | Description |
---|---|
id | The ROS id corresponding to this motor. Defined by the user. |
pos | The current position of the motor, ranging between min and max. Updated by the logic component. |
startPos | The start position of the motor at the beginning of manipulation, ranging between min and max. Updated by the logic component |
min | The minimum position of the motor. Defined by the user. |
max | The maximum position of the motor. Defined by the user. |
MotorGroup
The data type corresponding to a group of motors. Contains an array of Motor objects corresponding to the motors within this motor group. This array must contain at least one motor and can contain at most two motors.
Property | Description |
---|---|
motors | The array of Motor objects corresponding to this grouping of motors. Defined by the user, and must contain at least one and at most two motors. |
Installation instructions
To install this package, follow these steps:
- In the Unity Editor, click on Window > Package Manager
- Click the + button and choose Add package from git URL option
- Paste the URL to the package repository: https://github.com/xrc-students/xrc-students-sp2024-ir27-hanlon.git in the prompt and click on Add (make sure your URL ends with ".git")
- If the repository is private, you will be asked to authenticate via your GitHub account. If you haven't been granted access to the repository you will not be able to install the package.
- The package should be installed into your project
- You can download the package samples from under the Samples tab in the Package Manager
Note: Even though the package documentation is public, several XRC packages are private and accessible only to XRC staff and students.
Requirements
This package was developed and tested using the following Unity Editor version:
2022.3.28f1 LTS
Additionally, this package was developed for the Universal Rendering Pipeline (URP).
Dependencies:
- AR Foundation
- Input System
- TextMeshPro
- XRC Anchor Tool
- XRC Motor Tool
- XRC Surface Tool
- XR Interaction Toolkit
Note:
- The package itself does not have any dependencies on hand tracking packages. The provided sample showcases the package in use with both XR Hands and the Unity OpenXR: Meta package, and has dependencies on these packages.
Workflow
See below a screenshot for a scene hierarchy and the inspector for a game object containing all three package components.
Additionally, see below a screenshot of the motor groups array of the logic component expanded, displaying the data types and how they are defined for the sample scene.
Samples
Touch Motors
The includes a sample showcasing the Touch Motors implementation in a Unity scene with hand tracking and passthrough enabled. The sample has the following dependencies:
- XR Hands 1.4.1
- Unity OpenXR Meta 1.0.1
Additionally, the following XR Interaction Toolkit samples must be imported:
- Starter Assets
- Hands Interaction Demo