USB Device Support

Hi community,

is it possible to use USB devices for DonkeyCar ?
My CPU board (Intel Euclid) has no I2C available and I’m searching for a concept to use USB devices.
For other projects, I’m using a simple Arduino Nano, connected via USB to generate PWM
servo signals or getting battery power informations.

Video: Intel Realsense R200 or any other UVC (stereo) devices ?
Motor/Steering: are there any alternate steering/motor drivers (parts) available ?

Thanks for any hints

Cheers
Chrimo

Yes, it’s possible. Just a couple of things to keep in mind. Your USB camera will draw power (~ 0.5A) so you need to make sure your battery pack can account for that.

Here is an example camera part which streams data over USB. The camera i am using here is JeVois but the same principle applies to other cameras.

For cameras like the T265 or other depth cameras - check to see if they have a Python SDK that you can rely on. For e.g. the T265 already has one.

Edit:

  • Did you realize that you were asking about USB devices in general. I thought you were talking about USB cameras.
  • Bear in mind the T265 needs USB 3.1 because it draws a lot more power & it’s sending 2 fish-eye streams simultaneously.
1 Like

maybe OpenCV and PyMata are an option.

I’ve used it at other projects.
I must check DonkeyCar part internals and give it a try :slight_smile:

I’ve not tried it, but I’ve heard of some using an Ardiuno over serial USB to do pwm. This class might be an interesting starting point: https://github.com/autorope/donkeycar/blob/b6beafc9a7d005efdff5ade87228ae5f0a512a85/donkeycar/parts/actuator.py#L360

1 Like

OK, it’s a starting point…
but I have generic question first:

I control the servo or ESC directly with parameter in degrees.
Servo/Steering:
left: 0-89
straight:90
right: 91-180

ESC/Motor:
forward: 91-180
stop: 90
backward: 89-0

How is the mapping algorithm for the donkey car internal logic ?

I think you are probably looking for actuator.py which handles that. You should also read up on PID controller.

1 Like