MAPLE

class MAPLE

The Multicamera Apriltag Pose Localization and Estimation (MAPLE) class is a singleton object with with individual Worker threads for each camera, the localization computation, the webserver, the NetworkTables client, and the logger.

First, the config.yml configuration file is read to determine MAPLEParams and setup the TDCamWorker Workers. Next, the .fmap file is parsed to configure global locations of the Apriltags. All Worker threads are spun up and process data in realtime. Most Worker threads are marked as ‘stay alive’, which will attempt to restart the Worker in case of an exception. MAPLE will only exit on a CTRL-C interrupt.

The latest robot pose in the global frame is available using GetRobotPose(), and is measured in position x,y,z in meters, and orientation roll, pitch, yaw in degrees.

Public Functions

MAPLE(MAPLE const&) = delete

No copy constructor allowed for the singleton.

void Setup(const std::string &config_file)

Read configuration parameters from the specified config yaml file. Create all Worker threads after files are loaded.

Parameters:

config_file – The .yaml configuration file path, relative to MAPLE.cpp

void Start()

Start all Worker threads, which starts the MAPLE system.

void Calibrate()

Calibrate all cameras by finding the distortion coefficients using a 7x7 checkerboard image. Distortion coefficients are not directly applied to the cameras, the user must copy the parameters from stdout or the logfile. Block until calibration is complete.

RobotPose GetRobotPose()

Get the latest RobotPose estimate. The estimate depends on which localization strategy is used.

Returns:

A RobotPose object with the global pose position estimate.

void Join()

Wait for all Workers to finish. Blocks until CTRL-C is received or Stop() is called.

void Stop()

Stop all Workers gracefully.

void SignalCallback(int signum)

The signal callback within the context of the singleton instance which registers the callback function to each thread.

Parameters:

signum – The signal value caught

void Restart()

Restart MAPLE.

std::string GetVersion()

Get MAPLE version.

Returns:

The version.

Public Static Functions

static MAPLE &GetInstance()

Return the singleton instance of the MAPLE object. Create a new static instance if none exists.

static void StaticSignalCallback(int signum)

Register sigint callback to Workers.

Parameters:

signum – The signal value caught