The goal of this project is to quickly build an accurate (calibration-free) localization system in indoor medium & large-scale scenarios.
In the project, we define the 0th Tag as the base tag for each Tag family. The output pose is related to the base tag. Thus, we use the method of common view to construct a series of April tag pose associations. After that, we will use the available tag in each frame to calculate the global camera pose and finish the localization task.
The whole system consists of two parts: the Tag Generator module & the Localization module.
-
The Tag Generator module will get tag information (Tag Family, Tag Size / Tag print PPI, Extend Dot size/position) from the YAML file and generate a Tag image with Extend dot.
-
The localization module will get information (Tag info, Camera Intrinsic parameter/Distortion coefficient, Tag pre-calibration pose) from the YAML file and do the localization task. Finally, the output should be the camera pose related to the base tag.
Raspberry pi 3, 3b, 3b+, 4, Zero 2W
Raspberry pi Os 32bit LTS With Legacy Camera API
- AprilTag
- Yaml-cpp
- Glog
- Ceres
- Opencv4
- Eigen3
sudo apt install -y libyaml-cpp-dev libgoogle-glog-dev libeigen3-dev libceres-dev
sudo apt install -y libopencv-dev git cmake
mkdir 3rdparty && cd 3rdparty
git clone https://github.com/AprilRobotics/apriltag && cd apriltag
cmake -B build -DCMAKE_BUILD_TYPE=Release
sudo cmake --build build --target install
mkdir build && cd build
cmake ..
make
Name | Discription | Module |
---|---|---|
TagFamily | The TagFamily used by both localization module and generator | localization & generator |
ImagePath | The raw tag image path | generator |
ImageCount | The raw tag input image path | generator |
GenTags | The tag id used by tag generator | generator |
GenPath | The extend tag output image path | generator |
Tag ID as key | File : The raw tag input image name Size : The size of tag edge (mm) Canvas : The size of canvas (mm) [W, H] Extand_Dot : The position and size of extend dot (mm) [X, Y, R] Pixpermm : PPI for image Extrinsic : Pre-calibrate pose for tag (option) |
localization & generator |
ImageTopic | The input image topic | localization (Ros only) |
ImageSize | The input image size [W, H] | localization |
ImageIntrinsic | Intrinsic parameter of the camera [ $f_x$ , 0, $c_x$ , 0, $f_y$ , $c_y$ , 0, 0, 1] |
localization |
ImageDistrotion | Distrotion parameter of the camera [ $k_1$ |
localization |
T_b_c | deprecate / | / |
PosePublishTopic | The output camera pose topic | localization |
DebugPlot | Choose whether to plot the debug image (close to get better performance) | localization(Pi only) |
./localization
or manually set config path by ./localization ${path_to_yaml_file}
You can add code at the position we use cout to print the position to the terminal and add the user defined behavior code at that postion.
TBD
Camera Type We test v1 & v2 raspberry camera. But it should work with all camera which support Legacy Camera API on Raspberry Pi
-
Plugin camera
-
Open Legacy Camera interface with rasp
raspi-config
-
Reboot
-
Install opencv python to run test script
sudo apt install -y python3-opencv
-
Using test script
cameratest.py
to test whether camera workwell
Run the release exe file after doing Install dll with apt-get
You need to calibrate the camera manually. Ros camera calibration
maybe a good choice.
You need to get
See the Image out check whether everything goes well and check whether the xyz on the left top corner make sence unit is (m)