dev/hack/make/play


Dancing Laminette

Dancing Laminette is a chair that dances and whistles/sings while nobody is watching. As soon as it "sees" someone it stops.

About

Dancing Laminette is an interactive installation I did as a maker in residence in Nordenfjeldske Kunstindustrimuseum in Trondheim, Norway, from 18th till 30th August 2016 as a part of the Creative Museum project. Laminette is a famous Norwegian chair designed by Sven Ivar Dysthe in 1968.

Installation consists of a (modified) chair with motors integrated into its legs and a Raspberry Pi 3 computer with camera running the face detection algorithm. When there are no detectable faces in the field of view chair starts to whistle/sing and "dance" (move its legs). As soon as a face is detected chair stops in the normal position.

All the code and 3D files can be found in the BitBucket Git repository at https://bitbucket.org/igor_b/dancing-laminette

Details

System is written in Python and uses OpenCV for face detection. Pigpio is used for servo motor control. Main application runs three processes: one for fetching the video stream from the camera, one for image processing and one for servo control. This way each proces runs on separate CPU core (this isn't possible, at least not easily, using threads in Python due to the GIL).

By using multiprocessing approach I get 2-3 frames per second for 800x600px image (I need to detect faces from some 4-5m so I needed at least that resolution). Single threaded application resulted in one frame every 2-3 seconds.

Besides the main application there is also web interface for configuration/debugging which shows positions of detected faces, stream from the camera and can set some options (Haar detector parameters, image size). Raspberry is configured to act as a Wi-Fi access point so configuration is done by connecting to it and opening the web interface. Backend is written using python-bottle and frontend is a simple HTML with some jQuery.

System is also modified to boot from the read-only file system so power off is possible without proper shutdown.

I had to modify the servo motors a bit to fit them — cable was on the "wrong" side and I decided to add a small "shaft" for mounting the 3D printed parts. Attaching a long leg on the servo shaft (I even made the legs hollow to make them lighter) resulted in a lot of oscillations in servo movement. Since I couldn't acces the servo's internal PID to change parameters :) I simply lowered the supply voltage from 5V to some 4.2V which made the situation much better (also, some sponge in the "knees" dampened the oscillations a bit more).

License

Code and 3D files are released under the MIT license.

Copyright (c) 2016 by Igor Brkić

Comments