This repository provides a lightweight wrapper around libspnav, the client interface for spacenavd, to publish
SpaceMouse state data as LCM messages.
Installation of Spacemouse Daemon (a low-level service that communicates directly with the hardware)
git clone https://github.com/FreeSpacenav/spacenavd
cd spacenavd
./configure
make
make install # You might need to run this command with sudoTo have the daemon start automatically on system boot, run:
sudo cp contrib/systemd/spacenavd.service /etc/systemd/system/
sudo systemctl start spacenavd
# To ensure the daemon is running, you can run
sudo systemctl status spacenavdThis package uses Bazel build system, you can install Bazel by following the instruction.
Once Bazel is installed, you can build this driver as follows:
git clone https://github.com/DAIRLab/spacemouse_driver.git
cd spacemouse_driver
bazel build ... --keep_goingAfter building, under spacemouse_driver directory, simply run
bazel-bin/core/run_driver --lcm_url=udpm://239.255.76.67:7667?ttl=0 --robot_name=UR10 --robot_command_rate=125The driver communicates with the spacenavd daemon through a Unix socket at /var/run/spnav.sock. To run the driver in a Docker container, mount this socket:
Option 1: Using docker run
docker run -v /var/run/spnav.sock:/var/run/spnav.sock <image_name>Option 2: Using docker-compose.yaml
volumes:
- /var/run/spnav.sock:/var/run/spnav.sockImportant: The spacenavd daemon must be running on the host system for the containerized driver to function properly.