Skip to content

Calibrate the position of Turtlebot by using LQR control and AprilTag

Notifications You must be signed in to change notification settings

StanleyChueh/Turtlebot_Calibration_AprilTag_LQR

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Robot calibration by LQR control

I set a specific target distance and allowed only a small angular variation between the camera and the AprilTag.

Step1

1. Run calibration.py in Camera_Calibration folder to get the camera parameters for AprilTag detection.

cd Desktop/
git clone https://github.com/StanleyChueh/Turtlebot_Calibration_AprilTag_LQR.git
cd Turtlebot_Calibration_AprilTag_LQR/
cd Camera_Calibration/
python3 calibration.py 

use the following board to calibrate:


Calibration board: Checkerboard-A3-40mm-9x6.pdf
You will get the result like the following image: Screenshot from 2024-04-20 15-15-47

Step2

1. git clone

cd Desktop/
git clone https://github.com/Tinker-Twins/AprilTag.git

2. Place this script(On_Raspberry_Pi/AprilTag_Detection.py) in this directory

cd ~/Desktop/AprilTag/scripts

3. Make it executable

cd ~/Desktop/AprilTag
chmod +x ./install.sh

4. Run it

 cd ~/Desktop/AprilTag
 ./install.sh

5. Run AprilTag detection script

python3 AprilTag_Detection.py

6. You will see this result like the following images:


Screenshot from 2024-04-20 15-37-19
Screenshot from 2024-04-20 15-37-39

notice: Run this script on Raspberry pi for real world testing(ssh -X ubuntu@ip)

Step3

cd ~/Desktop/Turtlebot_Calibration_AprilTag_LQR/On_PC
python3 controller.py

make sure running controller.py and AprilTag_Detection.py at the same time

Demo

Screenshot from 2024-04-20 16-18-16

Following are the videos of different angle.

1.https://youtube.com/shorts/0O0KmvSdWzU?si=QNJmLeCMe7fS9b95
2.https://youtube.com/shorts/TNQPaHkxuaM?si=CKUKYXBqYaNOFerX
3.https://youtube.com/shorts/TcjzHa8okXQ?si=dLZovFBaN9nTNmqJ

Reference

AprilTag detection: https://github.com/Tinker-Twins/AprilTag
Turtlebot: https://emanual.robotis.com/docs/en/platform/turtlebot3/overview/
ROS2 Foxy: https://docs.ros.org/en/foxy/Installation.html
LQR_Control: https://automaticaddison.com/linear-quadratic-regulator-lqr-with-python-code-example/#Conclusion

About

Calibrate the position of Turtlebot by using LQR control and AprilTag

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages