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
-
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 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 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 Setup(const std::string &config_file)