Skip to content

Parking Spot Finding (AI Deep Learning)

Hint

The operating environment and software and hardware configurations are as follows:

  • OriginBot robot(Visual Version/Navigation Version)
  • PC:Ubuntu (≥20.04) + ROS2 (≥Foxy) + pytorch + docker

This function is reprinted from the "Horizon Robotics Platform User Manual",click to view the original content

Apply goals

We can now often see vehicles parking autonomously and finding their own space in the parking garage. Can we implement this feature on OriginBot? Of course, no problem, we can use deep learning for training, and then collect relevant images for training, and we can build a simple application environment. Let's try it out.

Start the robot chassis

After SSH connection to OriginBot, enter the following command in the terminal to start the robot chassis:

$ ros2 launch originbot_bringup originbot.launch.py

Start the OriginBot parking space search function

# Copy the configuration files needed to run the example from the TogetheROS installation path
$ cp -r /opt/tros/lib/parking_perception/config/ .

# Start the launch file
$ ros2 launch parking_search parking_search.launch.py
# Configure the TogetheROS environment
$ source /opt/tros/setup.bash

# Copy the configuration files needed to run the example from the TogetheROS installation path
$ cp -r /opt/tros/lib/parking_perception/config/ .

# Configure the MIPI camera
$ export CAM_TYPE=mipi

# Start the launch file
$ ros2 launch parking_search hobot_parking_search.launch.py

Check the implementation effect

When the OriginBot searches for progress in the driving area, the X3 board terminal outputs log information, in which the OriginBot is controlled to move forward at a speed of 0.1m/s

cap1

When the OriginBot turns after discovering the parking space, it runs on the X3 board and outputs log information

cap2

After determining the parking space, the OriginBot moves forward and finally stops when it runs at the end of the X3 board

cap3

Introduction to the principle

The principle here is similar to the previous AI deep learning training, and it is divided into the following steps.

  • Problem definition:What is the problem we are trying to solve? For example, in the case of visual line patrol here, it is necessary to identify the position of the line in the image.
  • Data preparation:Start preparing your data for the problem you want to solve. For example, you need to prepare photos of various line patrol scenes for machine learning.
  • Model selection/development:A model is a set of processes for processing data, which is often referred to as CNN convolutional neural networks, GAN generative adversarial networks, RNN recurrent neural networks, and so on.
  • Model training and tuning:Putting data into the model and training the optimal parameters can be understood as the process of machine learning.
  • Model evaluation test:Just like a quiz, we take some data and give it to the trained model to see how it works.
  • Deployment:After everything is ready, you can put the trained model on the robot, that is, officially transfer the knowledge to a certain robot, and it can solve the problem raised earlier.

You can learn according to the code on OriginBot.

图片1