ME4512 Autonomous Mobile Robot

ME4512 Autonomous Mobile Robot - Robot tự hành

Sáng Thứ 6, Tiết 1-3, 6h45- 8h55 , Mã lớp học trên team:   Teamcode :  mg3n25c

Giáo trình: 

Introduction to Autonomous Mobile Robots, 2004. Roland Siegwart and Illah R. Nourbakhsh

Tài liệu bài giảng tiếng anh:

https://asl.ethz.ch/education/lectures/autonomous_mobile_robots/spring-2020.html

Link tải full google drive: 

https://drive.google.com/drive/folders/1NZaiy-0S4KbtwfU9n9dsiQTA5Hlh65i9?usp=sharing

Bài Tập theo tài liệu bài giảng slide tiếng anh ở trên:

Các bạn copy code file matlab hoặc chụp ảnh minh chứng và nộp  lên  Assignment microsoft team.

Bài 1: Cài đặt Phần mềm mô phòng, chạy test trên Matlab

Tài liệu https://asl.ethz.ch/education/lectures/autonomous_mobile_robots/spring-2020.html

Ex1 25.02.2020   Introduction to V-​Rep Simulator

Exercise 1 (ZIP, 3.3 MB) K. Bodie, L. Schmid

Bài 2:   Giải động học và điều khiển robot Kinematics & Control of a Differential Drive Vehicle

Các bạn copy code file matlab vào nộp  lên  microsoft team.

.....

Project cuối kỳ:  

Làm sản phẩm tham gia một trong các cuộc thi sau

UET MAKERTHON 2023 Xe dò line

https://sites.google.com/view/hustroboticsclub/projects/8-mcr-microcontroller-car-rally

HUST ROBOT ARENA 𝟐𝟎𝟐3 Đấu trường robot

https://www.facebook.com/hustrobotarena/posts/pfbid0wHRnaVR71Wdj7rBvm8tQzr2zFf4rHFahoEstaSuDnUU2LmWqXq5694UqY9wsQhaWl

BEST PROJECT 2023: MICROMOUSE

https://sites.google.com/view/hustroboticsclub/projects/7-micromouse-contest

