Skip to main content

Overview

Hand model and tactile calibration data belongs to the current SDK user. When several people share one glove on the same computer, create a separate user for each person to keep calibration data separate. User information is stored locally and is not uploaded. The current user is written to a configuration file shared by Python and C, so a switch takes effect in other processes immediately. Confirm the current user before calibration. This page covers user creation, switching, deletion, and data transfer. Matching examples: examples/python/wuji_glove/4.user.py and examples/c/wuji_glove/3_user_management.c. For the concept and basic usage, see Device Parameters.

Prerequisites

Hardware

User management reads and writes local data and doesn’t need a glove.

Software

Local Storage Layout

The SDK uses ~/.wuji/sdk/ for the following data:
Example registry.toml:
The default user’s user_id is an empty string, not "default" or None. current_user_id is stored in this file, so user switching persists.

Data Flow

API Reference

The user management interfaces are: Python and C provide equivalent user management capabilities. Use the export, preview, and import interfaces to move calibration data between computers. On the Python side, the user dict holds user_id, display_name, description, is_default, created_at, updated_at, and external_id. The C WujiUserInfo struct uses the same field names. The SDK allocates strings in WujiUserInfo output values. Free a single structure with wuji_user_info_free(&user) and an array with wuji_user_info_array_free(users, len). Do not mix these functions. Besides display_name, description, and external_id, WujiUserUpdate carries the booleans clear_description and clear_external_id for setting a field to empty. Passing NULL means “leave it alone,” not “clear it.”

Behavior and Error Handling

The following behavior applies to the user management interfaces.

User Names Must Be Unique

The SDK guarantees unique display_name values. The duplicate-match branch in the example is not reached:
Callers don’t need an additional branch for duplicate results. Callers still need to handle a name collision during creation. Concurrent creates can race, so catch WujiException.

Deleting the Current User

After deletion, the SDK switches to the default user: The operation doesn’t leave a dangling current-user pointer. It also deletes that user’s calibration data, so confirm before deleting.

The Default User Can’t Be Deleted

A Nonexistent user_id Raises an Error

The SDK doesn’t switch to the default user automatically.

Switching Takes Effect Across Processes and Languages

For example:
  1. The C program runs ./3_user_management --default-user, switching to Default
  2. A brand-new Python process reads current_user()
The result is Default with a user_id of ''. Going the other way, a user created by the C program’s --user-name CDocTest shows up in Python’s list_users() immediately, with non-ASCII text in description intact:
Both interfaces read and write the same registry.toml and don’t maintain separate caches.

Export Requires Calibration Data

Calling export_user_data for a user without calibration data:
Both arguments in export_user_data(user_id, out_path) are required.

Error Handling Quick Reference

Command-line tools can catch WujiException and exit with a non-zero status. Display the exception message without printing the full traceback.

Basic Operations

User operations need no device connection. Call them right after wuji_init().

Run the Examples

Measured output from the C side’s --list:
When you create a user, the previous and current blocks differ:
Both sides print identical formats, which the examples align deliberately. The * marks the current user. These are real results from SDK v2026.8.31 with no device connected. Every user created during verification has been deleted, and the current user is back to what it was.

Usage Recommendations

Confirm the User Before Calibrating

This is the whole reason for this page. Calibration output lands under the current user, so the wrong user overwrites someone else’s data, silently. Add one line at the top of your calibration script:

Move Calibration Results to Another Machine

export_user_data packs the bundle, preview_user_data shows you what’s inside on the target machine, and import_user_data brings it in once you’re satisfied. Importing recreates the user as needed, so you don’t have to create a matching user by hand first. The user dict carries an external_id field that neither example uses. When you connect your own account system, store your external primary key there instead of matching on display_name.

Keep Scripts Non-Interactive

Both examples are one-shot command-line tools, which suits dropping them into the shell script around your calibration flow. --list exits 0 on success and 1 on failure, so you can branch on that.