Это видео недоступно.
Сожалеем об этом.
Raspberry Pi Devastator Robot #2
HTML-код
- Опубликовано: 17 авг 2024
- Improving my Devastator Raspberry Pi Zero W robot, including running the Python code on boot, tightening the tracks, and powering from one set of batteries. This video is a follow-up to: • Raspberry Pi Devastato...
IMPORTANT NOTE:
On October 30th 2021, a new version of Raspberry Pi OS was released known as “Bullseye”. This has new camera drivers that are not compatible with the Python camera code demonstrated in this video. Sorry. If you are running the version of Raspberry Pi OS known as "Buster", or an earlier version, things should work just fine. I discuss the matter in depth in my video here: • Video
You can find more information on the DFRobot Devastator robot platform here: www.dfrobot.co...
And purchase it on Amazon.com here: amzn.to/2zkEKvq
The code and motor controller sections of this video refer back to content that I covered in “Raspspberry Pi Robotics #3: Keyboard Control”: • Raspberry Pi Robotics ...
I have also placed the wiring diagram and code on this page:
www.explainingc...
More videos on the Raspberry Pi, robotics, AI and other computing-related topics can be found at: / explainingcomputers
You may also like my ExplainingTheFuture channel at: / explainingthefuture
Completely agree, bringing creations from computer code to the physical world is very satisfying.
I have a lot of respect for this guy and his videos; great quality.
Its kinda funny that the raspberry pi is a lot more powerful than a computer sized an entire room from the 80s
vk5tu.livejournal.com/50955.html
The Model B+ is about as powerful as a 1988 Supercomputer. Therefore the Zero W featured in this video is less powerful.
But fair enough, you said "raspberry pi" without specifying the model. A Raspi 3 would smash that thing.
The Pi Zero W has the same SoC/CPU as the Model B+, but is clocked at 1GHz, rather rhan 700MHz, so is more powerful in many regards. Great 1988 supercomputer comparison.
What abot pi 4??? It's even powerful than today's entry level PCs
Th info about powering the pi from the battery back is such great information that can be used over and over again in so many different projects.
Great video Christopher. I am running the later 3.5.3 version of Python and I found that the autostart file was in a different location from your older version of Python in the video so I had to search for it. I also found that the autostart file was write protected so I had to change the file permissions so I could write to the file and save it. Here are the steps to help others...
I am jumping around between the different windows here...
First, search for the autostart file, on the 3.5.3 version of Python (or whatever version you have installed)...
sudo find / -name autostart
My search result was: /etc/xdg/lxsession/LXDE-pi/autostart
Then, select "File" At top left of screen.
Select "Open".
Change directory to /etc/xdg/lxsession/LXDE-pi/
Change the "Files of type" field to "All files (*)".
To make the autostart file writable, (if required) change the file permissions with the following two lines...
cd /etc/xdg/lxsession/LXDE-pi
sudo chmod a+w autostart
Select the "autostart" file.
Open the "autostart" file.
Type in the following after the existing lines...
@lxterminal -e /home/pi/Python_Code/bootup.sh
Note: The "-e" means the following file "bootup.sh" will run in the terminal window.
Select "File" At top left of screen.
Select "Save".
To test, reboot the Pi.
Hope this helps someone out there save some time in finding the autostart file and make it writable!
Thanks for posting this, very helpful. :)
Thanks! This problem has been bothering me for a long time.
Thanks for solving this problem.
What worked for me was writing this code @lxterminal -e /home/pi/Python_code/.shl and not ".sh". No quotations.
Accordingly, you need to change the file name to bootup.shl.
Struggled to get this working, after sifting many blogs were this same problem was reported and trying a lot of variants of the expressions, finally nailed it.
It has been a great project, my son is very happy of his tank.
Thanks a lot Chris!
great project i've got it sorted apart from boot up I'm using Thonny and found autostart file /home/pi/,config/autostart where the file LXinput-setup,desktop comes up I'm unsure what command lines to input /delete any help would be great
Looking forward to you next video on this project. I liked your testing it outside. Nice touch. Merry Christmas!
Nothing says Christmas quite like a Devastator robot!
:)
Outstanding presentation. Clear and concise. Thanks for considering the overscan issue for those of us casting to TVs.
A great many thanks for this -- I'm glad that somebody appreciates my attention to the safe title area for TV viewing. :)
Thank you for the Pi robotics videos! They've helped me finish my Pi Zumo. I'll be moving on to the Devastator these summer hols!
Glad to hear that you are Pi robot building too. :)
Thank you for another excellent video. The bright green eyes are too cool. Thanks for covering the boot script details. This is lacking in so many other tutorials. Learned a lot. Merry Christmas.
Merry Christmas!
Merry Christmas, Christopher! Thanks for all of your excellent content in 2017, and I hope that 2018 is a great year for you.
Many thanks and Merry Christmas!
Nice video. It’s good to see it on this channel. It gives explaining computers a deeper meaning. Merry Christmas!
Thanks and Merry Christmas. :)
The Beast is alive. He does look a bit scary with his menacing green eyes. He needs a name, "The Beast" seems to fit, I'm not sure if you agree. Merry Christmas to you and all of your viewers.
Merry Christmas!
Wow ! I was waiting for this video😊
And Merry Christmas
When will you be doing a follow up to this? I’ve built my own version using a toy rc tank, I’ve bought a camera and got it working but would like to see what you have to say about controlling it as an FPV style bot and the possibility of controlling it via the internet.
Thanks for posting these great videos.
Agree. FPV would be great. Autonomous with mapping and navigation would be cool too.
I didn't think that this would be very useful to me but I watched it because you explain things very well. However, I have struggled to get auto booting Python scripts to work so it turned out to be extremely useful. Many thanks and best wishes for a wonderful Christmas.
Merry Christmas to EC and your family. Have a happy a healthy & safe one.
Merry Christmas to you and yours.
Consider those rocks devastated! Well done.
:)
You could connect the second light(the one which indicates the Pi is booted) to turn on the motors automatically when everything is ready.
An excellent video, Christopher! Very interesting, informative and entertaining. Tanks for posting it.
HAPPY CHRISTMAS!
Merry Christmas!
Merry Christmas hope you have a fantastic day today , and thank you for all the fantastic videos
Merry Christmas!
Merry Christmas Chris! Two days ago, I finally got my RPI Zero W up and running!
Excellent! Merry Christmas!
Merry Christmas!
And to you.
Why not add a relay or transistor replace the motor switch, with the sensor wire running to Pin 29? This way, instead of having to flick two switches, pin 29 will both light up and enable the motors. Then, when you shut the pi down, it will automatically cut the power to the motors. You could do something similar with a few transitions (or maybe an AND chip), where a momentary contact switch turns on the power circuit for the Pi, and losing signal on Pin 29 will cut the power to the circuit. It will take some of the fuss out of starting up and using your new toy.
Yes, a workable solution certainly.
Or take the the jumpers off the two enable lines on the driver board. And drive them with Pin 29. Then you'll have software control of motors.
@@ChristCenteredMinist Could you elaborate on this please? Do you mean software pwm to vary motor speed?
Given that the motor driver is powering the Pi, to replace the double pole switch you'd require two relays, right?
Great Job in showing how to add code and boot code thanks keep up the good work.
Good show Mister Barnatt. Just in time for Christmas and an enjoyable little video as well.
Cool. I think I would go with raspberry RGBW lights for the eyes so you can give it a bit more personality.
Red = mad
Green happy
Blue sad
Orange while watching the sunset
Random while dancing (would be even sweeter if it could dance according to the music it's listing to inside a software defined box)
Cool idea!
Merry Chrismas Mr.Christopher ! And a very happy New Year.... That robot looks awesome with the green lights for the eyes .
Thanks -- and Merry Christmas.
Your Welcome . Love your Videos very much . please make a video on arduino !
Thanks so much for an interesting tutorial on Raspberry Pi. I hoping to see Devastator Robot evolve. Keep up the good work! Happy Holidays to you.
Merry Christmas.
Now let me explain some technical Raspberry Pi Devastator Robot terms:
Experimenting / evaluating - akin to children’s learning experience commonly called playing.
In-depth Evaluation - long-term playing / learning experience.
Adjusting drive mechanism - mucking around with innards, a.k.a Playing.
Coding robot controls - yep. More playing, this time keyboard tinkering.
Keyboard control - remote control playing.
Field evaluation - playing outside.
Satisfactory Experimental Evaluation - Excellent Adult Playing / Learning Experience.
Testing - Playing / Tinkering.
👌😂 Cheers, Ian
;)
Great videos your making here. I'm happy I stumbled across your channel earlier this month!
I know it’s an old video but great job, I enjoy watching your content. Side note
you could also use a 2n222 transistor for a switch just power the base from a GPIO pin!
Great idea.
Wonderful robotics video, Christopher!
Merry Christmas to you and your family!
Thanks. Merry Christmas to you too. :)
This is great - I have one of these platforms, and I'm using a WiPy board to serve up a webpage to drive it from. I'd love to switch to using a Pi Zero.
One way to make startup and shutdown easier could be to make the OS read-only, and safe from corruption should you wish to switch it off without a software shutdown.
I also second Jack Linde's idea of a relay for the motors :-)
Awesome build. I can't wait to get my Devastator tomorrow!!!
It is a very cool kit -- with so many parts!
It was a great build. Still some work to do though. Did you have any issues with the motors occasionally not responding? Ive tightened the tracks and tested with a 2 amp power supply to the pi zero and still the same result.
You are someone I admire and respect. Thank you for sharing your knowledge wit all of us. High quality teaching and content.
You're the master ...👍
So nice of you.
Merry Christmas
Very cool little project, Chris! Bring an engineer myself, I completely agree that seeing code running a practical application is exciting.
Amazing to wake up to this on Christmas morning :) great vid. Merry Xmas
Merry Christmas!
My only real quibble is the tracks. I'd have made them easier to adjust, and used maybe rubber blocks in them too. Maybe even put a tensioner pulley on for the tracks.
happy new year Christopher and if you have time could you include a video on how to add external hard drive onto a raspberry pi 3, hope you had a good mass
A happy new year! An external hard drive can be plugged in to a Raspberry Pi via USB, but it will need to be externally powered.
Old electronic equipment is cool. Analog and digital watches are super cool. Pie charts and curves are logical.
If you suddenly show relevant stuff on an analog multimeter my brain has to "switch gear", just like when you switch to analogue watch after year of just looking numbers.....
And im not saying it is a bad thing, just noticed that i had to think twice to comprehend bouncing needle. :D
Merry Christmas Christopher
Great Video as always.
One word of caution, the motor driver board you use has an onboard LDO (7805), which shares power input from your +12V input. Its output dips very often when the current requirement from the motors increases suddenly. These high demands are, unlike plastic gear motors, quite usual for the large metal gear motors on the Devastator platform. All the voltage variation can lead to detrimental effects on your Raspberry Pi Zero.
You should look into a better motor driver for this platform and a steadier power source (maybe a buck converter?) for the Rpi.
Merry Christmas :)
Thanks for this. I had some reservations about taking power for the Pi from the L298N for the reasons you state. But as my quick multimeter test showed as least the voltage drop is not that significant when the motors run. Given that the Pi has a voltage regulator to drop the 5V input to 3.7V, I therefore thought I'd take the risk. And so far things have worked! :) But I agree, a better means of providing steady power to the Pi would potentially be wise here.
You can also add a mic and a speaker and then run Alexa or any other voice recognition software and control it using your voice. It will be great. And yeah !! I love the video. And I have created my own voice recognition software, in case you need that pls do tell me.
Brilliant video as always!!! Merry Christmas
Merry Christmas!
Well Done Chris.
Another excellent video! Thank you for making these and sharing them with us. Merry Christmas!
now put a mini Christopher puppet on the top of it as the driver. Have a Merry Chistmas Chris !
:)
Hey i find the other keyboard library in Python
it's getch
You can install it with pip install py-getch
import getch
char = getch.getch()
getch is more efficient because it doesn't clear your terminal but it can run it without clear the terminal
Sorry for my bad grammar hehe
I've learnt heck of a lot in this video, thank you.
merry christmas sir chris.
Merry Christmas to you too. :)
I love your videos very much. Especially interesting for me was this video series.
In the video number 2 you shorten the tracks. Well, that I would not do that is so intentional. This allows the tracks to avoid branches or stones. If you shorten the tracks this can damage the drive when driving outside. The branches and stones are without mercy.
You could turn this into a waiter to deliver the Christmas dinner to the table tomorrow :-)
:)
Hello Chris, If you want to vary the speed of the robot, the L298N Motor Controller has PWM inputs that are normally jumpered (called ENA and ENB). I connected Pin 33 and Pin 12 (by board reference) to ENA and ENB to control left and right track velocity of my devastator.
Thanks for this -- I had planned on trying this in a future video, so it is good to know it works. I had assumed that I would have to use the pin 12 PWM for both. So it is very good to learn you have managed to use both channels. I will certainly try this. :)
Very Nice! Happy Christmas from Tennessee
Thanks. Merry Christmas from the UK.
Do you plan on a follow up video where you add a camera? You mentioned it briefly...
It is in production. The camera has now actually been added, and I am just working on the code. Video should upload on 21st October (two weeks today).
@@ExplainingComputers that's wonderful! And what a quick response! It's a bit strange watching your video and you're commenting at the same time. "How can he be here...when he's there..."
Merry Christmas everyone
Very well explained. Enjoyed it very much. Thanks sir. I hope to see more of such videos in future.
You might have given me an idea if I had the money and confidence to build something similar in one of the larger Warhammer 40,000 tanks.
Merry Christmas and have more wonderful EC clips ahead in 2018
Merry Christmas -- next week I've an update on what is coming up for 2018! :)
Wonderful! Merry Christmas to you... Xx
:)
that was brilliant Merry Christmas
And to you. :)
Great video! Didn't realize I could run OS commands through the python script. Should help with some other stuff on my robot.
Thanks. Excellent tutorial.
Thanks professor looks like that was a fun kit to put together as always Nice upload sir and have a merry Xmas .
You make it look so easy :-) Very good!
*sir.. how can i assign a keyboard key like we can do in arduino i.e. when i release a key then motor stops, what is the need of assigning a different key to stop the the motors*
Here I am using Curses to read the keyboard, which reports the last key pressed, so not key releases. I will improve on this code in future videos.
Very cool video, will be getting a Devastator soon! Thanks! Your robot looks mad :)
Your Zumo and Devestator robot series was great. Do you plan a follow up with more features?
I am working on a new Devastator robot video for sometime in September. :)
Hi Mr. Teacher where could I get the operating system for my new Raspberry pi 4 that is compatible with python distributions that you are using?
Thanks
You can download rasbpian on an sd card as os. It is the default rasberry pi os and you can certainly make python programms accessing the gpio with it. But I think every os compatible with rasberry pis should work
Nice video! I am looking forward to the next part... 12:20 I also like your ancient style multimeter. Maybe you have been having it for longer than modern computing exists, I guess... You would not have dreamt of what you would be using it for nowadays when you bought it, right?! :) Fortunately, voltage and resistance are still the same... :D Cheers from Germany. Happy Christmas!
You are so right about the multimeter -- from I think the late 1970s. Bought for electronics work in a very different age. :)
Very nice, and merry Christmas good sir.
Merry Christmas
There's definitely a whole 'nother level of fun when the focus is of the screen and on another object. But do you ever have a moment of thought where you wonder if the day will come in the future when the Devastator gets ahead of you with its' own intelligence? Can't wait for someone to build one that washes windows, scrubs floors, does the sink, tub and toilet and fetches the mail. I would have added 'cooks dinner' too, but I like to have SOME control over what I eat :) Thanks for a great year of Explaining Computers ! Merry Christmas from Ontario, Canada.
Many thanks -- hopefully we will maintain some control as you say! Merry Christmas.
I'm really wanting the third episode in this series
Coming!
An occasional cameo from Mr Pliers, the Hitchcock of EC World.
Nice robot! Instead of a switch to turn on motors you could use a bi-stable relais that is controlled by the code after startup and before shutdown. Merry Christmas.
Can you hook it up to a wireless controller (like Sony's Dualshock via Bluettoth) and get some programming to handle the input sticks (or at least the D-pad)? It would be so awesome!
yes, get ds4windows
The GPIO pin driving the “ready” LED could be used to enable power to the motors via a relay rather than having a second toggle switch.
No, it couldn't -- because the state of this LED would also be unknown, so the relay could start out on or off! :) The first LED that comes on is hard wired to 3.3V.
Enjoyable demo and watch. The resistors for the LEDS, were they 120k values or 12k values?
They were 470 ohm (yellow, violet, brown).
My monitor showed them as brown being closest to the wire end, suggesting brown, reddish-violet yellow
All is well that ends well (grin)
This is amazing :) really want to build this :) Merry Christmas!
Thanks. Merry Christmas. :)
I'm looking forward to any upgrades the robot will receive, maybe a head and some AI
The borg have returned!
A thought - you could have the pi handle the power management to the motor driver with a relay. So then, the motor driver would only come on after the pi had booted and turned it on. And you could turn off the motor driver as part of the shutdown sequence when you press shift-s.
This could indeed work -- though a relay would need interfacing with some sort of controller board, as it could not run from a Pi's GPIO outputs directly.
@@ExplainingComputers No, you can run a relay from Pi's GPIOs without much problem.
When sill you continue this series, I'm really excited for it!
Merry Christmas!!!
And to tou. :)
Sorry -- typo! -- "And to you!" Merry Christmas.
the auto start only works when you have a GUI installed. Else you can use auto logging and add it to .bashrc in ~/pi/.bashrc :-) that's the easiest way for people who are not really familiar with linux.. there are better ways to handle this but they require a bit more knowledge of the runlevels. I always run headless and with SSH on my portable devices.
Great video as usual! and a great robot base.
Hi, quick question please,how could I know if my pi zero has a GUI installed ? Thanks!
Or placing stuff in /etc/rc.local. That's the place for things you want to run after boot.
thanks for the video!! looks like a dandy little robot.
this series has inspired me to do my own robot and would love to see a follow up to this video :D
Great that you are getting into robot building! There will be a follow up video fairly soon!
looking forward to it!
I think the play in the track is needed, because of the suspension travel .
Good stuff. Happy holidays!
Merry Christmas! :)
cool project very impressive coding robot building
I have Raspberry pi 3b. After writing the program 'bootup.sh', when I went to "home/pi/.config/lxsession/LXDE-pi" I cannot see any autostart file.
I can see an autostart folder in config which is showing 'LXInput autostart' but it has totally different syntax from your video's. After writing the same code which u told in the video it didn't work.
Please help me!
Please read through the comments below, where they are solutions. The issue is that you are probably running a more recent version of Raspbian than I was using when this video was made, and setups do change. Good luck! :)
The devastator on test with those mean eyes 👀
Imagine if they had been red! I could not get red at the time.
Merry Christmas have a happy New Year
And to you! :)
Great Video, I am watching this at the end of 2021 and the auto start on boot no longer works that way! Any ideas on how I could do it?
why don't u ever use tab completion in the terminal?
I don't know . . . maybe a new year's resolution for me.
I do like this type of video. Lovin your cool retro analog multimeter .
Always happy to know more about Linux/Raspbian.
Can the python code be updated to keep an eye on the pressed state of the key, and move ONLY when the key is pressed?
This is possible, if tricky using CURSES to read the keyboard, as it does not report a key release. I will address methods to achieve this in a future video.
Question: There was no 'sudo' in your shell script, yet the code still seemed to work. I thought 'sudo' was required in order to control the GPIO pins?
It used to be! :)