Camera Pan/Tilt for the Raspberry Pi Camera

A project log for ICARUS Scout

The Scout is a tank-style robot.

david-gitzDavid Gitz 11/04/2017 at 14:180 Comments
For my project I wanted to have a pan/tilt mount for the Raspberry Pi Camera that I can control remotely and view the video stream in a GUI.  I found adafruit's pan/tilt mount but I wasn't a big fan of it, I didn't like the mounting options a lot.  And with my new 3d printer I wanted to try it out by designing something useful.  So I designed my own pan/tilt mount.  I put the design files on grabcad here.  I went through several iterations of this and I like how it turned out, but I think if someone was to use this they would want to reinforce the pan bracket a little more.  Also, the mounting location for the tilt bracket should be moved up a bit to increase the range of motion.

So this is great and all.  But how do you get the video stream?  After a lot and lot of googling I figured out how to start a TCP stream on the raspberry pi and send it to a GUI in QT.

On the pi run:

raspivid -t 999999 -h 480 -w 640 -fps 25 -hf -b 2000000 -o - | gst-launch-1.0 -v fdsrc ! h264parse !  rtph264pay config-interval=1 pt=96 ! gdppay ! tcpserversink host=IPADDRESS port=PORT

 The GUI code is a bit more involved, but for an example you can view what I'm doing here.  This includes how to convert it into a QT pixmap suitable for overlaying image data as well.  That's all for now, I hope this was useful.  I think next time I'll talk about how I'm doing the auto-generation of code for different comm protocols/messages.