Doly C++ SDK v1.00
Loading...
Searching...
No Matches
DriveControl.h
Go to the documentation of this file.
1#pragma once
2#include <cstdint>
4#include "Helper.h"
5
20
21namespace DriveControl
22{
41 int8_t init(int16_t imu_off_gx = 0, int16_t imu_off_gy = 0, int16_t imu_off_gz = 0,
42 int16_t imu_off_ax = 0, int16_t imu_off_ay = 0, int16_t imu_off_az = 0);
43
53 int8_t dispose(bool dispose_IMU);
54
59 bool isActive();
60
67 void Abort();
68
80 bool freeDrive(uint8_t speed, bool isLeft, bool toForward);
81
99 bool goXY(uint16_t id, int16_t x, int16_t y, uint8_t speed, bool toForward,
100 bool with_brake = false, uint8_t acceleration_interval = 0,
101 bool control_speed = false, bool control_force = true);
102
119 bool goDistance(uint16_t id, uint16_t mm, uint8_t speed, bool toForward,
120 bool with_brake = false, uint8_t acceleration_interval = 0,
121 bool control_speed = false, bool control_force = true);
122
140 bool goRotate(uint16_t id, float rotateAngle, bool from_center, uint8_t speed, bool toForward,
141 bool with_brake = false, uint8_t acceleration_interval = 0,
142 bool control_speed = false, bool control_force = true);
143
149
154
160
166 float getRPM(bool isLeft);
167
175 float getVersion();
176} // namespace DriveControl
Public API types and listener interface for DriveControl.
Shared helper utilities and common types used across the Doly SDK.
DriveState
High-level state of a drive operation.
Definition DriveEventListener.h:61
Definition DriveControl.h:22
bool freeDrive(uint8_t speed, bool isLeft, bool toForward)
Manual motor drive (low-level).
int8_t dispose(bool dispose_IMU)
Dispose/shutdown drive module and release resources.
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).
void resetPosition()
Reset current position estimate to (0, 0, 0) (implementation-defined fields).
Position getPosition()
Get current estimated position.
float getRPM(bool isLeft)
Get current motor RPM.
bool isActive()
Check whether the module is initialized and active.
DriveState getState()
Get current drive state.
void Abort()
Abort current drive operation immediately.
float getVersion()
Get current library version.
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.
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).
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).
3D pose-like position with heading and integer XY coordinates.
Definition Helper.h:28