I have released a program that allows you to cut the grass by simply placing pylons.
Please refer to README.md on github or BUILD INSTRUCTIONS on this project page for installation instructions.
Features
In addition to the mode to fill in polygons surrounded by pylons, the following modes are implemented.
- Follow the pylons in a straight line
- A mode to move back and forth between people and pylons.
- Continuously tracking a person
- Surveillance camera mode to detect person
- Surveillance camera mode to detect 13 types of animals
Switch from Python to Rust
This project primarily uses the Rapsberry Pi 3A+. However, when I tried to load multiple models for object detection to make it more versatile, the memory was running out and I was approaching the limit. So I took a leap of faith and ported the program to Rust, and the memory usage was reduced to less than half!!! Now I can add further functionality with adding an image recognition model, etc. However, compiling Rust is either incredibly slow or impossible on the Rapsberry Pi3A+, which has little memory. So when developing, you can use a Raspberry Pi4B (which is also quite slow) or run Ubuntu 20.04 on an AWS Graviton instance (t4g) and compile to increase your development efficiency. Since both Raspberry Pi 64bit and AWS Graviton are aarch64 architecture, you can use them as they are by copying the binaries. Maybe M1 Mac can compile it (I don't have it, so I haven't been able to verify).
Unanticipated improvements
Elimination of slowdown during long runs
In the Python version, after about 30 minutes of mowing, the object detection speed started to slow down. The Rust version keeps the same speed as the startup, even after running for more than an hour.
PWM malfunction where Wifi is unstable
When running the Python (gpiozero or pigpio) version of the program in a place with an unstable Wifi connection, the PWM malfunctioned and the Pin was always HIGH. This was causing serious problems, such as the robot falling down a cliff and breaking. So until now, I have been using the robot offline with the Wifi function disabled. However, when I ran the Rust (rppal) version under the same environment, that did not happen. Now I can have a Wifi connection during operation. I have to consider new features due to this new possibility.
Discussions
Become a Hackaday.io Member
Create an account to leave a comment. Already have an account? Log In.