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
- Python
- C
Local Storage Layout
The SDK uses~/.wuji/sdk/ for the following data:
registry.toml:
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
display_name values. The duplicate-match branch in the example is not reached:
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
Switching Takes Effect Across Processes and Languages
For example:- The C program runs
./3_user_management --default-user, switching to Default - A brand-new Python process reads
current_user()
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:
registry.toml and don’t maintain separate caches.
Export Requires Calibration Data
Callingexport_user_data for a user without calibration data:
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
- Python
- C
wuji_init().
Run the Examples
- Python
- C
--list:
previous and current blocks differ:
* 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.
Use external_id to Link an External System
The user dict carries anexternal_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.
Related
- Wuji Glove Hand Model Calibration: produces the hand model filed under the current user
- Wuji Glove Tactile Calibration: also filed by user and serial number
- Wuji Glove Custom Hand Model: name a hand model directly, bypassing the user system
- Wuji Glove Offline Processing: loads the hand model by serial number during replay