Doly C++ SDK v1.00
Loading...
Searching...
No Matches
DriveControl.h File Reference

Public API for Doly drive motion control. More...

#include <cstdint>
#include "DriveEventListener.h"
#include "Helper.h"

Go to the source code of this file.

Namespaces

namespace  DriveControl

Functions

int8_t DriveControl::init (int16_t imu_off_gx=0, int16_t imu_off_gy=0, int16_t imu_off_gz=0, int16_t imu_off_ax=0, int16_t imu_off_ay=0, int16_t imu_off_az=0)
 Initialize the drive control module.
int8_t DriveControl::dispose (bool dispose_IMU)
 Dispose/shutdown drive module and release resources.
bool DriveControl::isActive ()
 Check whether the module is initialized and active.
void DriveControl::Abort ()
 Abort current drive operation immediately.
bool DriveControl::freeDrive (uint8_t speed, bool isLeft, bool toForward)
 Manual motor drive (low-level).
bool DriveControl::goXY (uint16_t id, int16_t x, int16_t y, uint8_t speed, bool toForward, bool with_brake=false, uint8_t acceleration_interval=0, bool control_speed=false, bool control_force=true)
 Autonomous drive to an (x, y) target (high-level).
bool DriveControl::goDistance (uint16_t id, uint16_t mm, uint8_t speed, bool toForward, bool with_brake=false, uint8_t acceleration_interval=0, bool control_speed=false, bool control_force=true)
 Autonomous drive for a fixed distance (high-level).
bool DriveControl::goRotate (uint16_t id, float rotateAngle, bool from_center, uint8_t speed, bool toForward, bool with_brake=false, uint8_t acceleration_interval=0, bool control_speed=false, bool control_force=true)
 Autonomous rotate (high-level).
Position DriveControl::getPosition ()
 Get current estimated position.
void DriveControl::resetPosition ()
 Reset current position estimate to (0, 0, 0) (implementation-defined fields).
DriveState DriveControl::getState ()
 Get current drive state.
float DriveControl::getRPM (bool isLeft)
 Get current motor RPM.
float DriveControl::getVersion ()
 Get current library version.

Detailed Description

Public API for Doly drive motion control.

Design notes:

  • Singleton-style control (namespace API; no instances)
  • Works only after successful init()
  • Events are delivered via DriveEvent / DriveEventListener

Threading notes:

  • State changes and completion/error events are reported asynchronously