I know the BeagleY-AI is a bit older now since PB2.
yet, I have a feeling that Donkey Car would fit this specific board, the beagley-ai
, well.
Seth
P.S. Has anyone tried to get donkey car working on the BeagleY-AI?
I know the BeagleY-AI is a bit older now since PB2.
yet, I have a feeling that Donkey Car would fit this specific board, the beagley-ai
, well.
Seth
P.S. Has anyone tried to get donkey car working on the BeagleY-AI?
So far, I am altering their source to handle ideas for the BeagleY-AI and how PWM is supported on the board.
It seems that Donkey Car uses a rpi gpio
and pi gpio
libraries which seems not useful for my case here.
So, I am trying to set up a couple of scripts in the functions for gpiod which should bring upon better results (hopefully).
Seth
P.S. If you are using gpiod
for I/O and PWM
on the BeagleY-AI, any ideas relevant would be beneficial:
A module that was compiled using NumPy 1.x cannot be run in
NumPy 2.1.3 as it may crash. To support both 1.x and 2.x
versions of NumPy, modules must be compiled with NumPy 2.0.
Some module may need to rebuild instead e.g. with 'pybind11>=2.12'.
If you are a user of the module, the easiest solution will be to
downgrade to 'numpy<2' or try to upgrade the affected module.
We expect that some modules will need time to support NumPy 2.
Traceback (most recent call last): File "/home/hartl/mycar_one/./manage.py", line 24, in <module>
import cv2
AttributeError: _ARRAY_API not found
________ ______ _________
___ __ \_______________ /___________ __ __ ____/_____ ________
__ / / / __ \_ __ \_ //_/ _ \_ / / / _ / _ __ `/_ ___/
_ /_/ // /_/ / / / / ,< / __/ /_/ / / /___ / /_/ /_ /
/_____/ \____//_/ /_//_/|_| \___/_\__, / \____/ \__,_/ /_/
/____/
using donkey v5.1.0 ...
INFO:donkeycar.config:loading config file: /home/hartl/mycar_one/config.py
INFO:donkeycar.config:loading personal config over-rides from myconfig.py
INFO:__main__:PID: 1168
WARNING:donkeycar.parts.pins:GPIO was not imported.
cfg.CAMERA_TYPE V4L
INFO:__main__:cfg.CAMERA_TYPE V4L
INFO:donkeycar.vehicle:Adding part V4LCamera.
INFO:donkeycar.parts.web_controller.web:Starting Donkey Server...
INFO:donkeycar.parts.web_controller.web:You can now go to hartle.local:8887 to drive your car.
INFO:donkeycar.vehicle:Adding part LocalWebController.
INFO:donkeycar.vehicle:Adding part Pipe.
INFO:donkeycar.vehicle:Adding part ExplodeDict.
INFO:donkeycar.vehicle:Adding part Lambda.
INFO:donkeycar.vehicle:Adding part Lambda.
INFO:donkeycar.vehicle:Adding part Lambda.
INFO:donkeycar.vehicle:Adding part Lambda.
INFO:donkeycar.vehicle:Adding part Lambda.
INFO:donkeycar.vehicle:Adding part ThrottleFilter.
INFO:donkeycar.vehicle:Adding part UserPilotCondition.
INFO:donkeycar.vehicle:Adding part RecordTracker.
INFO:donkeycar.vehicle:Adding part AiLaunch.
INFO:donkeycar.vehicle:Adding part DriveMode.
INFO:donkeycar.vehicle:Adding part ToggleRecording.
INFO:donkeycar.vehicle:Adding part TwoWheelSteeringThrottle.
I am working around their libraries now and functions/classes for GPIO and PWM to steer via a two-wheel/DC-motor L298D style of commands…
Anyway, the file in question is pins.py which calls for specifics. My error is here:
/Testing_Donkey/donkeycar-5.1.0/lib/python3.11/site-packages/donkeycar/parts/pins.py", line 256,
in pwm_pin_by_id
raise ValueError(f"Unknown pin provider {parts[0]}")
No matter what I have done so far, the ValueError
is raised. Anyway, here is the pins.py file in question…
That is my github account with the clone of their repo. I will update shortly on what changes I have made.
# DICT = {}
class PinProvider:
# GPIO = "GPIO"
GPIO = {
'PWM33' : "/dev/hat/pwm/GPIO13",
'PWM32' : "/dev/hat/pwm/GPIO12",
'PWM38' : "/dev/hat/pwm/GPIO20",
'PWM40' : "/dev/hat/pwm/GPIO21"
}
That is my PinProvider
class for using PWM under the GPIO header for their source…
Here is the changes in PWM/GPIO and what I am doing currently…
def output_pin_by_id(pin_id: str) -> OutputPin:
"""
Select a ttl output pin given a pin id.
:param pin_id: pin specifier string
:param frequency_hz: duty cycle frequency in hertz (only necessary for PCA9685)
:return: OutputPin
"""
parts = ''
if parts[0] == PinProvider.GPIO:
pin_provider = parts[0]
# pin_scheme = parts[0]
# pin_number = int(parts[0])
return output_pin(pin_provider)
raise ValueError(f"Unknown pin provider {parts[0]}")
def pwm_pin_by_id(pin_id: str, frequency_hz: int = 50) -> PwmPin:
"""
Select a pwm output pin given a pin id.
:param pin_id: pin specifier string
:param frequency_hz: duty cycle frequency in hertz
:return: PwmPin
"""
parts = '0'
if parts[0] == PinProvider.DICT:
pin_provider = parts[0]
# pin_scheme = parts[0]
# pin_number = int(parts[0])
return pwm_pin(pin_provider, duty_cycle=frequency_hz)
raise ValueError(f"Unknown pin provider {parts[0]}")
I took out pin_scheme
and pin_number
since they are char/str and not values/int.
In this bunch of source, I removed the PIGPIO
and RPI_GPIO
and PCA9685
drivers because the beagleboard.org board called the BeagleY-AI does not utilize these resources.
Seth