(Nhóm từ 2-5 thành viên (không nhiều hơn 5, không ít hơn 2, bạn nào lẻ phải chủ động tự tìm nhóm để ghép vào):

Các bạn tải file lên Link Google Drive Folder trong đó  cha thuyết minh đồ án, bản vẽ, code lập trình, video chạy thực tế, ....

Chú ý: Đặt tên file hay folder HọTên_MSSV  ví dụ, NguyenVanA_20180012

            Độ dài: 8 - 10 trang, Có trang phân công nhiệm vụ từng thành viên của nhóm.

NHỚ BẬT CHẾ ĐỘ SHARE  sau đó chia sẻ link lên Google sheet sau:

Sáng Thứ 6, Tiết 1-3, 6h45-8h55  DANH SÁCH ĐỘI ĐĂNG KÝ THI ĐẤU

Đăng ký Chia nhóm làm project cuối kỳ theo link sheet: 

https://docs.google.com/spreadsheets/d/1EcUG33_Wsr9dEmWTwocUOlbld3b917rKTBNpqeKvpaY/edit?usp=sharing

Mẫu báo cáo cuối kỳ:

https://docs.google.com/document/d/1JDUE5Kima3DLZJdCL-pFhql79XD1H6R4n0R3FZappww/edit?usp=sharing

Mẫu Slide: 

2. Yêu cầu

- Tiểu luận báo cáo  8-10  trang  (nộp) 

+ Giới thiệu đề tài 

+ Phương pháp giải quyết vấn đề

+ Các kết quả đạt được

+ Kết luận 

3. Tính điểm

-  Đăng  ký tham gia Projects  ( Trung bình 5)  

-  Có cố gắng chế tạo robot nhưng chưa chạy được(Trung bình 8)  

-  Có robot tham gia thi đấu ( Trung bình 8.5)  

-  Top 8 được ( Trung bình 10) 

-  Xếp thứ 8 -16 ( Trung bình 9,5)   

-  Xếp thứ 17 -trở xuống ( Trung bình 9)  

Giữa kỳ: Kiểm tra tiến độ hoàn thành Projects 

I. Bài Tập thực hành môn học:

Các bạn copy code file matlab hoặc chụp ảnh minh chứng và nộp  lên  Assignment microsoft team. 

Chú ý: Đặt tên file hay folder HọTên_MSSV  ví dụ, NguyenVanA_20180012

Hướng dẫn cài đặt:

https://sites.google.com/view/bblab/teaching/me5621_mobilerobotcontrol


Bài 1:  Cài đặt UBUNTU và ROS 2

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


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

 2. Cài đặt hệ điều hành ROS2 humble:

https://docs.ros.org/en/humble/

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

Nếu hiện noetic thì chạy lệnh như ở dưới, nếu khác ví dụ melodic thì thay từ noetic -> melodic

Cài đặt ros controller :

sudo apt-get install ros-noetic-ros-control ros-noetic-ros-controllers


Bài2:  Tự học các bài cơ bản Beginer level trong ROS2

Học bài Beginner: CLI tools , Beginner: Client libraries

https://docs.ros.org/en/iron/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 trong 21 bài trên và nộp lên Team


Bài 3:

I. Chạy mô phỏng robot trên Ros2 : 

https://automaticaddison.com/how-to-simulate-a-robot-using-gazebo-and-ros-2/

Tới đoạn chạy code: 

colcon build --packages-select warehouse_robot_spawner_pkg

cd ~/dev_ws/

Cần khai báo package cho ros biết bằng lệnh:

source install/setup.bash

Type the following command để chạy mô phỏng trên máy của các bạn. 

Terminal 1:  ros2 launch warehouse_robot_spawner_pkg gazebo_world.launch.py

Terminal 2:  ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap /cmd_vel:=/demo/cmd_vel

II. Chạy điều khiển robot mô phỏng trên máy chủ thầy Bá: 

Step1: Kiểm tra ROS_DOMAIN_ID bang lệnh: 

printenv | grep ROS

Hiện lên: 

ROS_VERSION=2

ROS_PYTHON_VERSION=3

ROS_DOMAIN_ID=88

ROS_LOCALHOST_ONLY=0

ROS_DISTRO=humble


Nếu ROS_DOMAIN_ID=0 thì cần đổi lại 88 cùng ID với máy thầy

export ROS_DOMAIN_ID=88

hoặc dùng lệnh : echo "export ROS_DOMAIN_ID=<your_domain_id>" >> ~/.bashrc

Step2:  Kiểm tra IP cần có 2 số đầu là 10.13

~$ hostname -I

10.13.xxx.xxx 


Sau đó: 

Check connection: 

$ ping 10.13.82.107 

PING 192.168.43.56 (192.168.43.56) 56(84) bytes of data.

64 bytes from 192.168.43.56: icmp_seq=1 ttl=64 time=128 ms

64 bytes from 192.168.43.56: icmp_seq=2 ttl=64 time=136 ms



Step3: 

Kiểm tra kết nối tới máy thầy Bá bằng lệnh hiện các topic

bblab2204@bblab2204:~$ ros2 topic list

/clock

/demo/laser/out

/demo/odom

/demo_nhom1/laser/out

/demo_nhom1/odom

/demo_nhom10/laser/out

/demo_nhom10/odom

/demo_nhom2/laser/out

/demo_nhom2/odom

......

Nếu lỗi không hiện topic cần restart lại ros2 daemon

$ ss -tulw

$ ros2 daemon stop $ ros2 daemon start


Các bạn chạy máy ảo thiết lập trong Virtual machine: 

menu/ edit/ Networksetting -> Advanced setting : Bridge network   : VmA0

In Ubuntu machine file: Select connect to VmA0

Set manual IP in Ubuntu system: 

IP4   Manual   Adress 10.13.82.xxx    Netmask 255.255.255.0


Lỗi gazebo chưa tắt hoàn toàn khi dùng Ctl + Z

~/ros2_ws$ ps aux | grep gzserver

~/kill -2 <pid associated with gzserver>


Step 4: Chạy điều khiển robot của nhóm: 

~$ros2 run teleop_twist_keyboard teleop_twist_keyboard --ros-args --remap /cmd_vel:=/demo_nhomx/cmd_vel 

dùng nút X và C để giảm tốc độ xuống  0.1  và góc quay xuống 0.1


Kiểm tra đã gửi tín hiệu bằng lệnh: 

rbblab2204@bblab2204:~/ros2_ws$ ros2 topic echo /demo_nhom1/cmd_vel 

linear:

  x: 0.0

  y: 0.0

  z: 0.0

angular:

  x: 0.0

  y: 0.0

  z: 0.0

---




Bài 4:

Chạy mô phỏng robot trên Ros2 : 


https://docs.ros.org/en/iron/Tutorials/Intermediate/URDF/Using-URDF-with-Robot-State-Publisher.html


mkdir -p ~/second_ros2_ws/src  # change as needed

cd ~/second_ros2_ws/src

git clone https://github.com/benbongalon/ros2-urdf-tutorial.git

cd ~/second_ros2_ws

Bạn nào báo lỗi thiếu package thì chạy lệnh sau để tự động cài package còn thiếu: 

sudo apt-get -y install python3-rosdep2

Chạy rosdep init 

rosdep install --from-paths src --ignore-src -r -y

https://installati.one/install-python3-rosdep2-ubuntu-22-04/

colcon build 

source install/setup.bash

Terminal 1: ros2 launch urdf_tutorial demo.launch.py

Terminal 2:  rviz2 -d ~/third_ros2_ws/src/ros2-urdf-tutorial/urdf_tutorial/urdf/r2d2.rviz


Bài 5: Chạy mô phỏng micromouse trên gazebo


https://github.com/KalyaniKasar1/Micromouse-Eklavya


Một số mô hình xe tự hành dùng Omni Wheel 

2. 3WD Triangular 100mm omni wheel mobile robotics car C003

3. 4WD Omni Wheel Arduino Robot Car C008

4. 3WD Omni Wheel Arduino Robot Car C008

Một số mô hình xe tự hành  2 bánh

1. Autonomous mobile platform with vacuum cleaning 

2. Autonomous mobile platform with vacuum cleaning