Skip to content

stedwick/PhilNav-Python-RaspberryPi

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

50 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PhilNav-Python-RaspberryPi

Intro

PhilNav is a very good infrared head mouse, sorta like the discontinued NaturalPoint SmartNav. It runs at 75 FPS for buttery smooth mouse movements and pixel perfect accuracy.

[Note: zero hardware or software is from the SmartNav, everything is built and programmed 100% from scratch by me, Phil.]

PhilNav allows you to use your computer hands-free by tracking a reflective sticker on your head, and then moving the mouse accordingly.

I also have a speech-to-text dictation app. Combined with this, use your computer completely hands-free: https://phils.app

Watch Phil's YouTube video here: https://youtu.be/JTLs7z0PO-k

IMAGE ALT TEXT HERE

There's *lots* of assembly required since the Raspberry Pi has to be built. You can buy a pre-built PhilNav from Phil here: https://philipb.gumroad.com/l/philnav


PhilNav has exceeded all my expectations. It's better than other head-mice, and I hit all of my goals:

  1. Pixel perfect accuracy
  2. 5 ms latency, at 75 FPS
  3. Cross-platform on Windows, Mac, & Linux
  4. Configurable, with keyboard shortcuts
  5. <1% CPU/RAM on client

The trade-offs I made include:

  1. No graphical user interface
  2. Not Plug-and-Play Over USB, uses the network (Wi-Fi, ethernet)
  3. Difficult to assemble and install (knowledge of building Raspberry Pi computers and Python required)
  4. No clicking. You'll have to use a switch, pedal, or other dwell clicking software.

There are many other head-mice, but mine's the best:

It uses a client/server model; the server runs on a Raspberry Pi with a Picam 3 NoIR camera, and the client runs on your Windows, Apple macOS, or Linux PC. They communicate over Wi-Fi or ethernet via UDP multicast.

It's free and open source on GitHub, written from scratch in Python3 by Philip Brocoum. There are no dependencies on the 2002 SmartNav hardware or software (it's discontinued anyway by NaturalPoint as of 2018).

Running PhilNav

Start by running the following Python scripts on the client and server. You may have to pip install a bunch of things first. I put my reflective sticker on my headset mic boom.

# server
sudo apt install python3-opencv

# client
pip install ...

Server - Raspberry Pi

python3 server_raspberrypi/main.py --verbose --preview

Client PC - Win/Mac/Nix

python3 client_win-mac-nix/main.py --verbose

On the Raspberry Pi you should see a preview of the camera, and on the client machine the mouse should start to move. Use --help to change your settings to your liking.

Here are my own settings:

python3 server_raspberrypi/main.py 

python3 client_win-mac-nix/main.py --speed 21 --smooth 3 --deadzone 0.04 --keepawake 56 --timeout $((60*60*8))

(If you have a firewall, ports 4245 & 4246 must be open to send/recv UDP.)

Building PhilNav

Watch the YouTube video here:

Parts:


With this open source project, disabled folks are not at the mercy of a private company that might discontinue products, and we are not stuck on Windows =)

About

DIY infrared head-mouse in Python using Raspberry Pi w/ NoIR camera over local UDP network, 75 FPS

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages