The advent of autonomous driving technology has revolutionized the way we approach robotics and automation. This project aims to develop an intelligent ADAS System with Ai and Computer vision for autonomous driving robot using the Kria KR260 Robotics Starter Kit. Leveraging the power of ROS (Robot Operating System) and TensorFlow, the robot is equipped to map its surroundings using LIDAR, plan optimal paths, and detect people, cars, and other objects with AI-based computer vision. This comprehensive system integrates LIDAR and camera sensors.
The AMD KRIA as powerful kit when combined with robot and and AI and ROS togather it can map surrondings using ROS and Hector SLAM able to get it position with respect to surroundings and using AI it able to detect the lane and people , car buces and traffic on road and helps the robot to run Autonomous way or act as a ADAS system for drivers for such robots , CAR etc.
Here the PUNQ , PYHON3, ROS2 , YD LIDAR SDK , OPEN CV is used togather to map surrounding , detet lane , object , people and alll togather makes a powerfull ADAS system for cars and Autonomous vechile helping them in autonolous driving an assistance.
Now open the terminal in KERIA and then install open cv using
sudo apt-get install -y build-essential cmake git pkg-config libgtk-3-dev \ libavcodec-dev libavformat-dev libswscale-dev libv4l-dev libxvidcore-dev libx264-dev \ libjpeg-dev libpng-dev libtiff-dev gfortran openexr libatlas-base-dev python3-dev \ python3-numpy libtbb2 libtbb-dev libdc1394-22-dev
sudo pip3 install opencv-python
Now create the lane detection code using open CV configure the PYNQ and python3 IDE and then oepn the IDE
Testing Lane Detection
Attach the CAmera you can use the AMD KRIA DSI camera from here :-
https://www.amd.com/en/products/system-on-modules/kria/k26/kr260-robotics-starter-kit.html
But if its not aviliable with you then you can also use the USB camera.
Also Install the YD LIDAR PYTHON SDK And LIberary for LIDAR Real TIME Mapping
Refer git clone the SDK https://github.com/YDLIDAR/YDLidar-SDK
Run the SETUP.py
now run the lanedetection.py code
Now caret another python file that open and run both lane detetion and the LIDAR mapping code at a time name this subprocess code as ASDA.py
connect the camera and LIDAR to USB port of AMD KRIA
I have tried a lot to install the tensorflow and object detetion on the board using the terminal but after wasting a lots of time it ends in nothing then I found the tutorial for objectdetetion from this GUY and the it really made my day So rather than giving the step by step guide I suggest you go the link below and follow blindely to the steps told by GUY and install object detection system
Link:- https://community.element14.com/products/roadtest/b/blog/posts/amd-xilinx-kria-kv260-vision-ai-starter-kit-pynq
Prepare ROS environment on AMD KiraStep 2: Install ROS on the Kria KR2601. Update and Upgrade the System
You can follow the instaruction provided here to install the ROS ENV to the KRIA
https://www.hackster.io/whitney-knitter/getting-started-with-krs-ros-2-on-the-kria-kv260-0ba211
For Details about ROS check here :- https://docs.ros.org/en/foxy/Installation.html
First update the ubuntu suing terminal
sudo apt-get update
sudo apt-get upgrade
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
sudo apt update
sudo apt upgrade
sudo apt install -y ros-humble-desktop
sudo apt install ros-humble-gazebo-ros ros-humble-gazebo-plugins ros-humble-gazebo-msgs
Install Gazebogit clone https://github.com/Xilinx/kria_ros_perception
cd kria_ros_perception
rm -rf src/image_proc src/tracetools_image_pipeline src/vitis_common src/tracing src/image_pipeline_examples
Testource install/setup.bash # source the workspace as an overlay
ros2 launch perception_2nodes simulation.launch.py
Install ROS RIVZhttp://wiki.ros.org/rviz/UserGuide
sudo apt-get install ros-humble-rviz
rosrun rviz rviz
Installing Hector SLAMAfter Installing the ROS Installthe Hector Slam To the AMD KRIA .Then Setup the Driver For YD Lidar and ROS Hector Slam using YD LIDAR SDK
This process changes with the LIDAR you are using I am using the YD lidar so it goes the installation process like instructed in the YD LIDAR documentation
https://github.com/YDLIDAR/ydlidar_ros_driver
git clone https://github.com/YDLIDAR/
YDLidar-SDK
cd YDLidar-SDK/build
cmake .
Make sudo make install
Check Github YD-LDR for resources.
Next, create the ROS workspace for the lidar and then install the ROS driver using the following commands in the LXTerminal:
mkdir -p ~/ydlidar_ws/src
cd ~/ydlidar_ws
catkin_make
echo “source ~/ydlidar_ws/devel/setup.
bash” >> ~/.bashrc
source ~/.bashrc
cd ~/ydlidar_ws/src/ydlidar_ros_driver/
startup
sudo chmod +x initenv.sh
sudo sh initenv.sh
Integrating Hector SLAMOpen a new LXTerminal and run the following command to install Hector SLAM:
sudo apt-get install ros-kinetic-hector-
slam
wgethttps://storage.googleapis.com/
google-code-archive-downloads/v2/code.
google.com/tu-darmstadt-ros-pkg/Team_
Hector_MappingBox_RoboCup_2011_Rescue_
Arena.bag
The Hector SLAM is now ready. Modify some lidar settings in the lidar launch file for indoor positioning.
To do so, first, go to the YD lidar workspace and open the src file.
Then open all nodes.launch file and change the parameters as per Fig. 3, which shows configuration of the ROS nodes according to lidar.
Testing Hector SLAM
http://wiki.ros.org/hector_slam
open the the terminal in AMD KERIA then run the command to launch the LIDAR Hector SLAM
Before runningthe roslaunch command make sure to connect the YD Lidar to the the AMD KRIA USB Port The LIAAR have TWO USB One is POWERING and ONE iS C DAPTER PLUG BOTH in AMD KRIA
roslaunch ydlidar_ros_driver all_nodes.launch
After this the it ROS open the LIDAR maping the surroundings and shwoing it position As in Video below
Now to Generate the map and save the enviroment map scanned by lidar for Autonomous ROBOT using the AMD KRIA
Open the Terminal and then run the following
sudo apt-get install ros-noetic-rviz
create Hector SLAM Work SPACE
roslaunch hector_slam_launch tutorial.launch rosbag play Team_Hector_MappingBox_ RoboCup_2011_Rescue_Arena.bag --clock rostopic pub syscommand std_msgs/String “savegeotiff”
Now befor running this make sure the LIDAR is connected to USB port of AMD KRIA board
Now ROS Will open the RIVZ
NOW RUN all the app and your ADAS system for ROBOT is is ready
1. Enhanced Object Detection and Classification: Future developments could involve refining the AI models to improve the accuracy of object detection and classification. This includes better recognition of diverse road conditions, various types of vehicles, and dynamic objects such as pedestrians and cyclists.
2. Real-Time Traffic Management: Expanding the system to include real-time traffic analysis could provide valuable information for autonomous vehicles to make informed decisions based on current traffic conditions, congestion, and road incidents.
3. Integration with V2X (Vehicle-to-Everything) Communication: Integrating V2X communication can enhance the ADAS by allowing the vehicle to interact with other vehicles and infrastructure elements, improving safety and coordination in complex traffic scenarios.
4. Expansion to Different Vehicle Types: While the current project focuses on autonomous robots, similar technology could be adapted for different types of vehicles, including cars, trucks, and buses, providing scalable solutions for various applications.
5. Advanced Path Planning Algorithms: Future improvements could include the development of more sophisticated path planning algorithms that consider dynamic changes in the environment, such as unexpected obstacles or sudden changes in traffic flow.
7. Autonomous Driving in Complex Environments: Advancing the technology to operate in more complex and diverse environments, such as off-road or urban settings with heavy traffic and varied road conditions, could significantly broaden the scope of autonomous driving applications.
8. Integration with Autonomous Fleet Management Systems: Developing systems for managing fleets of autonomous vehicles, including coordination, scheduling, and maintenance, could offer new opportunities for logistics and transportation industries.
Comments