Page 1 of 1

usb camera and GPIO pins.

PostPosted: Sat Mar 21, 2015 3:59 pm
by darkerdude
Hello everyone. I got my hands on a dawn robotics kit and its great! I am not very familiar with this programming language, as the last time I did any programing to this level was about 10 years ago using C. So I am rather rusty, and am overwhelmed by the coding and all the files supplied. I did investigate through the various PY files provided in the kit as well as other research online and came back more confused than informed :shock: So my question is, Can any one point me to where/which PY files I can manipulate to control the GPIO outputs instead of the Dagu unit for motor controls. ( I have a L298N chipset ) And also, where in the streaming programs can I switch the camera to a USB camera ( I would like my robot to have the ability to switch cameras ) so I have a second camera which I will make a program afterwards to switch.

Any help would be greatly appreciated.

Re: usb camera and GPIO pins.

PostPosted: Wed Mar 25, 2015 3:00 pm
by Alan
Hi there,

Welcome to the forums. :) Apologies that it's taken so long to answer your post.

I see that you've found the forum thread describing the code, that's the main 'documentation I'm afraid.

The file that you need to alter to control GPIO pins for motor control is robot_controller.py. You should see that in the update() routine (line 254) we call routines on a miniDriver class to set motor speeds and pan/tilt angles. You can replace this with calls to set GPIO pins.

Camera streaming on the Raspberry Pi is handled by a separate C program, raspberry_pi_camera_streamer, which is started and stopped automatically by the CameraStreamer class. I think that in order to use another camera you would need to change raspberry_pi_camera_streamer to work with a USB camera or alternatively alter camera_streamer.py to use a different camera program.

Hope that helps.

Regards

Alan