-
Notifications
You must be signed in to change notification settings - Fork 0
Hardware
quebeh edited this page Mar 24, 2023
·
8 revisions
The hardware folder has several useful classes with the necessary functions.
Returns a adafruit_pca9685.PCA9685 object with the given frequency
import hardware
pca = hardware.getPCA()Calibrates a connected ESC and provides a speed controller
Sample use:
esc = hardware.ESC(pca.channels[15]) # replace with used channel
esc.speed = 1 # Forward
esc.speed = -1 # Backward
esc.speed = 0 # StopCalculates duty cycle for servo
Sample use:
servo = hardware.Servo(pca.channels[0]) # replace with used channel
servo.turn(90) # Turn 90 degrees
servo.turn(180) # Turn 180 degreesA simplifier for the camera post-processing and prediction. Uses checkerboard pattern recognition from opencv to get ROI (Region of interest) coordinates which will later be used to warp the image. The warped image is then thresholded to get a vivid black and white image of the road lines, then the prediction is performed.
A class to simplify ESC, servo and camera together