![]() |
Doly C++ SDK v1.00
|
Functions | |
| int8_t | 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 | dispose (bool dispose_IMU) |
| Dispose/shutdown drive module and release resources. | |
| bool | isActive () |
| Check whether the module is initialized and active. | |
| void | Abort () |
| Abort current drive operation immediately. | |
| bool | freeDrive (uint8_t speed, bool isLeft, bool toForward) |
| Manual motor drive (low-level). | |
| bool | 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 | 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 | 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 | getPosition () |
| Get current estimated position. | |
| void | resetPosition () |
| Reset current position estimate to (0, 0, 0) (implementation-defined fields). | |
| DriveState | getState () |
| Get current drive state. | |
| float | getRPM (bool isLeft) |
| Get current motor RPM. | |
| float | getVersion () |
| Get current library version. | |
| void DriveControl::Abort | ( | ) |
Abort current drive operation immediately.
Typically used as an emergency stop for autonomous movement. Completion/error events may still be emitted depending on implementation.
| int8_t DriveControl::dispose | ( | bool | dispose_IMU | ) |
Dispose/shutdown drive module and release resources.
| dispose_IMU | If true, shuts down the IMU module as well. |
| bool DriveControl::freeDrive | ( | uint8_t | speed, |
| bool | isLeft, | ||
| bool | toForward ) |
Manual motor drive (low-level).
| speed | Motor speed percent (0..100). |
| isLeft | true = left motor, false = right motor. |
| toForward | true = forward, false = backward. |
| Position DriveControl::getPosition | ( | ) |
Get current estimated position.
| float DriveControl::getRPM | ( | bool | isLeft | ) |
Get current motor RPM.
| isLeft | true = left motor, false = right motor. |
| DriveState DriveControl::getState | ( | ) |
| float DriveControl::getVersion | ( | ) |
Get current library version.
Original note: format 0.XYZ (3 digits after major).
| 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).
| id | User command id (returned in events/callbacks). |
| mm | Distance value (named "mm" in API; ensure your implementation uses millimeters). |
| speed | Requested speed percent (0..100). |
| toForward | true forward / false backward. |
| with_brake | Brake at the end. |
| acceleration_interval | Acceleration step interval (0 = disabled). |
| control_speed | Enable speed control dynamically. |
| control_force | Enable force/traction control. |
| 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).
| id | User command id (returned in events/callbacks). |
| rotateAngle | Rotation angle in degrees (sign convention is implementation-defined). |
| from_center | true = rotate around center, false = rotate around a wheel/edge (implementation-defined). |
| speed | Requested speed percent (0..100). |
| toForward | Direction preference (implementation-defined for rotation). |
| with_brake | Brake at the end. |
| acceleration_interval | Acceleration step interval (0 = disabled). |
| control_speed | Enable speed control dynamically. |
| control_force | Enable force/traction control. |
| 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).
| id | User command id (returned in events/callbacks). |
| x | Target X in your Position coordinate system (units are application-defined). |
| y | Target Y in your Position coordinate system (same unit as x). |
| speed | Requested speed percent (0..100). |
| toForward | Direction preference for the move. |
| with_brake | If true, brake at the end of motion. |
| acceleration_interval | Acceleration step interval (0 = disabled). |
| control_speed | Enable speed control dynamically. |
| control_force | Enable force/traction control (default true). |
| 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.
IMU offsets are calibration values stored by the platform.
| imu_off_gx | IMU gyro X offset (calibration). |
| imu_off_gy | IMU gyro Y offset (calibration). |
| imu_off_gz | IMU gyro Z offset (calibration). |
| imu_off_ax | IMU accel X offset (calibration). |
| imu_off_ay | IMU accel Y offset (calibration). |
| imu_off_az | IMU accel Z offset (calibration). |
| bool DriveControl::isActive | ( | ) |
Check whether the module is initialized and active.
| void DriveControl::resetPosition | ( | ) |
Reset current position estimate to (0, 0, 0) (implementation-defined fields).