larsll / deepracer-pi

A port of the DeepRacer software stack for the Raspberry Pi 4.
MIT License
5 stars 6 forks source link

Compatibility with Raspberry Pi 5? #11

Open jeremypedersen opened 3 weeks ago

jeremypedersen commented 3 weeks ago

Sorry to contact you via GitHub Issues, but I wasn't able to join the DeepRacer Community Discord (phone verification issue).

Just curious if this code works with the Raspberry Pi 5. I notice the README refers to "Raspberry Pi 4 compatible" boards. Would that include the 5?

larsll commented 3 weeks ago

I have not tried. Apparently GPIO works differently on the 5, so I suspect some changes would be needed.

jeremypedersen commented 3 weeks ago

Ok I'll try with the 4 first then (apparently Pi 4 and Pi5 share the same GPIO pinout but use different GPIO hardware supported by different libraries). 👍

jeremypedersen commented 3 weeks ago

Sorry, another quick question. I had a look at the .stl files for the mounting plate and front and back pieces, and it isn't clear which version of the files I should print out for use with the DeepRacer car. After opening them and examining them carefully, I assume I need to print:

PiMount v1.2-Back.stl PiMount v1.2-Front.stl PiMount v1.2-Plate.stl

So....all "v1.2". Is that correct?

Also, what mounting hardware did you use to mount the Pi to the plate and to mount the Pi camera? I bought a set of M3/M2.5 bolts, screws, and spacers, not knowing what else to buy.

larsll commented 3 weeks ago

You can do either v1.2 or v1.3 plate - the v1.3 plate has the Pi in the front, rotated - v1.2 has it on the right side. Legs if you want to mount on a DeepRacer, no-Legs if you want to mount on stock A947, A959, A979.

Check also - https://github.com/larsll/deepracer-pi/pull/10/files -- actually - I merged that; it is now visible as https://github.com/larsll/deepracer-pi/blob/main/BUILDING.md

larsll commented 3 weeks ago

Ok I'll try with the 4 first then (apparently Pi 4 and Pi5 share the same GPIO pinout but use different GPIO hardware supported by different libraries). 👍

The code primarily uses sysfs, so if that works then only the pin numbers need adjusting.

jeremypedersen commented 3 weeks ago

Awesome, missed that one.

jeremypedersen commented 2 weeks ago

Just a followup: I did test with a Pi 4B and a Waveshare servo driver hat. Worked like a charm. If I get a chance, I will try again later on with a Pi 5.

jeremypedersen commented 1 week ago

Did some testing on the Raspberry Pi 5 this morning. Turns out Ubuntu Server 22.04 is not supported on the Pi 5 and there are no plans to back-port it.

This means either:

  1. Updating the whole ROS 2 stack to work with ROS 2 Jazzy on Ubuntu 24.04
  2. Attempting to run ROS 2 Humble on Ubuntu 23, as documented in this blog post
  3. Attempt to run ROS 2 inside Docker containers running Ubuntu 22

I'll try Option 2 later this week and update here on whether or not it can be made to work. Options 1 and 3 are too much work for me to attempt right now.

As for GPIO incompatibilities, I'm not able to test that yet, but it does look like sysfs is forwards compatible with the Pi 5, assuming a newer kernel is used.

jeremypedersen commented 1 week ago

After some additional research it looks like there are enough problems to make Options 2 and 3 unlikely to work.

So the correct thing to do for the Pi 5 would be to port everything forward to ROS 2 Jazzy on Ubuntu 24.04. Don't have time for that right now but if I find the time I'll definitely give it a try + share my code.

larsll commented 1 week ago

@jeremypedersen - I think moving to Jazzy is the easiest thing. Foxy to Humble was quite simple; code changes were very limited. The bigger topic was to adapt the DR code to work with the OS (differences between 20.04 and 22.04). For now, as the RPi4 is working this is not really a priority, but still a valid request, so I will keep it open.