-
As a surveillance camera while charging.
4 hours ago • 0 commentsIt is now possible to monitor people and animals while charging.
When a person or animal is detected, a notification with an image is sent to a messaging application. (Currently, the system is compatible with LINE, a popular messaging application in Japan.)
Detectable objects are as follows.Person Monitoring Mode
- Person
Animal Monitoring Modes
- bear
- deer
- monkey
- boar
- badger
- cat
- civet
- dog
- fox
- hare
- mice
- racoon
- squirrel
I am excited about the many things we can do by preparing learned models as needed. I would like to add functions such as a simple patrol robot.
-
Digit OCR Mowing
5 days ago • 0 commentsRoktrack can basically mow the weed with just a pylon(traffic cone). However, if the pylon happens to be on the neighbor's house, or if a truck happens to be passing by with a pylon on it, the mower will head in that direction. Digit OCR was designed to address these issues. To achieve this additional functionality, all that is needed is to attach a piece of paper with a single digit number printed on it to the pylon. The robot identifies individual pylons by recognizing this number. This means that it can select the pylon it should aim for among the pylons in its field of vision. This inhibits unexpected movements.
Why OCR? Generally, AR markers and QR codes are used for robotic applications. To use these, it is important to be able to detect edges. However, in reality, the edges of markers are blurred when trying to detect them from a distance of 10m or more. I have come to the conclusion that it is difficult to identify a marker from a distance of more than 10 meters with a wide-angle camera. In order to detect objects with blurred details, object detection, which can use more ambiguous features, was suitable. In order to increase the detection distance and speed up the processing, the following is processed.
The image is captured by the camera at the highest resolution. The resolution of that image is then reduced to perform inference in the pylon model. The detection content is normalized and the corresponding portion of the original highest resolution is extracted. The extracted part is then inferred by the Digit OCR model with a resolution of 96*96 to identify what numbers are pasted on the pylon. And since the existing OCR model for transcribing text takes several seconds to infer, I created a very simple custom model that can collect images of numbers and detect only the digits 0-9.
-
Weather resistance
5 days ago • 0 commentsRainproof
L-shaped angles are affixed downward to the top panel to prevent rain from the upper direction. At the rear of the body are components that should not be wetted by water, such as air intakes, power switches, and charging connectors. On a strong rainy day, the splash guard protects them from being hit on the ground and bouncing rain on these. To prevent insect infestation, sponge tape is applied to the tops of the front, rear, and side panels to make them airtight.
Against condensation
If the robot is left outdoors, condensation will form inside the robot in the morning on days with large temperature differences. When charcoal is placed inside, the charcoal absorbs excess moisture and condensation no longer occurs.
-
Released a weed cutting program written in Rust.
09/13/2023 at 12:44 • 0 commentsI 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.
-
MagPi issue #133 showcase Roktrack
08/31/2023 at 13:23 • 0 commentsRoktrack was featured in The MagPi magazine! I would be happy if you could check it out. I am very grateful to the MagPi's writers and editor for the great article and to the Hackaday platform for providing me with this opportunity.
https://magpi.raspberrypi.com/articles/the-magpi-magazine-issue-133
-
How to store persistent data on a read-only SD card.
08/24/2023 at 21:25 • 0 commentsWhen using the Raspberry Pi in an embedded system, make the SD card read-only to prevent system corruption. In this case, data such as logs and images cannot be stored. In this article, I will show you how to save data to this SD card.
Create a file system for data
Plug the SD card into a desktop Linux machine separate from the Raspberry Pi. unmount, resize, and shrink the root file system using Gnome Disks or similar. This will create a free space, so create a file system in that area with FAT.
Auto mount setting
After returning the sd card to the raspberry pi, edit /etc/fstab and set the file system for data to be mounted automatically.
pi@roktrack1:~ $ cat /etc/fstab proc /proc proc defaults 0 0 PARTUUID=dc22932d-01 /boot vfat defaults 0 2 PARTUUID=dc22932d-02 / ext4 defaults,noatime 0 1 # a swapfile is not a swap partition, no line here # use dphys-swapfile swap[on|off] for that PARTUUID=dc22932d-03 /data vfat auto,exec,umask=000 0 1
Add the last line of the above configuration to your fstab. When you do so, modify PARTUUID to the ID of your environment. You have now created a persitent area on your read-only Raspberry Pi.
Convert to read-only
sudo raspi-config nonint enable_overlayfs sudo systemctl reboot
After several dozen power-off tests, the system area was not corrupted and did not become unbootable. Files in the file system for data may be corrupted, but even partial corruption of data such as logs and images will have only localized effects.
-
Why is the camera high-mounted?
08/21/2023 at 17:52 • 0 commentsUnlike ordinary robotic mowers and robotic cleaners, Roktrack is equipped with a camera mounted quite high. There are two reasons for this.
Higher than weeds
Due to the nature of this mower, which aims at pylons and advances toward them, it is impossible to work without seeing the pylons. The camera needs to be high-mounted to ensure visibility above the height of the weeds.
Recognition rate of object detection
In my prototypes, the higher the camera mount, the more distant objects tended to be detected by object detection. This is despite the fact that the images for the training data were taken with a low mount. In my experiments, I was able to detect objects quite far away when the camera was raised to about person's eye level, but I settled on the current height of about 50 cm due to the need for portability.
-
Converted to aluminum sheet metal.
06/28/2023 at 05:37 • 0 commentsOriginally, the chassis of the Roktrack was made of aluminum composite plate, but it was not strong enough, and the motor mounting points were sometimes tilted. Above all, it was very difficult to drill many holes by hand.
Then we received an offer from PCBWay. It was my first time to use a sheet metal service, but all I had to do was send them a dxf file and they sent me a precisely machined 2mm aluminum sheet.
Unlike manual machining, the motors and other components were accurately installed in one shot, and the parts did not deflect or tilt under load. Compared to the aluminum composite sheets we have used in the past, the reliability has increased overwhelmingly.
My first experience with sheet metal in my life ended in success. We plan to increase production in the future and are considering using sheet metal services instead of hand fabrication.
-
Expand the available memory area of RPi3A+ made read-only.
06/27/2023 at 14:01 • 0 commentsThe RPi3A+, which has been converted to readonly, by default has only about 180 MB of memory available for applications, which tends to be a bit insufficient for running heavy applications.
This log describes how to allocate more memory on RPi3A+ in readonly state.
It is assumed to run offline and headless with Raspberry pi OS 64bit Lite.
1. Reduce the area allocated as overlay. By default, half of the total memory is allocated, but for readonly applications, the write area is not that necessary, so we will reduce it to 100MB. Modify "/usr/bin/raspi-config".
- mount -t tmpfs tmpfs /upper + mount -t tmpfs -o size=100M tmpfs /upper
2. If swap is not disabled, the overlay area will be occupied by the swap file (/var/swap) when readonly is enabled. The default setting is 100MB, so 100MB of valuable overlay area will be wasted.
sudo sed -i -e "s/^CONF_SWAPSIZE=.*/CONF_SWAPSIZE=0/g" /etc/dphys-swapfile
3. gpu memory is not needed for headless operation, so it is reduced to the limit.
sudo raspi-config nonint do_memory_split 16
4. make it read-only.
sudo raspi-config nonint enable_overlayfs sudo systemctl reboot
In this way, the available memory of the RPi3A+ will increase from 181MB->339MB and the writable area of the Overlay will be the same, from 89M->88M.