### getSignalProcessConfig Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets the signal processing configuration from the OTOS. ```APIDOC ## GET /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getSignalProcessConfig ### Description Gets the signal processing configuration from the OTOS. ### Method GET ### Endpoint /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getSignalProcessConfig ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body needed for this GET request." } ``` ### Response #### Success Response (200) - **config** (sfe_otos_signal_process_config_t) - Signal processing configuration. #### Response Example ```json { "config": { "param1": "value1", "param2": 123 } } ``` ``` -------------------------------- ### getVersionInfo Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets the hardware and firmware version numbers from the OTOS. ```APIDOC ## GET /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getVersionInfo ### Description Gets the hardware and firmware version numbers from the OTOS. ### Method GET ### Endpoint /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getVersionInfo ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body needed for this GET request." } ``` ### Response #### Success Response (200) - **hwVersion** (sfe_otos_version_t) - Hardware version number. - **fwVersion** (sfe_otos_version_t) - Firmware version number. #### Response Example ```json { "hwVersion": { "major": 1, "minor": 0, "patch": 0 }, "fwVersion": { "major": 2, "minor": 1, "patch": 3 } } ``` ``` -------------------------------- ### Get and Set Qwiic OTOS Signal Processing Configuration Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Allows retrieval and setting of the signal processing configuration on the Qwiic OTOS. This is particularly useful for creating and testing new lookup table calibrations. ```cpp sfTkError_t getSignalProcessConfig (sfe_otos_signal_process_config_t &config) ``` ```cpp sfTkError_t setSignalProcessConfig (sfe_otos_signal_process_config_t &config) ``` -------------------------------- ### Get Qwiic OTOS Acceleration Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the current acceleration measured by the Qwiic OTOS. The acceleration is returned as a `sfe_otos_pose2d_t` structure. ```cpp sfTkError_t getAcceleration (sfe_otos_pose2d_t &pose) ``` -------------------------------- ### Get IMU Calibration Progress (C++) Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Retrieves the current progress of the IMU calibration process. This is useful when asynchronous calibration is enabled via `calibrateImu()`. The number of remaining samples is returned. ```cpp sfTkError_t sfDevOTOS::getImuCalibrationProgress(uint8_t &_numSamples) ``` -------------------------------- ### Get Qwiic OTOS IMU Calibration Progress Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the current progress of the IMU calibration process. This function is particularly useful when performing asynchronous calibration using the `calibrateImu()` function. ```cpp sfTkError_t getImuCalibrationProgress (uint8_t &numSamples) ``` -------------------------------- ### Set Position (C++) Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Sets a new starting position for the OTOS sensor's tracking. This is beneficial if the robot does not begin at the origin or if external location data is available. The OTOS will continue tracking from this specified position. Returns an error code. ```cpp sfTkError_t sfDevOTOS::setPosition(sfe_otos_pose2d_t & _pose_) ``` -------------------------------- ### Device Diagnostics and Information Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/sf_dev_o_t_o_s_8h_source Functions for performing self-tests, getting calibration progress, and retrieving version information. ```APIDOC ## POST /selfTest ### Description Performs a self test of the OTOS. ### Method POST ### Endpoint /selfTest ### Parameters None ### Request Example None ### Response #### Success Response (200) - **status** (sfTkError_t) - Indicates the success or failure of the self-test. #### Response Example { "status": "SF_TK_SUCCESS" } ``` ```APIDOC ## GET /getImuCalibrationProgress ### Description Gets the progress of the IMU calibration. Used for asynchronous calibration with calibrateImu(). ### Method GET ### Endpoint /getImuCalibrationProgress ### Parameters #### Query Parameters - **numSamples** (uint8_t&) - Output parameter to store the number of samples collected for calibration. ### Request Example None ### Response #### Success Response (200) - **status** (sfTkError_t) - Indicates the success or failure of the operation. #### Response Example { "status": "SF_TK_SUCCESS" } ``` ```APIDOC ## GET /getVersionInfo ### Description Gets the hardware and firmware version numbers from the OTOS. ### Method GET ### Endpoint /getVersionInfo ### Parameters #### Query Parameters - **hwVersion** (sfe_otos_version_t&) - Output parameter to store the hardware version. - **fwVersion** (sfe_otos_version_t&) - Output parameter to store the firmware version. ### Request Example None ### Response #### Success Response (200) - **status** (sfTkError_t) - Indicates the success or failure of the operation. #### Response Example { "status": "SF_TK_SUCCESS" } ``` -------------------------------- ### Get and Set Qwiic OTOS Linear Unit Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Allows retrieval and setting of the linear unit used for pose-related measurements on the Qwiic OTOS. Supported units are defined by the `sfe_otos_linear_unit_t` enum. ```cpp sfe_otos_linear_unit_t getLinearUnit () ``` ```cpp void setLinearUnit (sfe_otos_linear_unit_t unit) ``` -------------------------------- ### Sensor Configuration and Status - Arduino Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/functions Provides functions to get and set the sensor's signal processing configuration, retrieve status information, and check connection status. These are important for fine-tuning sensor performance and diagnostics. ```Arduino sfe_otos_signal_process_config_t getSignalProcessConfig(); sfe_otos_status_t getStatus(); bool isConnected(); ``` -------------------------------- ### Get Acceleration Data (C++) Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Retrieves the acceleration data measured by the OTOS sensor. The results are stored in the provided `sfe_otos_pose2d_t` structure. The function returns a status code indicating success or failure. ```cpp sfTkError_t sfDevOTOS::getAcceleration(sfe_otos_pose2d_t &_pose) ``` -------------------------------- ### Get and Set Qwiic OTOS Offset Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves or sets the offset of the Qwiic OTOS. Setting an offset is useful when the sensor is mounted off-center, allowing the OTOS to report the position relative to a different origin (e.g., the robot's center). ```cpp sfTkError_t getOffset (sfe_otos_pose2d_t &pose) ``` ```cpp sfTkError_t setOffset (sfe_otos_pose2d_t &pose) ``` -------------------------------- ### Get and Set Qwiic OTOS Position Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets or sets the current position measured by the OTOS sensor. This is useful for robots that do not start at the origin or when integrating with other odometry sources. ```Arduino C++ sfTkError_t getPosition (sfe_otos_pose2d_t &pose) sfTkError_t setPosition (sfe_otos_pose2d_t &pose) ``` -------------------------------- ### Initialize QwiicOTOS Arduino Library Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/_spark_fun___qwiic___o_t_o_s___arduino___library_8h_source Initializes the QwiicOTOS Arduino class, setting up the I2C communication bus and verifying the sensor's connection. It depends on the Arduino framework and the SparkFun Toolkit library. ```cpp #include "Arduino.h" #include #include "sfTk/sfDevOTOS.h" #include class QwiicOTOS : public sfDevOTOS { public: bool begin(TwoWire &wirePort = Wire) { // Setup Arduino I2C bus _theI2CBus.init(wirePort, kDefaultAddress); // Begin the sensor return sfDevOTOS::begin(&_theI2CBus) == ksfTkErrOk; } protected: void delayMs(uint32_t ms) { delay(ms); } private: sfTkArdI2C _theI2CBus; }; ``` -------------------------------- ### Offset and Position Configuration Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/functions Functions for setting the device's offset and position. ```APIDOC ## setOffset ### Description Sets an offset for the device's measurements. ### Method `setOffset(float x, float y, float z)` ### Endpoint N/A (Library function) ### Parameters #### Path Parameters - **x** (float) - Required - The x-component of the offset. - **y** (float) - Required - The y-component of the offset. - **z** (float) - Required - The z-component of the offset. ### Request Example ```cpp // Example usage within an Arduino sketch #include OTOS otos; void setup() { Wire.begin(); otos.begin(); } void loop() { otos.setOffset(0.1, 0.2, 0.3); } ``` ### Response #### Success Response (No specific return value indicated, typically void or a status code) #### Response Example N/A ``` ```APIDOC ## setPosition ### Description Sets the current position of the device. ### Method `setPosition(float x, float y, float z)` ### Endpoint N/A (Library function) ### Parameters #### Path Parameters - **x** (float) - Required - The x-coordinate of the position. - **y** (float) - Required - The y-coordinate of the position. - **z** (float) - Required - The z-coordinate of the position. ### Request Example ```cpp // Example usage within an Arduino sketch #include OTOS otos; void setup() { Wire.begin(); otos.begin(); } void loop() { otos.setPosition(10.0, 20.0, 30.0); } ``` ### Response #### Success Response (No specific return value indicated, typically void or a status code) #### Response Example N/A ``` -------------------------------- ### Get and Set Qwiic OTOS Position Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves or sets the current position measured by the Qwiic OTOS. Setting the position is useful for initializing the tracking from a non-origin starting point or integrating with external localization systems. ```cpp sfTkError_t getPosition (sfe_otos_pose2d_t &pose) ``` ```cpp sfTkError_t setPosition (sfe_otos_pose2d_t &pose) ``` -------------------------------- ### Include Header Files for SparkFun Qwiic OTOS Arduino Library Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/_spark_fun___qwiic___o_t_o_s___arduino___library_8h This snippet shows the necessary header files to include for using the SparkFun Qwiic OTOS Arduino Library. It includes Arduino core, SparkFun Toolkit, the OTOS-specific driver, and the Wire library for I2C communication. ```cpp #include "Arduino.h" #include #include "sfTk/sfDevOTOS.h" #include ``` -------------------------------- ### Get and Set Qwiic OTOS Angular Scalar Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets or sets the angular scalar value for the OTOS sensor. This can be used to compensate for scaling issues in sensor measurements. ```Arduino C++ sfTkError_t getAngularScalar (float &scalar) sfTkError_t setAngularScalar (float scalar) ``` -------------------------------- ### Qwiic OTOS Unit Conversion Constants (C++) Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Provides static constants for converting between various units used by the Qwiic OTOS sensor, such as meters to inches, radians to degrees, and different measurement scales to a 16-bit integer representation. These are essential for interpreting raw sensor data accurately. ```cpp static constexpr float | kMeterToInch = 39.37f; static constexpr float | kInchToMeter = 1.0f / kMeterToInch; static constexpr float | kRadianToDegree = 180.0f / M_PI; static constexpr float | kDegreeToRadian = M_PI / 180.0f; static constexpr float | kMeterToInt16 = 32768.0f / 10.0f; static constexpr float | kInt16ToMeter = 1.0f / kMeterToInt16; static constexpr float | kMpsToInt16 = 32768.0f / 5.0f; static constexpr float | kInt16ToMps = 1.0f / kMpsToInt16; static constexpr float | kMpssToInt16 = 32768.0f / (16.0f * 9.80665f); static constexpr float | kInt16ToMpss = 1.0f / kMpssToInt16; static constexpr float | kRadToInt16 = 32768.0f / M_PI; static constexpr float | kInt16ToRad = 1.0f / kRadToInt16; static constexpr float | kRpsToInt16 = 32768.0f / (2000.0f * kDegreeToRadian); static constexpr float | kInt16ToRps = 1.0f / kRpsToInt16; static constexpr float | kRpssToInt16 = 32768.0f / (M_PI * 1000.0f); static constexpr float | kInt16ToRpss = 1.0f / kRpssToInt16; ``` -------------------------------- ### Get and Set Qwiic OTOS Linear Unit Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets or sets the linear unit used for pose-related measurements by the OTOS sensor. Supported units are defined by `sfe_otos_linear_unit_t`. ```Arduino C++ sfe_otos_linear_unit_t getLinearUnit () void setLinearUnit (sfe_otos_linear_unit_t unit) ``` -------------------------------- ### Initialize and Connect to Qwiic OTOS Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Initializes the Qwiic OTOS device and verifies its connection. An optional communication bus object can be provided for custom I2C configurations. Returns an error code indicating success or failure. ```cpp sfTkError_t begin (sfTkII2C *commBus=nullptr) ``` -------------------------------- ### Get and Set Qwiic OTOS Signal Processing Configuration Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets or sets the signal processing configuration of the OTOS sensor. This is particularly useful for creating and testing new lookup table calibrations. ```Arduino C++ sfTkError_t getSignalProcessConfig (sfe_otos_signal_process_config_t &config) sfTkError_t setSignalProcessConfig (sfe_otos_signal_process_config_t &config) ``` -------------------------------- ### Get and Set Qwiic OTOS Offset Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets or sets the offset of the OTOS sensor. Setting an offset is useful when the sensor is not mounted at the origin of the robot, allowing the OTOS to report the robot's position instead. ```Arduino C++ sfTkError_t getOffset (sfe_otos_pose2d_t &pose) sfTkError_t setOffset (sfe_otos_pose2d_t &pose) ``` -------------------------------- ### Constructor and Register Definitions (C++) Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s-members This snippet includes the constructor for the sfDevOTOS class and definitions for various sensor registers. These registers are used internally by the library to communicate with the ToF sensor and access its various functionalities and data points. ```C++ kRegPosStdHL| sfDevOTOS| protectedstatic kRegPosStdXH| sfDevOTOS| protectedstatic kRegPosStdXL| sfDevOTOS| protectedstatic kRegPosStdYH| sfDevOTOS| protectedstatic kRegPosStdYL| sfDevOTOS| protectedstatic kRegPosXH| sfDevOTOS| protectedstatic kRegPosXL| sfDevOTOS| protectedstatic kRegPosYH| sfDevOTOS| protectedstatic kRegPosYL| sfDevOTOS| protectedstatic kRegProductId| sfDevOTOS| protectedstatic kRegReset| sfDevOTOS| protectedstatic kRegScalarAngular| sfDevOTOS| protectedstatic kRegScalarLinear| sfDevOTOS| protectedstatic kRegSelfTest| sfDevOTOS| protectedstatic kRegSignalProcess| sfDevOTOS| protectedstatic kRegStatus| sfDevOTOS| protectedstatic kRegVelHH| sfDevOTOS| protectedstatic kRegVelHL| sfDevOTOS| protectedstatic kRegVelStdHH| sfDevOTOS| protectedstatic kRegVelStdHL| sfDevOTOS| protectedstatic kRegVelStdXH| sfDevOTOS| protectedstatic kRegVelStdXL| sfDevOTOS| protectedstatic kRegVelStdYH| sfDevOTOS| protectedstatic kRegVelStdYL| sfDevOTOS| protectedstatic kRegVelXH| sfDevOTOS| protectedstatic kRegVelXL| sfDevOTOS| protectedstatic kRegVelYH| sfDevOTOS| protectedstatic kRegVelYL| sfDevOTOS| protectedstatic kRpssToInt16| sfDevOTOS| protectedstatic kRpsToInt16| sfDevOTOS| protectedstatic sfDevOTOS()| sfDevotos| ``` -------------------------------- ### getVelocity Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets the velocity measured by the OTOS. ```APIDOC ## GET /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getVelocity ### Description Gets the velocity measured by the OTOS. ### Method GET ### Endpoint /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getVelocity ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body needed for this GET request." } ``` ### Response #### Success Response (200) - **pose** (sfe_otos_pose2d_t) - Velocity measured by the OTOS. #### Response Example ```json { "pose": { "x": 0.5, "y": 0.5 } } ``` ``` -------------------------------- ### Product and Version Constants Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Constants related to the product ID and firmware/hardware versions. ```APIDOC ## Product and Version Constants ### kProductId * **Description**: The product ID of the device. * **Value**: `0x5F` ### kRegFwVersion * **Description**: Register address for the firmware version. * **Value**: `0x02` ### kRegHwVersion * **Description**: Register address for the hardware version. * **Value**: `0x01` ``` -------------------------------- ### getVelocityStdDev Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets the standard deviation of the measured velocity. ```APIDOC ## GET /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getVelocityStdDev ### Description Gets the standard deviation of the measured velocity. ### Method GET ### Endpoint /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getVelocityStdDev ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body needed for this GET request." } ``` ### Response #### Success Response (200) - **pose** (sfe_otos_pose2d_t) - Standard deviation of the velocity measured by the OTOS. #### Response Example ```json { "pose": { "x": 0.005, "y": 0.005 } } ``` ### Note These values are just the square root of the diagonal elements of the covariance matrices of the Kalman filters used in the firmware, so they are just statistical quantities and do not represent actual error! ``` -------------------------------- ### Initialize Qwiic OTOS Sensor Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Initializes the Qwiic OTOS sensor and verifies its connection over the I2C bus. It returns a status code indicating success or failure. ```C++ sfTkError_t sfDevOTOS::begin(sfTkII2C * _commBus_ = nullptr) ``` -------------------------------- ### Product and Version Constants (C++) Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Defines constants for the product ID and firmware/hardware versions. These are essential for device identification and ensuring compatibility. ```cpp constexpr uint8_t sfDevOTOS::kProductId = 0x5F; constexpr uint8_t sfDevOTOS::kRegFwVersion = 0x02; constexpr uint8_t sfDevOTOS::kRegHwVersion = 0x01; ``` -------------------------------- ### Get Linear Unit Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the linear unit used for all pose-related methods in the OTOS sensor. ```C++ sfe_otos_linear_unit_t sfDevOTOS::getLinearUnit() ``` -------------------------------- ### Device Configuration and Control (C++) Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s-members This set of functions allows for the configuration and control of the ToF sensor. Users can reset the device, perform self-tests, set angular and linear units and scalars, define offsets, and configure signal processing parameters. These functions are essential for tailoring the sensor's behavior to specific application needs. ```C++ resetTracking() selfTest() setAngularScalar(float scalar) setAngularUnit(sfe_otos_angular_unit_t unit) setLinearScalar(float scalar) setLinearUnit(sfe_otos_linear_unit_t unit) setOffset(sfe_otos_pose2d_t &pose) setPosition(sfe_otos_pose2d_t &pose) setSignalProcessConfig(sfe_otos_signal_process_config_t &config) ``` -------------------------------- ### Get Angular Unit Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the angular unit used for all pose-related methods in the OTOS sensor. ```C++ sfe_otos_angular_unit_t sfDevOTOS::getAngularUnit() ``` -------------------------------- ### Initialize and Calibrate IMU - Arduino Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/functions Initializes the Qwiic OTOS sensor and calibrates its IMU. This function is crucial for accurate sensor readings and requires the sensor to be connected via I2C. It returns a boolean indicating success or failure. ```Arduino bool begin(); bool calibrateImu(); ``` -------------------------------- ### Get Position Data Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the position measurements from the OTOS sensor. The results are stored in a `sfe_otos_pose2d_t` structure. ```C++ sfTkError_t sfDevOTOS::getPosition(sfe_otos_pose2d_t & _pose_) ``` -------------------------------- ### Configuration and Settings Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/sf_dev_o_t_o_s_8h_source Functions for setting device parameters like position and linear scalar, and retrieving signal processing configuration. ```APIDOC ## POST /setPosition ### Description Sets the position measured by the OTOS. This is useful if your robot does not start at the origin. ### Method POST ### Endpoint /setPosition ### Parameters #### Request Body - **pose** (sfe_otos_pose2d_t&) - The pose to set as the current position. ### Request Example ```json { "pose": { "x": 0.0, "y": 0.0, "h": 0.0 } } ``` ### Response #### Success Response (200) - **status** (sfTkError_t) - Indicates the success or failure of the operation. #### Response Example { "status": "SF_TK_SUCCESS" } ``` ```APIDOC ## POST /setLinearScalar ### Description Sets the linear scalar used by the OTOS. Can be used to compensate for scaling issues with the sensor. ### Method POST ### Endpoint /setLinearScalar ### Parameters #### Request Body - **scalar** (float) - The linear scalar value to set. ### Request Example ```json { "scalar": 1.0 } ``` ### Response #### Success Response (200) - **status** (sfTkError_t) - Indicates the success or failure of the operation. #### Response Example { "status": "SF_TK_SUCCESS" } ``` ```APIDOC ## GET /getSignalProcessConfig ### Description Gets the signal processing configuration from the OTOS. ### Method GET ### Endpoint /getSignalProcessConfig ### Parameters #### Query Parameters - **config** (sfe_otos_signal_process_config_t&) - Output parameter to store the signal processing configuration. ### Request Example None ### Response #### Success Response (200) - **status** (sfTkError_t) - Indicates the success or failure of the operation. #### Response Example { "status": "SF_TK_SUCCESS" } ``` -------------------------------- ### Get Linear Scalar Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the linear scalar value used by the OTOS sensor for linear measurements. ```C++ sfTkError_t sfDevOTOS::getLinearScalar(float & _scalar_) ``` -------------------------------- ### Get Angular Scalar Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the angular scalar value used by the OTOS sensor for angular measurements. ```C++ sfTkError_t sfDevOTOS::getAngularScalar(float & _scalar_) ``` -------------------------------- ### Get Acceleration Data Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the acceleration measurements from the OTOS sensor. The results are stored in a `sfe_otos_pose2d_t` structure. ```C++ sfTkError_t sfDevOTOS::getAcceleration(sfe_otos_pose2d_t & _pose_) ``` -------------------------------- ### getPositionStdDev Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets the standard deviation of the measured position from the OTOS sensor. ```APIDOC ## GET /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getPositionStdDev ### Description Gets the standard deviation of the measured position. ### Method GET ### Endpoint /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getPositionStdDev ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body needed for this GET request." } ``` ### Response #### Success Response (200) - **pose** (sfe_otos_pose2d_t) - Standard deviation of the position measured by the OTOS. #### Response Example ```json { "pose": { "x": 0.1, "y": 0.1 } } ``` ### Note These values are just the square root of the diagonal elements of the covariance matrices of the Kalman filters used in the firmware, so they are just statistical quantities and do not represent actual error! ``` -------------------------------- ### Initialize Qwiic OTOS Sensor Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Initializes the Qwiic OTOS sensor and verifies its connection. Supports initialization with a TwoWire object or a custom communication bus. ```Arduino C++ bool begin (TwoWire &wirePort=Wire) sfTkError_t begin (sfTkII2C *commBus=nullptr) ``` -------------------------------- ### Get Offset Data Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the offset of the OTOS sensor relative to the center of the robot. The results are stored in a `sfe_otos_pose2d_t` structure. ```C++ sfTkError_t sfDevOTOS::getOffset(sfe_otos_pose2d_t & _pose_) ``` -------------------------------- ### Qwiic OTOS Sensor Constants and Configurations (C++) Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Defines static constants for default I2C addresses, scalar limits, and register addresses for the SparkFun Qwiic OTOS sensor. These constants are crucial for initializing and interacting with the sensor's hardware registers and configuration parameters. ```cpp static constexpr uint8_t | kDefaultAddress = 0x17; static constexpr float | kMinScalar = 0.872f; static constexpr float | kMaxScalar = 1.127f; static constexpr uint8_t | kRegProductId = 0x00; static constexpr uint8_t | kRegHwVersion = 0x01; static constexpr uint8_t | kRegFwVersion = 0x02; static constexpr uint8_t | kRegScalarLinear = 0x04; static constexpr uint8_t | kRegScalarAngular = 0x05; static constexpr uint8_t | kRegImuCalib = 0x06; static constexpr uint8_t | kRegReset = 0x07; static constexpr uint8_t | kRegSignalProcess = 0x0E; static constexpr uint8_t | kRegSelfTest = 0x0F; static constexpr uint8_t | kRegOffXL = 0x10; static constexpr uint8_t | kRegOffXH = 0x11; static constexpr uint8_t | kRegOffYL = 0x12; static constexpr uint8_t | kRegOffYH = 0x13; static constexpr uint8_t | kRegOffHL = 0x14; static constexpr uint8_t | kRegOffHH = 0x15; static constexpr uint8_t | kRegStatus = 0x1F; static constexpr uint8_t | kRegPosXL = 0x20; static constexpr uint8_t | kRegPosXH = 0x21; static constexpr uint8_t | kRegPosYL = 0x22; static constexpr uint8_t | kRegPosYH = 0x23; static constexpr uint8_t | kRegPosHL = 0x24; static constexpr uint8_t | kRegPosHH = 0x25; static constexpr uint8_t | kRegVelXL = 0x26; static constexpr uint8_t | kRegVelXH = 0x27; static constexpr uint8_t | kRegVelYL = 0x28; static constexpr uint8_t | kRegVelYH = 0x29; static constexpr uint8_t | kRegVelHL = 0x2A; static constexpr uint8_t | kRegVelHH = 0x2B; static constexpr uint8_t | kRegAccXL = 0x2C; static constexpr uint8_t | kRegAccXH = 0x2D; static constexpr uint8_t | kRegAccYL = 0x2E; static constexpr uint8_t | kRegAccYH = 0x2F; static constexpr uint8_t | kRegAccHL = 0x30; static constexpr uint8_t | kRegAccHH = 0x31; static constexpr uint8_t | kRegPosStdXL = 0x32; static constexpr uint8_t | kRegPosStdXH = 0x33; static constexpr uint8_t | kRegPosStdYL = 0x34; static constexpr uint8_t | kRegPosStdYH = 0x35; static constexpr uint8_t | kRegPosStdHL = 0x36; static constexpr uint8_t | kRegPosStdHH = 0x37; static constexpr uint8_t | kRegVelStdXL = 0x38; static constexpr uint8_t | kRegVelStdXH = 0x39; static constexpr uint8_t | kRegVelStdYL = 0x3A; static constexpr uint8_t | kRegVelStdYH = 0x3B; static constexpr uint8_t | kRegVelStdHL = 0x3C; static constexpr uint8_t | kRegVelStdHH = 0x3D; static constexpr uint8_t | kRegAccStdXL = 0x3E; static constexpr uint8_t | kRegAccStdXH = 0x3F; static constexpr uint8_t | kRegAccStdYL = 0x40; static constexpr uint8_t | kRegAccStdYH = 0x41; static constexpr uint8_t | kRegAccStdHL = 0x42; static constexpr uint8_t | kRegAccStdHH = 0x43; static constexpr uint8_t | kProductId = 0x5F; ``` -------------------------------- ### Get Qwiic OTOS Velocity Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the current velocity measured by the Qwiic OTOS. The velocity is returned as a `sfe_otos_pose2d_t` structure. ```cpp sfTkError_t getVelocity (sfe_otos_pose2d_t &pose) ``` -------------------------------- ### Signal Processing Configuration Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/functions Functions for configuring the signal processing parameters of the OTOS device. ```APIDOC ## setSignalProcessConfig ### Description Sets the configuration for signal processing. ### Method `setSignalProcessConfig(sfe_otos_signal_process_config_t config)` ### Endpoint N/A (Library function) ### Parameters #### Request Body - **config** (sfe_otos_signal_process_config_t) - Required - The signal processing configuration structure. ### Request Example ```cpp // Example usage within an Arduino sketch #include OTOS otos; void setup() { Wire.begin(); otos.begin(); } void loop() { sfe_otos_signal_process_config_t spConfig; spConfig.filter_type = 1; // Example value spConfig.window_size = 5; // Example value otos.setSignalProcessConfig(spConfig); } ``` ### Response #### Success Response (No specific return value indicated, typically void or a status code) #### Response Example N/A ``` -------------------------------- ### getStatus Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets the status register from the OTOS, which includes warnings and errors reported by the sensor. ```APIDOC ## GET /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getStatus ### Description Gets the status register from the OTOS, which includes warnings and errors reported by the sensor. ### Method GET ### Endpoint /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getStatus ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body needed for this GET request." } ``` ### Response #### Success Response (200) - **status** (sfe_otos_status_t) - Status register value. #### Response Example ```json { "status": { "warnings": 0, "errors": 0 } } ``` ``` -------------------------------- ### Retrieve Qwiic OTOS Version Information Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the hardware and firmware version numbers from the Qwiic OTOS device. The versions are returned via reference parameters. ```cpp sfTkError_t getVersionInfo (sfe_otos_version_t &hwVersion, sfe_otos_version_t &fwVersion) ``` -------------------------------- ### getPosVelAccAndStdDev Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets the position, velocity, acceleration, and standard deviation of each in a single burst read. ```APIDOC ## GET /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getPosVelAccAndStdDev ### Description Gets the position, velocity, acceleration, and standard deviation of each in a single burst read. ### Method GET ### Endpoint /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getPosVelAccAndStdDev ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body needed for this GET request." } ``` ### Response #### Success Response (200) - **pos** (sfe_otos_pose2d_t) - Position measured by the OTOS. - **vel** (sfe_otos_pose2d_t) - Velocity measured by the OTOS. - **acc** (sfe_otos_pose2d_t) - Acceleration measured by the OTOS. - **posStdDev** (sfe_otos_pose2d_t) - Standard deviation of the position measured by the OTOS. - **velStdDev** (sfe_otos_pose2d_t) - Standard deviation of the velocity measured by the OTOS. - **accStdDev** (sfe_otos_pose2d_t) - Standard deviation of the acceleration measured by the OTOS. #### Response Example ```json { "pos": { "x": 1.0, "y": 2.0 }, "vel": { "x": 0.5, "y": 0.5 }, "acc": { "x": 0.1, "y": 0.1 }, "posStdDev": { "x": 0.01, "y": 0.01 }, "velStdDev": { "x": 0.005, "y": 0.005 }, "accStdDev": { "x": 0.001, "y": 0.001 } } ``` ``` -------------------------------- ### QwiicOTOS Class Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s-members The QwiicOTOS class provides an interface for the SparkFun Optical Tracking Odometry Sensor using the Qwiic connector. It includes methods for initialization and basic operations. ```APIDOC ## QwiicOTOS Class ### Description Provides an interface for the SparkFun Optical Tracking Odometry Sensor using the Qwiic connector. It includes methods for initialization and basic operations. ### Methods - **begin(TwoWire &wirePort=Wire)**: Initializes the sensor with the specified I2C port. - **delayMs(uint32_t ms)**: A protected virtual inline function for introducing delays. ### Inherited Members from sfDevOTOS This class inherits members from the `sfDevOTOS` class, which provides the core functionality for interacting with the sensor. ### Variables - **_angularUnit** (sfDevOTOS): Protected member related to angular units. - **_commBus** (sfDevOTOS): Protected member related to the communication bus. - **_linearUnit** (sfDevOTOS): Protected member related to linear units. - **_meterToUnit**: Protected member for meter to unit conversion. - **_radToUnit**: Protected member for radian to unit conversion. ``` -------------------------------- ### getPosVelAcc Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets the position, velocity, and acceleration measured by the OTOS in a single burst read. ```APIDOC ## GET /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getPosVelAcc ### Description Gets the position, velocity, and acceleration measured by the OTOS in a single burst read. ### Method GET ### Endpoint /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getPosVelAcc ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body needed for this GET request." } ``` ### Response #### Success Response (200) - **pos** (sfe_otos_pose2d_t) - Position measured by the OTOS. - **vel** (sfe_otos_pose2d_t) - Velocity measured by the OTOS. - **acc** (sfe_otos_pose2d_t) - Acceleration measured by the OTOS. #### Response Example ```json { "pos": { "x": 1.0, "y": 2.0 }, "vel": { "x": 0.5, "y": 0.5 }, "acc": { "x": 0.1, "y": 0.1 } } ``` ``` -------------------------------- ### getPosVelAccStdDev Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Gets the standard deviation of the measured position, velocity, and acceleration in a single burst read. ```APIDOC ## GET /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getPosVelAccStdDev ### Description Gets the standard deviation of the measured position, velocity, and acceleration in a single burst read. ### Method GET ### Endpoint /websites/sparkfun_sparkfun_qwiic_otos_arduino_library/getPosVelAccStdDev ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```json { "example": "No request body needed for this GET request." } ``` ### Response #### Success Response (200) - **pos** (sfe_otos_pose2d_t) - Standard deviation of the position measured by the OTOS. - **vel** (sfe_otos_pose2d_t) - Standard deviation of the velocity measured by the OTOS. - **acc** (sfe_otos_pose2d_t) - Standard deviation of the acceleration measured by the OTOS. #### Response Example ```json { "pos": { "x": 0.01, "y": 0.01 }, "vel": { "x": 0.005, "y": 0.005 }, "acc": { "x": 0.001, "y": 0.001 } } ``` ### Note These values are just the square root of the diagonal elements of the covariance matrices of the Kalman filters used in the firmware, so they are just statistical quantities and do not represent actual error! ``` -------------------------------- ### Sensor Control and Configuration Functions (C++) Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s-members This snippet outlines protected functions for controlling and configuring the OTOS sensor. It includes methods for resetting the sensor, performing self-tests, and setting various operational parameters like units and offsets. ```c++ resetTracking()| sfDevotos| selfTest()| sfDevotos| setAngularScalar(float scalar)| sfDevotos| setAngularUnit(sfe_otos_angular_unit_t unit)| sfDevotos| setLinearScalar(float scalar)| sfDevotos| setLinearUnit(sfe_otos_linear_unit_t unit)| sfDevotos| setOffset(sfe_otos_pose2d_t &pose)| sfDevotos| setPosition(sfe_otos_pose2d_t &pose)| sfDevotos| setSignalProcessConfig(sfe_otos_signal_process_config_t &config)| sfDevotos| ``` -------------------------------- ### sfe_otos_pose2d_t Member Data Documentation (C++) Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/structsfe__otos__pose2d__t Documentation for the member data of the sfe_otos_pose2d_t structure, detailing the 'h', 'x', and 'y' fields. ```cpp float sfe_otos_pose2d_t::h; // Heading value. float sfe_otos_pose2d_t::x; // X value. float sfe_otos_pose2d_t::y; // Y value. ``` -------------------------------- ### Get IMU Calibration Progress Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the progress of the IMU calibration process. This function is used in conjunction with asynchronous calibration initiated by `calibrateImu()`. ```C++ sfTkError_t sfDevOTOS::getImuCalibrationProgress(uint8_t & _numSamples_) ``` -------------------------------- ### Initialize Qwiic OTOS with I2C Bus (C++) Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/class_qwiic_o_t_o_s Initializes the Qwiic OTOS sensor using a specified I2C bus. This function verifies the connection to the sensor and returns a status code. The `commBus` parameter is used for I2C communication. ```cpp sfTkError_t sfDevOTOS::begin(sfTkII2C *_commBus = nullptr) ``` -------------------------------- ### Get Qwiic OTOS Status Source: https://docs.sparkfun.com/SparkFun_Qwiic_OTOS_Arduino_Library/classsf_dev_o_t_o_s Retrieves the status register from the Qwiic OTOS. This register contains information about warnings and errors reported by the sensor. ```cpp sfTkError_t getStatus (sfe_otos_status_t &status) ```