In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-07 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article introduces how to analyze the lidar obstacle avoidance car based on RT-Thread, the content is very detailed, interested friends can refer to, hope to be helpful to you.
Background description
Because there are few opportunities for me to put what I have learned into practice at school. Sometimes you can't really know whether you master it or not after learning something, and at the same time, in order to further improve your ability, you will no longer study aimlessly. So I decided to make such a car. The PCB schematic diagram and the first version of PCB_layout were completed at home during the winter vacation, and the program was written based on rt-thread [BSP] stm32f429-Apollo. It lasted for more than 3 months. This car can be said to be made while learning, especially about rt-thread. I was helped by a lot of people in the RTT community during my rt-thread study. Special thanks to the RTT open source community.
The role of RT-Thread
As the real-time system of the main control chip, it provides multi-thread programming. Each important function of the car requires real-time functions as a separate thread. For example, the process of calculating the attitude angle (Roll, Pitch, Yaw) of the car's mpu9250 attitude uses a separate thread (mpu9250), and the car's PID code for controlling speed also uses a separate thread (speed). Each functional thread (mpu9250,speed... The results will be obtained after processing the respective data, and these results will be provided to the main thread (master) if necessary. It is precisely because of rt-thread 's priority preemptive scheduling that important threads can be processed in time. In addition, the finsh/msh provided by rt-thread plays an important role during debugging, and the behavior of the car can be controlled through the remote Bluetooth serial port.
Physical drawing
Main control chip: STM32F429IGT6
Other main accessories: lidar, Bluetooth serial port, RF module, MPU9250 nine-axis attitude module, motor driver chip l298n. Two motors with AB phase encoders. A pair of tracks.
Compilation environment: MDK525
RT-Thread version: 3.0.2
Hardware design
Lidar controls rotational speed through serial communication and pwm.
The RF module communicates through uart6. Events that use rt-thread notify the arrival of the message.
Bluetooth serial port, as the output of msh terminal. Easy to debug.
The mpu9250 module communicates through I 2C.
Software design
The master thread is responsible for creating other child threads and processing the information processed by each sub-thread.
The eaix4 thread controls the messages uploaded by the lidar to the message queue and parses the lidar version information, status, and scanning data.
The mpu9250 thread calculates the attitude angle (Roll, Pitch, Yaw) through the dmp posture.
The speed thread collects stm429's own encoder and pwm output, and PID controls the motor speed.
Several main command functions eaix4cmd-gvf output lidar version information. Eaix4cmd-sc car starts scanning and starts obstacle avoidance function. Eaix4cmd-s lidar stops scanning, but does not stop. CarMove-f car forward. CarMove-b car back. CarMove-l car turn left. CarMove-r car turn right. Operation demonstration GIF
On how to analyze the lidar obstacle avoidance car based on RT-Thread to share here, I hope the above content can be of some help to you, can learn more knowledge. If you think the article is good, you can share it for more people to see.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.