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

Functions

int8_t init ()
 Initialize the servo subsystem.
int8_t setServo (uint16_t id, ServoId channel, float angle, uint8_t speed, bool invert)
 Set a servo target angle.
int8_t abort (ServoId channel)
 Abort an ongoing servo action.
int8_t release (ServoId channel)
 Release servo hold (disable holding torque) for a channel.
int8_t dispose ()
 Dispose/stop the servo subsystem and release resources.
float getVersion ()
 Get current library version.

Function Documentation

◆ abort()

int8_t ServoControl::abort ( ServoId channel)

Abort an ongoing servo action.

Parameters
channelServo channel to abort.
Returns
Status code:
  • 0 : success
  • -1 : failed

◆ dispose()

int8_t ServoControl::dispose ( )

Dispose/stop the servo subsystem and release resources.

Returns
Status code (implementation-defined).
Examples
ServoControl/main.cpp.

◆ getVersion()

float ServoControl::getVersion ( )

Get current library version.

Original note: format 0.XYZ (3 digits after major).

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

◆ init()

int8_t ServoControl::init ( )

Initialize the servo subsystem.

Returns
Status code:
  • 0 : success
  • -1 : SERVO_0 setup failed
  • -2 : SERVO_1 setup failed
Examples
ServoControl/main.cpp.

◆ release()

int8_t ServoControl::release ( ServoId channel)

Release servo hold (disable holding torque) for a channel.

Parameters
channelServo channel to release.
Returns
Status code:
  • 0 : success
  • -1 : failed
  • -2 : busy/running
Examples
ServoControl/main.cpp.

◆ setServo()

int8_t ServoControl::setServo ( uint16_t id,
ServoId channel,
float angle,
uint8_t speed,
bool invert )

Set a servo target angle.

Parameters
idUser-defined action identifier (forwarded to event callbacks).
channelServo channel to control.
angleTarget angle (degrees).
speedSpeed percentage (valid range: 0..100).
invertIf true, invert the direction/orientation for the given channel.
Returns
Status code:
  • 0 : success
  • -1 : max angle exceed error
  • -2 : speed range error (0..100)
  • -3 : undefined channel
  • -4 : not initialized
Examples
ServoControl/main.cpp.