Skip to content

Generating Object Space

Goals

  • Learn how to use the Object Space Generator in the Tangram Vision Basic repository.
  • Generate an object space file from a flat array of Markers.

Check Your Object Space Type

This method works for markers only. Checkerboards, Markerboards, and Aprilgrids should still be described manually using the Object Space JSON Schema.

Introduction

Object Space files can be quite complex, depending on the space being described. This is necessary for a good calibration, but it can be an undue burden on the user to create this file by hand.

To make this task (much) easier, we can use the Object Space Generator in the Tangram Vision Basic repository (https://gitlab.com/tangram-vision/platform/tangviz-basic/-/blob/main/examples/gen_objspace_markers.rs). This takes images of any flat board being used as a target, derives the object space, and generates the right JSON for TVCal to use.

Setup

Rust Tools Ahead

This tutorial relies on cargo, part of the Rust toolchain. If you can't run Rust programs already, install it here. You don't need any Rust-specific knowledge to run this tutorial.

Install the Object Space Generator using cargo install:

$ cargo install tangviz_basic --example gen_objspace_markers

Inputs

The Object Space Generator derives the object space from the image of a plane of disjointed markers. It does a lot of heavy lifting, but there's only so much it can derive. Some information must be provided to generate an accurate object space file.

It is helpful to specify the marker dictionary from which the target was derived. If no family is provided, the Object Space Generator will do its best to figure this out on its own.

You can run tv_gen_objspace in your command line to see all arguments.

Example

We have a target file markers.png that has been printed out onto a piece of foamboard. The AprilTags themselves are part of the family 36h11, one of the more commonly used generators. Every marker on the printed foamboard target has an edge length of 5cm.

Detector: Markers

Measure Twice, Calibrate Once

It's always a good idea to measure a target field manually, just to make sure that your metric space that you programmed matches reality.

We have all the information we need to derive object space. Process the board above with the following command:

$ tv_gen_objspace -t ./markers.png -l 0.05 -d Apriltag36h11

Output

The Object Space Generator will output a valid JSON for use in TVCal. If you've gotten to this point: good news! You've done it. Upload this file to the User Hub and start calibrating.