[Crowd mower] - a lawn mower that anyone can control via the Internet
Do you have a moment? Could you mow my lawn?
A brief history of development on the knee of a lawnmower robot. You can manage it from anywhere in the world via the Internet. Dreamed of feeling like an operator of a rover or a lunar rover? Just need to go to the site mowmylawn.ru and you can control the lawn mower in my yard!
Prehistory
The whole story of lawn mowers began in the summer of 2015, my first post on the GT was just about my experience in implementing a mower from what was in the garage. ')
Tv
After that, representatives of the company Robomow offered to use their platform for further development. This is very convenient, because all questions on hardware and mechanics require special skills and take a very long time.
I really wanted to organize a competition for lawn mowers . As it turned out, this is not an easy matter. More than 15 teams were registered, but in the end only three participants showed the progress of the work.
Roman Sakovich, Minsk (Belarus), 'Belmower'
Chassis: three-wheeled robot. Two driving wheels, one free.
Electronics: Two boards. Raspberrry Pi - as a top-level control system. Its tasks include route planning, trajectory construction, and so on. Nucleo stm32 - as an executive system of the lower level. Its tasks include navigation, sensor polling, motor control, etc.
Navigation: A system for the integration of data RTK, odometers and ins. This is a proprietary system.
Unfortunately, I must inform you that our team will most likely not be able to take part in the competition. The fact is that during the first field tests in the design of our robot, certain shortcomings were identified, which will take some time to correct. We are not going to suspend the work on the project, but against the background of the upcoming session, we can hardly even present the minimum version of the robot by the target date (let alone the use of machine learning, which was to become our strong advantage).
Nikolay Mironnikov, Novosibirsk
All efforts to hold the contest in Skolkovo were in vain. In the end, it turned out that there is no free lawn for the robotics competition in Skolkovo. All possible sponsors do not want to get involved in a new competition with unclear prospects. I did not even get an answer to the letters to the municipal organizations. As a result, we had a vague perspective to organize a competition for 4 participants from different cities. Although the competition turned out to be international, it was still more expedient to cancel it, as it is not a pity.
RoboKosilka 2016. ROS & FUN
I master ROS and write a robotic mower launcher, I use Kinect and SLAM, only on visual odometry the robot builds a map and paves the route. Kinect does not work well in sunny weather. With ROS you will do “Hello World!” In one evening, and then darkness. I never found a normal guide for a beginner how to make a robot, and not just write in topics. Has anyone wondered why there is not a single point in the RF on the map of the ROS community ? I opened a VK group .
In his spare time he screwed two servo drives, an ultrasonic sensor, and an Arduino to his workhorse. A simple test of driving around a birch and stopping! And then the abyss, this thing is dangerous just to let on your site! You can't even kick her like robots, you know how.
It turns out robots - things are quite boring in the understanding of most people, especially service robots. Yes, I know about the great friendship between vacuum cleaning robots and robots. I know about super creations from Boston Dynamics, Darpa and the Russian combat robot avatar, it’s more like robots than a box in which some algorithm interacts with the real world.
In the sense of my daughter, robots are at least transformers, and not the eruda that I spend time on. I made a difficult decision and “temporarily” made a robot on a bluetooth-controlled robot.
Management works the same as the snow blower . It turned out to be fun! Especially for dad.
Video with a snow blower
Further more! I was interested in the idea of ​​implementing control not on bluetooth, but via the Internet, with telemetry. Bored, fresh and beaten up idea!
And what if you give an opportunity to any Internet user to control my lawn mower? Do you know such ideas that are then hard to get out of your head? It was just like that ... Challenge accepted!
Crow mower
Iron
Raspberry pi, USB hub, wifi adapter, webcam are neatly added to the magic box. From the interesting moments on the gland. I did not have a driver with the necessary characteristics for the engines. Usually, H-bridge for field-effect transistors or (hardcore) for a relay is used as a driver. I choose a tougher option, because the relays were available.
The usual connection scheme implies 4 keys for each engine, i.e. 8 to 2 running engines.
Given that you can also use the normally open state of the relay, as well as the fact that there is no need to set the motors in motion separately, you can get by with just 5 relays for two running motors.
In addition to the robot itself, a camera is installed on the house, which with a frequency of 3 frames / sec. Uploads an overview photo of the site to the ftp server on the Internet for better orientation. But afterwards I simply replaced it with a solution from ivideon.
Program
As before, the Arduino receives a single-character message over the serial port that indicates the desired action. Also for testing and debugging, the codes received from raspberry are sent via bluetooth, you can connect the phone in terminal mode and receive data from the server also on the phone.
Two python scripts work on raspberry. One of the scripts with the help of opencv captures video from a webcam installed on the rover and uploads it via ftp to the server. Also, with some probability, the photo along with the random message from the list is loaded into the twitter account .
The second http script receives the current command for the action on the server and sends this command by serial to arduino.
"S" - stop
"F" - forward
"B" - back
"L" - left
“R” - right
“W” - enable mowing engines
“W” - turn mowing engines off
"V" - turn on the signal
"V" - turn off the signal
Second script
import serial,time import urllib3 http = urllib3.PoolManager() ser = serial.Serial("/dev/ttyUSB0",9600) ser.writelines("S"); olddata=0 countolddata=0while1 : r = http.request('GET', 'http://mowmylawn.ru/1.php') if r.data!=olddata: olddata=r.data countolddata=0else: countolddata+=1if countolddata>20: ser.writelines("S") else: ser.writelines(r.data) ser.close() con.close
Web service
On the bootstrap I covered the page. The page has two .jpg files that are updated as they are downloaded. There are a lot of factors influencing delays in control and telemetry, this is your connection speed, and the channel on the server, and the channel in my home.
Update code .jpg
<script> setInterval(function(){ var im1='http://mowmylawn.ru/webcam/webcam.jpg?s='+Math.random(); var im2='http://kosmos-podolsk.ru/webc1.jpg?s='+Math.random(); var tmpImg = new Image() ; tmpImg.src = im1 ; tmpImg.onload = function() { $("#w1dd").attr('src',im1 ); } ; tmpImg.src = im2 ; tmpImg.onload = function() { $("#w2dd").attr('src',im2 ); } ; }, 200); </script>
The maximum update rate that I managed to achieve:
rover camera 4 Hz;
camera on the house 3 Hz.
The Mysql database consists of 2 tables, one key / value pair is stored in the first one, this is the command for the robot. The second table is users. When you queue up on the site - ajax get request is sent to add a user, a record is recorded in the database with the timestamp mark, your ip and the generated key for management.
Only one person can drive the mower at a time (except for me) - this is the user with the smallest timestamp. When it is your turn and you start to control the mower - put the timestamp of the start of control into the base, each control is 60 seconds.
Every time when you hover on the control buttons, an ajax get request is sent with the command and your key to control, while checking the difference between the current time and the time when you started the “game”, if the difference is more than 60 seconds, the game ends for you, your recording removed from the base and you can stand in line again, the “game” moves to the next player.
Promo video
Then I think it is necessary to remove it in English ... and then Ostap suffered.
My first post on reddit . Try management mowmylawn.ru . In the case of a large queue or habraeffekt - please understand and forgive.
UPD: I had three problems, two already solved. 1) With too active maneuvers, the power cable for the ~ 27V running engines was disconnected and one of the engines did not move forward. 2) Apparently, the wi-fi adapter burned out due to the same wire 3) A large number of users with GT and reddit first led to a queue of more than 1000 users, then the server crashed. Optimization is our everything!
UPD: I had to replace the arduino and clean the queue. You can try.