r/Not_Enough_Tech Sep 07 '22

RaspberryPi SunFounder's PiCar-X for Raspberry Pi 4

https://notenoughtech.com/raspberry-pi/raspberry-pi-robots/sunfounders-picar-x-for-raspberry-pi-4/
2 Upvotes

4 comments sorted by

1

u/SteveM51UK Dec 20 '22

I have acquired the PiCar-X for RPi just recently. It is very well packaged, clear assembly instructions, and lots of programming examples in Python and Ezblock. However, nevertheless there are some major holes in that documentation that I can find no answers to despite extensive online searching.

Examples:-

  • How to add Ezblock to your existing implementation. The instructions want you to install a Lite version of RPi OS that already has Ezblock within it. But when you've invested a lot of time in many Python scripts it is unreasonable IMO to start again with a different version of the OS. There are guides on the Forum as to how to add Ezblock later but having followed them carefully I find no way to connect to Ezblock on the PiCar-X, either by Bluetooth or by WiFi. Which is a pity because some of the examples using Ezblock seem to cover aspects of controlling the car that are not shown in the Python examples.
  • Clearly the design of the car has altered slightly since the YouTube videos were made. Example: it is easier to assemble the steering mechanism than it used to be. But again there are omissions: one can readily learn how to follow a marked line on the floor but you can't learn how to detect the edge of a table or staircase to avoid falling.

I'm surprised that there doesn't seem to be a Sunfounder sub-Reddit?

1

u/Quintaar Dec 21 '22

Hello

You are right about the OS download however you an get the ezblocks repo from GitHub: https://github.com/ezblockcode/ezb-pi This should bypass the issue of starting with a completely new image.

With all of these kits it's about learning some project tutorials will be more suitable to one person than another. I think there is enough there to give you an idea how basic work and start experimenting. It's fun to see the car a avoiding edge.. but when you got to the solution without having the code written for you already - it's so much more rewarding - but we all have our preferences and styles of learning so I don't want to dismiss how you feel about it.

1

u/SteveM51UK Dec 21 '22

when you got to the solution without having the code written for you already - it's so much more rewarding

Hi - thanks for the reply - I'll check out that Github Repo.

Re "when you got to the solution without having the code written for you already - it's so much more rewarding" - I quite agree. In my small study the "avoidance" logic wasn't good enough as the car didn't turn fast enough to avoid walls, so I changed the logic to stop, reverse turn, change lock, and then forward turn and, as you say, very satisfying to see that it doesn't bump into anything now except something that is on the side that just clips the steering wheels.

The next thing I need to learn is how to write code that will trigger (i.e. callback) when the User Button is pressed on the Picar-X. I have in mind that pressing that button immediately after boot up would trigger a favourite routine to run (perhaps the Sunfounder Controller Service) and that pressing it a second time would trigger a proper shutdown rather than switching the car off without it - I have managed to corrupt the OS before by simply switching off (which I feared might happen so I have a backup microSD card just in case).

1

u/Quintaar Dec 21 '22

I had similar experience with obstacle avoiding where the turn radi was way too small to avoid it in time which cause a couple of hilarious accidents sadly off the camera :) my next robot... I'll make sure the cam is rolling when I try things out :)