I set a specific target distance and allowed only a small angular variation between the camera and the AprilTag.
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
Calibration board: Checkerboard-A3-40mm-9x6.pdf
You will get the result like the following image:
cd Desktop/
git clone https://github.com/Tinker-Twins/AprilTag.git
cd ~/Desktop/AprilTag/scripts
cd ~/Desktop/AprilTag
chmod +x ./install.sh
cd ~/Desktop/AprilTag
./install.sh
python3 AprilTag_Detection.py
cd ~/Desktop/Turtlebot_Calibration_AprilTag_LQR/On_PC
python3 controller.py
https://youtu.be/kR-14hI1RDw?si=alJUMj2gG6VjIJ3s
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