制作apriltag

7 篇文章 1 订阅
本文档介绍了如何安装和配置TagSLAM,这是一个基于ROS的AprilTag视觉定位系统。首先,你需要安装ROS、catkin工具以及GTSAM库。然后,克隆并编译TagSLAM的源代码,包括其依赖项。对于Ubuntu 16.04和18.04,分别提供了相应的编译步骤。完成编译后,可以通过运行一个快速测试来验证TagSLAM的正确性。此外,还提供了一个程序用于生成AprilTag PDF。
摘要由CSDN通过智能技术生成

https://berndpfrommer.github.io/tagslam_web/making_tags/

https://github.com/berndpfrommer/tagslam_root

https://optitag.io/blogs/news/designing-your-perfect-apriltag Designing the perfect Apriltag

 

TagSLAM root repository

Use this repository to get a complete ROS/catkin workspace with all dependencies for the TagSLAM project.

This repository relies heavily on git submodules.

 

Installation instructions

Since this is ROS package, you will need to install ROS. This repo has been tested on Ubuntu 16.04 (ROS Kinetic) and Ubuntu 18.04 (ROS Melodic). On top of it, install the catkin tools:

sudo apt install python-catkin-tools

TagSLAM's backend is based on GTSAM, so you will need to add a PPA.

If you previously installed GTSAM, you need to first remove the older version:

sudo apt remove gtsam
sudo add-apt-repository --remove ppa:bernd-pfrommer/gtsam

Now add the official borglab ppa and install GTSAM:

sudo apt-add-repository ppa:borglab/gtsam-release-4.0
sudo apt update
sudo apt install libgtsam-dev libgtsam-unstable-dev

Clone the full repo including all submodules, into a a new catkin workspace (tagslam_root):

cd ~
git clone --recursive https://github.com/berndpfrommer/tagslam_root.git

 

For Ubuntu 18.04 and later:

Configure and compile:

cd ~/tagslam_root
catkin config -DCMAKE_BUILD_TYPE=Release
catkin build

 

For Ubuntu 16.04:

Ubuntu 16.04 lacks support for C++ standard 17, so you need to install a later version of cmake and g++-7 from PPA repositories:

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install gcc-7 g++-7

Then upgrade cmake:

sudo apt-add-repository 'deb https://apt.kitware.com/ubuntu/ xenial main'
sudp apt-get update
sudo apt-get install kitware-archive-keyring
sudo apt-key --keyring /etc/apt/trusted.gpg del C1F34CDD40CD72DA
sudo apt-get update
sudo apt-get install cmake

Direct cmake to use the g++-7 compiler:

cd ~/tagslam_root
catkin config -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_COMPILER=g++-7
catkin build

You will get tons of warning messages, but it should compile.

 

Quick test

Overlay the newly created workspace and run a quick test:

source ~/tagslam_root/devel/setup.bash
roslaunch tagslam tagslam.launch bag:=`rospack find tagslam`/example/example.bag

(the rosnode will not exit, so you have to Ctrl-C out of it)

 

License

This software and any future contributions to it are licensed under the Apache License 2.0.

 

 

How to print your own AprilTags

There is a handy little program in the TagSLAM repo (courtesy of the Kalibr folks) with which you can generate a pdf of an AprilTag:

sudo apt install python-pyx
rosrun tagslam make_tag.py --nx 1 --ny 1 --marginx 0.00 --marginy 0.00 --tsize 0.16 --tspace 0.0 --startid 4 --tfam t36h11 --borderbits 1 

参数含义:

    parser = argparse.ArgumentParser(description='Generate apriltag PDF.', usage=usage)   
    outputOptions = parser.add_argument_group('Output options')    
    outputOptions.add_argument('output', nargs="?", default="target", help='Output filename')   
    genericOptions = parser.add_argument_group('Generic grid options')    
    genericOptions.add_argument('--nx', type=int, default=6, dest='n_cols', help='The number of tags in x direction (default: %(default)s)\n')
    genericOptions.add_argument('--ny', type=int, default=7, dest='n_rows', help='The number of tags in y direction (default: %(default)s)')
    genericOptions.add_argument('--marginx', type=float, default=0, dest='marginx', help='Margin [m] in x direction (default: %(default)s)')
    genericOptions.add_argument('--marginy', type=float, default=0, dest='marginy', help='Margin [m] in y direction (default: %(default)s)')
    genericOptions.add_argument('--color', default="Black", dest='color', help='Color in cmyk space (default: %(default)s)')    aprilOptions = parser.add_argument_group('Apriltag arguments')    
    aprilOptions.add_argument('--tsize', type=float, default=0.08, dest='tsize', help='The size of one tag [m] (default: %(default)s)')
    aprilOptions.add_argument('--tspace', type=float, default=0.3, dest='tagspacing', help='The space between the tags in fraction of the edge size [0..1] (default: %(default)s)')
    aprilOptions.add_argument('--tfam', default='t36h11', dest='tagfamiliy', help='Familiy of April tags {0} (default: %(default)s)'.format(AprilTagCodes.TagFamilies.keys()))
    aprilOptions.add_argument('--startid', default=0, type=int, dest='startid', help='Start number for apriltag (default: %(default)s)')
    aprilOptions.add_argument('--borderbits', default=2, type=int, dest='borderBits', help='number of bits used for black border (default: %(default)s)')
    aprilOptions.add_argument('--symm_corners', default=False, dest='symmCorners', action='store_true', help='add black corner squares (default: %(default)s)')

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值