DRD header file. More...
Functions | |
int __API | drdOpen () |
int __API | drdOpenID (int index) |
int __API | drdSetDevice (char ID) |
int __API | drdGetDeviceID () |
int __API | drdClose (char ID=-1) |
bool __API | drdIsRunning (char ID=-1) |
bool __API | drdIsMoving (char ID=-1) |
bool __API | drdIsFiltering (char ID=-1) |
double __API | drdGetTime () |
void __API | drdSleep (double sec) |
void __API | drdWaitForTick (char ID=-1) |
bool __API | drdIsInitialized (char ID=-1) |
int __API | drdAutoInit (char ID=-1) |
int __API | drdGetPos (double *px, double *py, double *pz, char ID=-1) |
double __API | drdGetCtrlFreq (char ID=-1) |
int __API | drdStart (char ID=-1) |
int __API | drdEnableFilter (bool on, char ID=-1) |
int __API | drdMoveToPos (double px, double py, double pz, bool block=true, char ID=-1) |
int __API | drdMoveToEnc (int enc0, int enc1, int enc2, bool block=true, char ID=-1) |
int __API | drdTrackPos (double px, double py, double pz, char ID=-1) |
int __API | drdTrackEnc (int enc0, int enc1, int enc2, char ID=-1) |
int __API | drdHold (char ID=-1) |
int __API | drdStop (char ID=-1) |
int __API | drdSetPriorities (int prio, int ctrlprio, char ID=-1) |
void __API | drdSetEncPGain (double gain, char ID=-1) |
double __API | drdGetEncPGain (char ID=-1) |
int __API | drdSetEncMoveParam (double amax, double vmax, double jerk, char ID=-1) |
int __API | drdSetEncTrackParam (double amax, double vmax, double jerk, char ID=-1) |
int __API | drdSetPosMoveParam (double amax, double vmax, double jerk, char ID=-1) |
int __API | drdSetPosTrackParam (double amax, double vmax, double jerk, char ID=-1) |
int __API | drdGetEncMoveParam (double *amax, double *vmax, double *jerk, char ID=-1) |
int __API | drdGetEncTrackParam (double *amax, double *vmax, double *jerk, char ID=-1) |
int __API | drdGetPosMoveParam (double *amax, double *vmax, double *jerk, char ID=-1) |
int __API | drdGetPosTrackParam (double *amax, double *vmax, double *jerk, char ID=-1) |
DRD header file.
int __API drdAutoInit | ( | char | ID | ) |
Performs automatic initialization of that particular robot by robotically moving to a known position and reseting encoder counters to their correct values.
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdClose | ( | char | ID | ) |
Close the connection to a particular device.
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdEnableFilter | ( | bool | on, |
char | ID | ||
) |
Enable or disable motion filtering for subsequent calls to drdTrackPos() or drdTrackEnc().
on | true to enable motion filtering, false to disable it |
ID | [default=-1] device ID (see multiple devices section for details) |
double __API drdGetCtrlFreq | ( | char | ID | ) |
This function returns the average refresh rate of the control loop (in kHz) since the function was last called.
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdGetDeviceID | ( | ) |
Return the ID of the current default device.
int __API drdGetEncMoveParam | ( | double * | amax, |
double * | vmax, | ||
double * | jerk, | ||
char | ID | ||
) |
Retrieve encoder positioning trajectory generation parameters.
amax | [out]max acceleration (m/s2) |
vmax | [out]max velocity (m/s) |
jerk | [out]jerk (m/s3) |
ID | [default=-1] device ID (see multiple devices section for details) |
double __API drdGetEncPGain | ( | char | ID | ) |
Retrieve the P term of the PID controller that regulates joint positions.
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdGetEncTrackParam | ( | double * | amax, |
double * | vmax, | ||
double * | jerk, | ||
char | ID | ||
) |
Retrieve encoder tracking trajectory generation parameters.
amax | [out]max acceleration (m/s2) |
vmax | [out]max velocity (m/s) |
jerk | [out]jerk (m/s3) |
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdGetPos | ( | double * | px, |
double * | py, | ||
double * | pz, | ||
char | ID | ||
) |
Retrieve the position of the end-effector in cartesian coordinates. Please refer to your device user manual for more information on your device coordinate system.
px | [out] device position on the X axis in [m] |
py | [out] device position on the Y axis in [m] |
pz | [out] device position on the Z axis in [m] |
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdGetPosMoveParam | ( | double * | amax, |
double * | vmax, | ||
double * | jerk, | ||
char | ID | ||
) |
Retrieve cartesian positioning trajectory generation parameters.
amax | [out]max acceleration (m/s2) |
vmax | [out]max velocity (m/s) |
jerk | [out]jerk (m/s3) |
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdGetPosTrackParam | ( | double * | amax, |
double * | vmax, | ||
double * | jerk, | ||
char | ID | ||
) |
Retrieve cartesian tracking trajectory generation parameters.
amax | [out]max acceleration (m/s2) |
vmax | [out]max velocity (m/s) |
jerk | [out]jerk (m/s3) |
ID | [default=-1] device ID (see multiple devices section for details) |
double __API drdGetTime | ( | ) |
Returns the current value from the high-resolution system counter in [s]. The resolution of the system counter may be machine-dependant, as it usually derived from one of the CPU clocks signals. The time returned is guaranteed to be monotonous.
int __API drdHold | ( | char | ID | ) |
Immediately make the robot hold its current position. All motion commands are abandoned.
ID | [default=-1] device ID (see multiple devices section for details) |
bool __API drdIsFiltering | ( | char | ID | ) |
Checks whether the particular robot control thread is applying a motion filter while tracking a target using drdTrackPos() or drdTrackEnc().
ID | [default=-1] device ID (see multiple devices section for details) |
bool __API drdIsInitialized | ( | char | ID | ) |
Checks the initialization status of a particular robot. The initialization status reflects the status of the controller RESET LED. The robot can be (re)initialized by calling drdAutoInit().
ID | [default=-1] device ID (see multiple devices section for details) |
bool __API drdIsMoving | ( | char | ID | ) |
Checks whether the particular robot is moving (following a call to drdMoveToPos(), drdMoveToEnc(), drdTrackPos() or drdTrackEnc()), as opposed to holding the target position after successfully reaching it.
ID | [default=-1] device ID (see multiple devices section for details) |
bool __API drdIsRunning | ( | char | ID | ) |
Checks the state of the robotic control thread for a particular device.
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdMoveToEnc | ( | int | enc0, |
int | enc1, | ||
int | enc2, | ||
bool | block, | ||
char | ID | ||
) |
Send the robot end-effector to a desired encoder position. The motion follows a straight line in the encoder space, with smooth acceleration/deceleration. The acceleration and velocity profiles can be controlled by adjusting the trajectory generation parameters.
enc0 | target encoder position on axis 0 [] |
enc1 | target encoder position on axis 1 [] |
enc2 | target encoder position on axis 2 [] |
block | if true, the call blocks until the destination is reached. If false, the call returns immediately. |
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdMoveToPos | ( | double | px, |
double | py, | ||
double | pz, | ||
bool | block, | ||
char | ID | ||
) |
Send the robot end-effector to a desired cartesian position. The motion follows a straight line, with smooth acceleration/deceleration. The acceleration and velocity profiles can be controlled by adjusting the trajectory generation parameters.
px | target position on the X axis in [m] |
py | target position on the Y axis in [m] |
pz | target position on the Z axis in [m] |
block | if true, the call blocks until the destination is reached. If false, the call returns immediately. |
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdOpen | ( | ) |
Open a connection to the first compatible device connected to the system. If more than one device is connected, USB devices will always be opened before PCI devices. To open connections to multiple devices, use the drdOpenID() call.
int __API drdOpenID | ( | int | ID | ) |
Open a connection to one particular compatible device connected to the system. PCI-connected devices are opened first, followed by USB-connected devices. The order in which devices are opened is predictable and remains the same until system configuration changes.
ID | the device ID (must be between 0 and the number of devices connected to the system) |
int __API drdSetDevice | ( | char | ID | ) |
Select the default device that will receive the API commands. The API supports multiple devices. This routine allows the programmer to decide which device the API single_device_call single-device calls will address. Any subsequent API call that does not specifically mention the device ID in its parameter list will be sent to that device.
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdSetEncMoveParam | ( | double | amax, |
double | vmax, | ||
double | jerk, | ||
char | ID | ||
) |
Set encoder positioning trajectory generation parameters.
amax | max acceleration (m/s2) |
vmax | max velocity (m/s) |
jerk | jerk (m/s3) |
ID | [default=-1] device ID (see multiple devices section for details) |
void __API drdSetEncPGain | ( | double | gain, |
char | ID | ||
) |
Set the P term of the PID controller that regulates joint positions. In practice, this affects the stiffness of the regulation.
gain | P parameter of the PID regulator |
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdSetEncTrackParam | ( | double | amax, |
double | vmax, | ||
double | jerk, | ||
char | ID | ||
) |
Set encoder tracking trajectory generation parameters.
amax | max acceleration (m/s2) |
vmax | max velocity (m/s) |
jerk | jerk (m/s3) |
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdSetPosMoveParam | ( | double | amax, |
double | vmax, | ||
double | jerk, | ||
char | ID | ||
) |
Set cartesian positioning trajectory generation parameters.
amax | max acceleration (m/s2) |
vmax | max velocity (m/s) |
jerk | jerk (m/s3) |
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdSetPosTrackParam | ( | double | amax, |
double | vmax, | ||
double | jerk, | ||
char | ID | ||
) |
Set cartesian tracking trajectory generation parameters.
amax | max acceleration (m/s2) |
vmax | max velocity (m/s) |
jerk | jerk (m/s3) |
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdSetPriorities | ( | int | prio, |
int | ctrlprio, | ||
char | ID | ||
) |
This function makes it possible to adjust the priority of the control thread and the calling thread. Thread priority is system dependent, as described in thread priorities.
prio | calling thread priority level |
ctrlprio | control thread priority level |
ID | [default=-1] device ID (see multiple devices section for details) |
void __API drdSleep | ( | double | sec | ) |
Suspend the calling thread for a given duration specified in [s]. The sleep resolution is machine and OS dependent.
sec | sleep duration in [s] |
int __API drdStart | ( | char | ID | ) |
Start the robotic control loop for the given robot. The robot must be initialized (either manually or with drdAutoInit()) before drdStart() can be called successfully.
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdStop | ( | char | ID | ) |
Stop the robotic control loop for the given robot.
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdTrackEnc | ( | int | enc0, |
int | enc1, | ||
int | enc2, | ||
char | ID | ||
) |
Send the robot end-effector to a desired encoder position. If motion filters are enabled, the motion follows a smooth acceleration/deceleration constraint on each encoder axis. The acceleration and velocity profiles can be controlled by adjusting the trajectory generation parameters.
enc0 | target encoder position on axis 0 [] |
enc1 | target encoder position on axis 1 [] |
enc2 | target encoder position on axis 2 [] |
ID | [default=-1] device ID (see multiple devices section for details) |
int __API drdTrackPos | ( | double | px, |
double | py, | ||
double | pz, | ||
char | ID | ||
) |
Send the robot end-effector to a desired cartesian position. If motion filters are enabled, the motion follows a smooth acceleration/deceleration constraint on each cartesian axis. The acceleration and velocity profiles can be controlled by adjusting the trajectory generation parameters.
px | target position on the X axis in [m] |
py | target position on the Y axis in [m] |
pz | target position on the Z axis in [m] |
ID | [default=-1] device ID (see multiple devices section for details) |
void __API drdWaitForTick | ( | char | ID | ) |
Synchronization function: calling this function will block until the next iteration of the control loop begins.