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

Functions

int8_t init ()
 Initialize the arm subsystem.
int8_t dispose ()
 Dispose/stop the arm subsystem and release resources.
bool isActive ()
 Check whether the subsystem is active (initialized and running).
void Abort (ArmSide side)
 Abort the current operation for a given side.
uint16_t getMaxAngle ()
 Get maximum allowed angle for the arm.
int8_t setAngle (uint16_t id, ArmSide side, uint8_t speed, uint16_t angle, bool with_brake=false)
 Command the arm to move to an angle.
ArmState getState (ArmSide side)
 Get current operation state for a side.
std::vector< ArmDatagetCurrentAngle (ArmSide side)
 Get the current angle(s) for the requested side(s).
float getVersion ()
 Get SDK/library version.

Function Documentation

◆ Abort()

void ArmControl::Abort ( ArmSide side)

Abort the current operation for a given side.

This is intended as an emergency/stop action.

Parameters
sideArm side to abort (LEFT/RIGHT/BOTH).

◆ dispose()

int8_t ArmControl::dispose ( )

Dispose/stop the arm subsystem and release resources.

Returns
Status code:
  • 0 : success
  • 1 : not initialized
Examples
ArmControl/main.cpp.

◆ getCurrentAngle()

std::vector< ArmData > ArmControl::getCurrentAngle ( ArmSide side)

Get the current angle(s) for the requested side(s).

Parameters
sideRequested side (LEFT/RIGHT/BOTH).
Returns
Vector of ArmData entries. If side == BOTH, the vector may contain 2 elements.
Examples
ArmControl/main.cpp.

◆ getMaxAngle()

uint16_t ArmControl::getMaxAngle ( )

Get maximum allowed angle for the arm.

Returns
Maximum angle (degrees).

◆ getState()

ArmState ArmControl::getState ( ArmSide side)

Get current operation state for a side.

Parameters
sideArm side.
Returns
Current ArmState.
Examples
ArmControl/main.cpp.

◆ getVersion()

float ArmControl::getVersion ( )

Get SDK/library version.

Format note from original header: 0.XYZ (3 digits after major).

Returns
Version as float.
Examples
ArmControl/main.cpp.

◆ init()

int8_t ArmControl::init ( )

Initialize the arm subsystem.

This must be called once before other control functions.

Returns
Status code:
  • 0 : success
  • 1 : already initialized
  • -1 : left servo enable pin set failed
  • -2 : right servo enable pin set failed
Note
After successful init(), isActive() should return true.
Examples
ArmControl/main.cpp.

◆ isActive()

bool ArmControl::isActive ( )

Check whether the subsystem is active (initialized and running).

Returns
true if active, false otherwise.

◆ setAngle()

int8_t ArmControl::setAngle ( uint16_t id,
ArmSide side,
uint8_t speed,
uint16_t angle,
bool with_brake = false )

Command the arm to move to an angle.

The operation is handled asynchronously (non-blocking). Results are reported via:

Parameters
idUser-defined command identifier (echoed back in completion/error callbacks).
sideArm side to move (LEFT/RIGHT/BOTH).
speedSpeed percentage in range [1..100].
angleTarget angle in degrees in range [0..getMaxAngle()].
with_brakeIf true, apply brake/hold behavior at target (implementation-defined).
Returns
Status code:
  • 0 : success (command accepted)
  • -1 : not active (init() not called or subsystem not running)
  • -2 : speed out of range
  • -3 : angle out of range
Warning
This function is non-blocking; it does not wait for motion completion.
Examples
ArmControl/main.cpp.