Skip to content

HuskyLens

NextHuskyLens is a wrapper around the HuskyLens that initializes the device lazily from the hardware map. It wraps common read and setup methods. Anything else not wrapped is accessible through camera.

// Using your configuration name
val huskyLens = NextHuskyLens("huskyLens")

Selects the recognition algorithm.

huskyLens.selectAlgorithm(HuskyLens.Algorithm.OBJECT_TRACKING)

Returns all currently seen blocks, or only blocks with the given id, this is capped at 6.

val allBlocks = huskyLens.blocks()
val blocksWithId = huskyLens.blocks(1)

Returns all currently seen arrows, or only arrows with the given id, this is capped at 6.

val allArrows = huskyLens.arrows()
val arrowsWithId = huskyLens.arrows(1)

Verifies the device is responding over I2C. Returns true if it is.

if (huskyLens.knock()) { ... }