Nhiệm vụ phần mềm:
Bài 1: Cài đặt UBUNTU 26.04 LTS https://releases.ubuntu.com/ và ROS 2 Lyrical Luth https://www.ros.org/
Các bạn chụp ảnh màn hình máy tính đã chạy ubuntu và ROS Version nộp lên Team
Cài đặt hệ điều hành Ubuntu bản Stable mới nhất:
https://releases.ubuntu.com/
https://ubuntuhandbook.org/index.php/2022/04/install-ubuntu-2204-step-by-step/
Chọn Step 5: Manually create system partition để tạo partition cài Ubuntu song song với window, hay ubuntu bản cũ hơn
Tạo USB để boot cài Ubuntu :
https://linux.how2shout.com/how-to-create-ubuntu-22-04-bootable-usb-drive-on-windows/
2. Cài đặt hệ điều hành ROS2:
https://docs.ros.org/en/lyrical/
Tạo thư mục cho các dự án ROS
http://wiki.ros.org/catkin/Tutorials/create_a_workspace
Kiểm tra phiên bản Ubuntu
~$lsb_release -a
ROS: ~$ rosversion -d
Chụp ảnh màn hình hiện thị rosversion gửi vào team
Bài 2: Tự học các bài cơ bản Beginer level trong ROS2 https://docs.ros.org/en/jazzy/Tutorials.html
Học bài Beginner: CLI tools , Beginner: Client libraries
https://docs.ros.org/en/jazzy/Tutorials.html
Các bạn chụp ảnh màn hình máy tính đã chạy thành công ít nhất 3 bài và nộp lên Team
Bài 3: Cài đặt và chạy Turtle bot simulation https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/#gazebo-simulation
Các bạn chụp ảnh màn hình máy tính đã chạy được chương trình vào nộp lên microsoft team.:
Tham khảo hướng dẫn gốc: https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/#gazebo-simulation
Homework 4: Run bosh mobility challenge simulator 2024
Step 1 :
$ mkdir -p ~/catkin_ws/src // Or nameyourworkspace_ws
$ cd ~/catkin_ws/src
Download Simulator folder from google drive and copy to ~/catkin_ws/src /:
https://drive.google.com/drive/folders/1Y4YTGSxzGTCXdKqHomPSifgLwRHjYLqq?usp=sharing
catkin_ws$ catkin_make // Compile the program
B2: Edit file use command: gedit ~/.bashrc
Include two GAZEBO và MODEL ROS path as follow with address is your computer path "/home/bblab7490/Documents/02_BFMC_Challenge/" by right click on folder of your catkin_ws:
export GAZEBO_MODEL_PATH="/home/bblab7490/Documents/02_BFMC_Challenge/catkin_ws/src/Simulator/models_pkg:$GAZEBO_MODEL_PATH"
export ROS_PACKAGE_PATH="/home/bblab7490/Documents/02_BFMC_Challenge/catkin_ws/src/Simulator:$ROS_PACKAGE_PATH"
Check result by command :
echo $ROS_PACKAGE_PATH // show ros path
/opt/ros/noetic/share
echo $GAZEBO_MODEL_PATH // show model path
/home/bblab7490/Documents/02_BFMC_Challenge/catkin_ws/src/Simulator/models_pkg:
Step 2.1: Edit file : catkin_ws/src/Simulator/models_pkg/track/materials/scripts/bfmc_track.material
Change texture_unit to like this:
texture_unit
{
texture 2021_VerySmall.png
}
Step 3:
Terminal 1:
source devel/setup.bash
roslaunch sim_pkg map_with_all_objects.launch
// Or roslaunch sim_pkg map_with_car.launch // Simple car only
Terminal 2:
source devel/setup.bash
rosrun example camera.py
Terminal 3:
Download file : Lane navigation.. va DeepPiCar... from google drive:
https://drive.google.com/drive/folders/1Y4YTGSxzGTCXdKqHomPSifgLwRHjYLqq?usp=sharing
copy 2 file bblab_lane_navigation.py and basic_lane_navigation.py to folder catkin_ws/src/Simulator/example/src
Run command:
rosrun example basic_lane_navigation.py
If error pynput :
$sudo pip3 install pynput
If you want to reset simulator in Gazebo, Click on simulator and use Ctrl+R
Bài 5: Điều khiển Xe từ máy khách client
Mở 1 terminal chạy các lệnh sau:
ifconfig // Kiem tra ip vi du hien la inet 192.168.10.102
echo $ROS_IP // Kiểm tra biến tham số ROS đã cài chưa
export ROS_IP=$(hostname -I | awk '{print $1;}')
export ROS_HOSTNAME=$ROS_IP
export ROS_MASTER_URI=http://192.168.10.102:11311
Kiem tra ket noi:
ping 192.168.10.102 Co ket noi la ok
64 bytes from 192.168.10.102: icmp_seq=1 ttl=64 time=0.031 ms
rostopic list
Chạy thử xe:
rostopic pub /automobile/command std_msgs/String "data: '{\"action\": \"1\", \"speed\": 0.09}'"
rostopic pub /automobile/command std_msgs/String "data: '{\"action\": \"1\", \"speed\": 0.00}'"
Bài 6: Tu lap trinh xe chay theo lan duong "Lane navigation"
Tai file huong dan: Lane navigation.. va DeepPiCar... tu google drive:
https://drive.google.com/drive/folders/1Y4YTGSxzGTCXdKqHomPSifgLwRHjYLqq?usp=sharing
Tao file chuong trinh Python de xe tu dong chay theo lan duong.
Vi du mau:
copy 2 file bblab_lane_navigation.py va basic_lane_navigation.py vao thu muc catkin_ws/src/Simulator/example/src
O Bai 4, B3, Terminal 3 chay lenh:
rosrun example basic_lane_navigation.py
Tham khao:
De chay chuong trinh mau
https://github.com/dctian/DeepPiCar
Tim hieu code xe tu lai
https://colab.research.google.com/github/EdjeElectronics/TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi/blob/master/Train_TFLite2_Object_Detction_Model.ipynb
https://www.youtube.com/watch?v=sOPgdIMUC0Y&ab_channel=WaabiAI
https://github.com/qiaoxu123/Self-Driving-Cars/tree/master
echo $ROS_IP // Kiểm tra biến tham số ROS đã cài chưa
export ROS_IP=$(hostname -I | awk '{print $1;}')
export ROS_HOSTNAME=$ROS_IP
export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311
$ rostopic info /automobile/command
rostopic pub /automobile/command std_msgs/String "data: '{\"action\": \"1\", \"speed\": 0.09}'"
rostopic pub /automobile/command std_msgs/String "data: '{\"action\": \"1\", \"speed\": 0.00}'"
Kiem tra tin hieu duoc gui chua :
rostopic echo /automobile/command
Bài 6B:
Sua file : control.py
Thay dia chi 2 dong: /home/bblab7490/Documents/02_BFMC_Challenge/catkin_ws/src/Simulator Thanh dia chi folder o may cua ban:
Line 345 346:
PATH_TO_MODEL = '/home/bblab7490/Documents/02_BFMC_Challenge/catkin_ws/src/Simulator/example/src/detect.tflite'
PATH_TO_LABELS = '/home/bblab7490/Documents/02_BFMC_Challenge/catkin_ws/src/Simulator/example/src/labelmap.txt'
Sau do:
source devel/setup.bash
rosrun examplecontrol.py
Ghi chu:
Neu bao loi thieu thu vien tensorflow :
$ pip install tensorflow==2.8.0
May nao chua co Pip cai dat theo google keywords
How to install pip ubuntu
Tham khảo:
THam khao ban goc : ~/catkin_ws/src$ git clone https://github.com/ECC-BFMC/Simulator.git
https://bosch-future-mobility-challenge-documentation.readthedocs-hosted.com/data/simulator.html
https://automaticaddison.com/how-to-launch-the-turtlebot3-simulation-with-ros/
https://emanual.robotis.com/docs/en/platform/turtlebot3/simulation/
https://emanual.robotis.com/docs/en/platform/turtlebot3/nav_simulation/
https://github.com/ROBOTIS-GIT/turtlebot3.git
Bài 7:
https://colab.research.google.com/github/EdjeElectronics/TensorFlow-Lite-Object-Detection-on-Android-and-Raspberry-Pi/blob/master/Train_TFLite2_Object_Detction_Model.ipynb
Phu luc cho may chu:
echo $ROS_IP // Kiểm tra biến tham số ROS đã cài chưa
export ROS_IP=$(hostname -I | awk '{print $1;}')
export ROS_HOSTNAME=$ROS_IP
export ROS_MASTER_URI=http://$ROS_HOSTNAME:11311
$ rostopic info /automobile/command
rostopic pub /automobile/command std_msgs/String "data: '{\"action\": \"1\", \"speed\": 0.09}'"
rostopic pub /automobile/command std_msgs/String "data: '{\"action\": \"1\", \"speed\": 0.00}'"
Kiem tra tin hieu duoc gui chua :
rostopic echo /automobile/command
Bài 8: Tìm hiểu các thuật toán tìm kiếm path planning
https://github.com/RuslanAgishev/motion_planning
Tìm hiểu chỉnh sửa code
Làm bài tập HW 1,2,3
TIm hieu thuat toan A*
https://www.youtube.com/watch?v=-L-WgKMFuhE&t=146s&ab_channel=SebastianLague
Tìm hiểu thuật toán RRT, RRT *
https://www.youtube.com/watch?v=Ob3BIJkQJEw&ab_channel=AaronBecker
Bài 9: Chạy thuật toán tìm kiếm RRT
https://github.com/mech0ctopus/rrt-global-planner
http://wiki.ros.org/navigation/Tutorials/Writing%20A%20Global%20Path%20Planner%20As%20Plugin%20in%20ROS