Catalog npm
Back to packageRELEASE DETAILS

0.9.2

npm

3dmouse-hid

Wrapper and tools for 3D mice

robotspacemouseteleoperation
Published22 Apr 2026
Direct dependencies6
Transitive dependenciesNot calculated

README

Current package documentation

3dmouse-hid

Use a 3D mouse as a web input device. Great for controlling robot end effectors.

Originally forked from webhid-space, with device support information taken from pyspacenavigator.

Usage

We have tested this code under Ubuntu 22.04 and Ubuntu 24.04. Note that WebHID is only supported by Chrome and Edge as of February 2026. You may experience issues using WebHID with Chromium in recent Ubuntu releases due to Snap isolation.

Connecting a 3D Mouse

When using (Ubuntu) Linux, you need to give your user permission to access the device. Add a udev rule using the USB Vendor ID returned from lsusb (e.g. /etc/udev/rules.d/50-3d-mouse.rules):

# Check the Vendor ID using `lsusb`! See the full set of possible values in `dist/deviceSpecs.js`
SUBSYSTEM=="hidraw", ATTRS{idVendor}=="046d", MODE:="0666", GROUP="input"

And run sudo udevadm control --reload-rules && sudo udevadm trigger

On other systems, this is not necessary.

Included Demos

No build steps are required to run our included demos. Simply run a server using:

npm run test

Open localhost:8000/test in Chrome. Note WebHID is typically only available in HTTPS contexts.

Interactive Visualization and Filters

You can test out the twist visualization using viz_test.html by opening http://localhost:8000/test/viz_test.html.

Simulated UR5

The easiest path to try out the libary with a simulated robot is the included Docker Compose. No ROS installation is required on the host.

docker compose up --build sim web

By default, this will use ROS Jazzy. To run against a different ROS distro image (for example Humble), set ROS_DISTRO when building/running:

ROS_DISTRO=humble docker compose up --build sim web

Then open http://localhost:8000/test in Chrome and connect the device.

Notes:

  • This setup is currently Linux-oriented because ROS 2 discovery between containers is configured with network_mode: host.
  • sim serves rosbridge on ws://127.0.0.1:9090, which matches the default in test/robot.js.
Full Simulation Installation (Advanced)

We include a ROS2 Humble robot simulation to enable testing without a robot. You will need to install various UR ROS2 packages to use it:

sudo apt install ros-humble-ur-description ros-humble-controller-manager ros-humble-ur-moveit-config ros-humble-ur-simulation-gz ros-humble-ros-gz-bridge ros-humble-ros-gz-image ros-humble-rosbridge-suite ros-humble-ros2-control ros-humble-position-controllers ros-humble-image-transport ros-humble-image-transport-plugins

Our main launch file calls launch files created by Universal Robotics for placing their robot model in a Gazebo simulation, and also homes the robot and configures camera views:

cd 3dmouse-hid/test/ros && ros2 launch ur_teleop_sim.launch.py

This launch runs headless by default. MoveIt 2 Servo, the package which provides the end-effector twist controller, is initialized and activated in the final step of the launch file, after which you can confirm that servo is running:

ros2 topic pub /servo_node/delta_twist_cmds geometry_msgs/msg/TwistStamped "{ header: { stamp: 'now', 'frame_id': 'tool0' },  twist: {linear: {x: -0.1}, angular: {  }}}" -r 10

Now you should be able to open http://localhost:8000/test/ and follow the interface instructions to teleoperate the simulated robot.

Debugging WebHID Issues

Try using nondebug's WebHID Explorer to connect to the device. If the connection fails, take a look at chrome://device-log/ to see why.

Citation

If you use this work, please cite:

@inproceedings{dhat2024mice,
  author = {Dhat, Varad and Walker, Nick and Cakmak, Maya},
  title = {Using 3D Mice to Control Robot Manipulators},
  year = {2024},
  month = mar,
  booktitle = {ACM/IEEE International Conference on Human-Robot Interaction (HRI)},
  location = {Boulder, CO, USA},
  wwwtype = {conference},
  wwwpdf = {https://hcrlab.cs.washington.edu/assets/pdfs/2024/dhat2024using.pdf},
  wwwcode = {https://github.com/hcrlab/3dmouse-hid},
  doi = {10.1145/3610977.3637486}
}

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Declared dependencies 6

Native requirements
6 direct targetsNot calculated transitive count
Package / targetRequirementRelationship
three
Environment
{
  "local_name": "three",
  "alias": false,
  "peer_metadata": null
}
0.183.0runtime
eslint
Environment
{
  "local_name": "eslint",
  "alias": false,
  "peer_metadata": null
}
^10.0.0development
http-server
Environment
{
  "local_name": "http-server",
  "alias": false,
  "peer_metadata": null
}
^14.1.1development
prettier
Environment
{
  "local_name": "prettier",
  "alias": false,
  "peer_metadata": null
}
3.8.1development
roslib
Environment
{
  "local_name": "roslib",
  "alias": false,
  "peer_metadata": null
}
2.0.1development
tweakpane
Environment
{
  "local_name": "tweakpane",
  "alias": false,
  "peer_metadata": null
}
^4.0.1development

Distribution files

1 collected
Distribution 1

Source distribution

Source file
Checksums from source
{
  "integrity": "sha512-WfnIvH3Ep+V2ODz6z7FvIU5NzhH3r+F4fKlVeAus/bIwdeAZ5fnnVsC3uGHkfB/lGhAJa4u7/gI2c32NH4L5bQ==",
  "shasum": "78be6355fad06ae32cdf7e25323df7cdf3baa507",
  "tarball": "https://registry.npmjs.org/3dmouse-hid/-/3dmouse-hid-0.9.2.tgz",
  "fileCount": 9,
  "unpackedSize": 37228,
  "attestations": {
    "url": "https://registry.npmjs.org/-/npm/v1/attestations/3dmouse-hid@0.9.2",
    "provenance": {
      "predicateType": "https://slsa.dev/provenance/v1"
    }
  },
  "signatures": [
    {
      "keyid": "SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U",
      "sig": "MEQCIHFc++cr/GwV0PvCsJNU4q9jLcru86XqYzv1gxf7wc7gAiB3yNF8qiAA5YxJcUKpbhpN9WtUAiV6GEF7g4shtihqQA=="
    }
  ]
}

Repository

PENDING
hcrlab/3dmouse-hid

Shared repository data · GitHub

License detected in repository
Not collected

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 19:40 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package_version:12f3362bf296fc7ce80bd5f3018db9d4149d5b7f3822145633e6ec0cc47fcaaf

Other collected versions

0.9.18 Jan0.9.08 JanView all collected versions →