Doly C++ SDK v1.00
Loading...
Searching...
No Matches
Helper Namespace Reference

Functions

int8_t readSettings ()
 Read default settings from the platform settings file.
int8_t getImuOffsets (int16_t &gx, int16_t &gy, int16_t &gz, int16_t &ax, int16_t &ay, int16_t &az)
 Retrieve IMU calibration offsets (gyro/accel).
int8_t stopDolyService ()
 Stop the background Doly service (if running).

Function Documentation

◆ getImuOffsets()

int8_t Helper::getImuOffsets ( int16_t & gx,
int16_t & gy,
int16_t & gz,
int16_t & ax,
int16_t & ay,
int16_t & az )

Retrieve IMU calibration offsets (gyro/accel).

Reads previously stored IMU offset values. These offsets are typically passed into DriveControl::init(...) to start with calibrated parameters.

Parameters
[out]gxGyro X offset.
[out]gyGyro Y offset.
[out]gzGyro Z offset.
[out]axAccel X offset.
[out]ayAccel Y offset.
[out]azAccel Z offset.
Returns
Status code:
  • 0 : success
  • -1 : failed to read offsets
Examples
Helper/main.cpp, and ImuControl/main.cpp.

◆ readSettings()

int8_t Helper::readSettings ( )

Read default settings from the platform settings file.

This is commonly used to load calibration/config values that the SDK uses at runtime.

Returns
Status code:
  • >= 0 : success
  • -1 : settings file not found
  • -2 : XML open or parse error
Examples
ArmControl/main.cpp, Helper/main.cpp, and ImuControl/main.cpp.

◆ stopDolyService()

int8_t Helper::stopDolyService ( )

Stop the background Doly service (if running).

Some applications/tests may need exclusive access to hardware resources owned by the service. This helper provides a unified method to request stopping it.

Returns
Status code:
  • 0 : success
  • 1 : service not active
  • -1 : error while stopping service
Warning
Stopping the service may affect other running applications.
Examples
ArmControl/main.cpp, DriveControl/main.cpp, EdgeControl/main.cpp, EyeControl/main.cpp, FanControl/main.cpp, ImuControl/main.cpp, IoControl/main.cpp, LcdControl/main.cpp, LedControl/main.cpp, ServoControl/main.cpp, SoundControl/main.cpp, TofControl/main.cpp, TouchControl/main.cpp, and TtsControl/main.cpp.