usb camera and GPIO pins.

The brains of your robot

usb camera and GPIO pins.

Postby darkerdude » Sat Mar 21, 2015 3:59 pm

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.
darkerdude
 
Posts: 2
Joined: Sat Mar 21, 2015 4:45 am

Re: usb camera and GPIO pins.

Postby Alan » Wed Mar 25, 2015 3:00 pm

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
Alan
Site Admin
 
Posts: 311
Joined: Fri Jun 14, 2013 10:09 am


Return to Software

Who is online

Users browsing this forum: No registered users and 1 guest