From Brown University Robotics
Planar tracker is a simple node that subscribes to ar_recog Tags messages and in turn spits out Tag_Positions messages after performing a perspective transformation on the AR tag.
It uses a simple configuration file in the planar_tracker/bin directory called "transformation_points.txt". To populate this file correctly:
- Position the camera to cover as much of the field as practicable. If a single camera is insufficient, more cameras can be used. Each camera will have to feed into a separate gscam->ar_recog->planar_tracker pipeline. A single computer can manage these, but will be limited by the speed at which it can perform processing on multiple image streams.
- Run roscore, gscam and ar_recog.
- Place a robot with an AR tag at a known location on the field. The robot should be facing the direction which makes theta equal to zero, i.e., facing parallel to the x-axis of the coordinate plane, such that positive x is forward.
- Observe (i.e., with "rostopic echo /tags") the x, y, and zRot fields corresponding to the robot's tag, as reported by ar_recog.
- tags.tag.x goes in the first column of transformation_points.txt. tags.tag.y in the second, and tags.tag.zRot in the fifth.
- The robot's actual ground position x and y, in whatever units you wish to use, go in the third and fourth column.
- Place the robot in several other non-colinear locations, as widely spaced as possible, and fill out the measurements on separate lines of transformation_points.txt.
- At least four separate points are required -- for example, the corners of the robot's activity area.
Once the planar tracker is calibrated through this procedure, it can be run in normal ROS fashion. It will generate a tag_positions topic, which will report the x, y and theta positions of all observed AR tags.
The information can be accessed by other robots by using a foreign_relay node, described in Internal:Topic forwarding.