Skip to content

Repository files navigation

Unity Hand Package

A comprehensive Unity package for hand simulation with joint management, materials, and demo scenes.

Features

  • Hand Management: Complete hand simulation with configurable joints
  • Joint Types: Support for both revolute and spherical joints
  • Input Modes: Multiple input methods including sliders, JSON configuration, and external input
  • Materials: Pre-configured materials for different hand states
  • Demo Scenes: Ready-to-use demonstration scenes
  • ROS Integration: Compatible with ROS-TCP-Connector for robotics applications

Installation

Method 1: Package Manager (Recommended)

  1. Open Unity Package Manager (Window > Package Manager)
  2. Click the "+" button and select "Add package from git URL"
  3. Enter the repository URL: https://github.com/yourusername/unity-hand-package.git

Method 2: Local Package

  1. Download or clone this repository
  2. In Unity, open Package Manager
  3. Click the "+" button and select "Add package from disk"
  4. Navigate to the package folder and select the package.json file

Quick Start

  1. Import the package into your Unity project
  2. Open one of the demo scenes from Samples~/DemoScenes/
  3. Configure the HandManager component with your desired settings
  4. Run the scene to see the hand simulation in action

Components

HandManager

The main component that manages the entire hand simulation:

  • Input Modes: Slider, JSON, or External input
  • Configuration Management: Load hand poses from JSON files
  • Visual Feedback: Toggle hand visibility
  • Fingertip Detection: Find specific hand parts

RevoluteJointXZ

Individual joint component for single-axis rotation:

  • Rotation Axis: X or Z axis rotation
  • Input Types: Keyboard, Slider, Manager, or Grasp motion
  • Limits: Configurable angle limits
  • Settings: Offset, gain, and speed controls

SphericalJoint

Multi-axis joint component:

  • Dual Axis: X and Z axis rotation
  • Key Bindings: Customizable keyboard controls
  • Limits: Separate limits for each axis

Usage Examples

Basic Hand Setup

// Get the HandManager component
HandManager handManager = GetComponent<HandManager>();

// Set external input angles
List<float> angles = new List<float> { 30f, 45f, -15f, 60f, 30f, 45f, -15f, 60f, 30f, 45f, -15f, 60f };
handManager.SetExternalInput(angles);

// Toggle visual feedback
handManager.SetVisualFeedback(true);

JSON Configuration

Create a JSON file in your StreamingAssets folder:

{
  "configurations": [
    {
      "name": "Open Hand",
      "angles": [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]
    },
    {
      "name": "Closed Fist",
      "angles": [90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90, 90]
    }
  ]
}

Dependencies

  • Unity 2022.3 or later
  • ROS-TCP-Connector (optional, for robotics integration)

File Structure

HandPackage/
├── Editor/                 # Editor scripts and tools
├── Materials/              # Hand materials and textures
├── Prefabs/               # Hand prefabs and 3D models
├── Scenes/                # Demo scenes
├── Scripts/               # Core scripts
│   ├── HandManager/       # Main hand management
│   └── JointManager/      # Joint components
├── StreamingAssets/       # Configuration files
├── package.json          # Package manifest
└── README.md             # This file

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Submit a pull request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

For questions, issues, or contributions, please visit the GitHub repository or contact Stefano Dalla Gasperina.

About

Unity Package: Hand Visualization and Tools

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages