My dad and I built a new Raspberry Pi model railroad camera car. Instead of trying to use the angle of the trucks to pan the camera, we just mounted an SG-90 micro servo to it and wired it up to the Raspberry Pi Zero W. I wrote a simple bash script to slowly move from the current servo position to the new servo position. With this, I did a lap around the layout, slowing down to take a look at the scenery from different angles.
The servo is driven by ServoBlaster:
https://github.com/srcshelton/servoblaster
The camera is streamed using libcamera-vid and VLC.
The model railroad is controlled by JMRI running on a Raspberry Pi 3B connected to our Digitrax DB150 base station using a homemade serial port adapter. In this video, I am using JMRI WebThrottle to control the locomotive that is pushing the Raspberry Pi camera car. I was in a different room at my laptop while making this video, no one was in the train room. Everything was controlled on the laptop. We also have turnouts and the turntable wired up to JMRI with web control but I didn't use any turnouts in this video.
1 Comments