EASY-ROB™ Kernel  v8.606
Static Public Member Functions | List of all members
ERK_CAPI_AUTOPATH Class Reference

Method for collision free path planning. More...

#include <erk_capi.h>

Inheritance diagram for ERK_CAPI_AUTOPATH:
ERK_CAPI

Static Public Member Functions

static DLLAPI char *ER_STDCALL AutoPathVer (void)
 AutoPath Version. More...
 
static DLLAPI int ER_STDCALL AutoPathSetMem (AutoPath_ConfigurationSpace *apcs)
 allocate memory for AutoPath_ConfigurationSpace data depending on nConfig
see example AutoPathInit() More...
 
static DLLAPI int ER_STDCALL AutoPathInit (AutoPath_ConfigurationSpace *apcs)
 Initialize AutoPath
Call this functions to setup the autopath configuration space
Parameter apcs defines the complete configuration for all used devices, such as
number of configurations up to AUTOPATH_SDK_KIN_DOFS, device handle for each configuration, device axis index, etc.
call AutoPathSetMem() first. More...
 
static DLLAPI int ER_STDCALL AutoPathFreeMem (AutoPath_ConfigurationSpace *apcs)
 free memory of AutoPath_ConfigurationSpace data
see example AutoPathInit() More...
 
static DLLAPI int ER_STDCALL AutoPathTerminate (AutoPath_ConfigurationSpace *apcs)
 Terminate AutoPath
call AutoPathFreeMem() first, see example AutoPathInit() More...
 
static DLLAPI int ER_STDCALL AutoPath_SetCallback_CheckConstraints (BOOL(*ptr_CheckConstraints)(int, void *))
 Defines a callback function to check constraints during AutoPath calculation
The callback function is called with two parameters
Parameter action in Callback_API_CheckConstraints() is a bitwise inclusive OR operator (|) of
AUTOPATH_SDK_CHK_CONSTRAINT_UNDEF, AUTOPATH_SDK_CHK_CONSTRAINT_START, AUTOPATH_SDK_CHK_CONSTRAINT_DEST, AUTOPATH_SDK_CHK_CONSTRAINT_COLLISION, AUTOPATH_SDK_CHK_CONSTRAINT_SWE, AUTOPATH_SDK_CHK_CONSTRAINT_CART_SPACE, AUTOPATH_SDK_CHK_CONSTRAINT_ISCFREE
Parameter vapcs in Callback_API_CheckConstraints() defines the autopath configuration space AutoPath_ConfigurationSpace
see example AutoPathInit() More...
 
static DLLAPI int ER_STDCALL SetPoseStart (double *pose_start)
 Set start configuration
Remarks
This pose must be valid - collision free, based on callback function "ptr_CheckConstraints" to check constraints. More...
 
static DLLAPI int ER_STDCALL SetPoseEnd (double *pose_end)
 Set end configuration
Remarks
This pose must be valid - collision free, based on callback function "ptr_CheckConstraints" to check constraints. More...
 
static DLLAPI int ER_STDCALL FindPath (void)
 Start motion planner, find a collision free path between start and end pose
In each step, the callback function "ptr_CheckConstraints" is called, to check constraints If the target is reached, the callback function is called with action parameter AUTOPATH_SDK_STATUS_MP_SUCCESS. More...
 
static DLLAPI double *ER_STDCALL GetConfigurationPose (void)
 current configuration pose during FindPath Process return pointer, size nConfig More...
 
static DLLAPI double *ER_STDCALL GetStartPose (void)
 Get Start Pose return pointer, size nConfig. More...
 
static DLLAPI double *ER_STDCALL GetEndPose (void)
 Get End Pose return pointer, size nConfig. More...
 
static DLLAPI double *ER_STDCALL GetAxisConstraintsMin (void)
 Get minimum axis constraints return pointer, size nConfig. More...
 
static DLLAPI double *ER_STDCALL GetAxisConstraintsMax (void)
 Get maximum axis constraints return pointer, size nConfig. More...
 
static DLLAPI int ER_STDCALL AbortPlanning (void)
 Abort path planning
use GetPlanningStatus() More...
 
static DLLAPI int ER_STDCALL GetPlanningStatus (void)
 Get path planning status
The planning status is one of
AUTOPATH_SDK_STATUS_MP_IDLE
AUTOPATH_SDK_STATUS_MP_RUNNING. More...
 
static DLLAPI int ER_STDCALL GetNumberOfWayPoints (void)
 Get number of calculated way points, including start and end pose
call this method after FindPath() succeeded. More...
 
static DLLAPI int ER_STDCALL GetWayPointDof (void)
 Get dof of calculated way points. More...
 
static DLLAPI double *ER_STDCALL GetWayPoint (int idx)
 Get way point. More...
 
static DLLAPI int ER_STDCALL ClearAllWayPoints (void)
 Clear all way points. More...
 
static DLLAPI int ER_STDCALL SetAccuracy (UINT accuracy)
 Set accuracy. More...
 
static DLLAPI int ER_STDCALL SetAxisConstraints (int axisBit=AUTOPATH_SDK_AXIS_BIT_DOF6, int setting=0, double qConstraintMin=0, double qConstraintMax=0)
 Set axis constraints
Parameter setting is a bitwise inclusive OR operator (|) of AUTOPATH_SDK_CONSTRAINT_RESET, AUTOPATH_SDK_CONSTRAINT_MIN, AUTOPATH_SDK_CONSTRAINT_MAX. More...
 
static DLLAPI int ER_STDCALL SetAxisPriority (int axisBit, int priority)
 Set axis priority. More...
 
static DLLAPI int ER_STDCALL SetAxisEnable (int axisBit, int enable)
 Set axis enable. More...
 
static DLLAPI int ER_STDCALL SetParameter (int ap_option, int ap_value)
 Set parameter Paramter ap_option is one of
AUTOPATH_SDK_PARAMETER_DYNADJUST
AUTOPATH_SDK_PARAMETER_ALGORITHM
AUTOPATH_SDK_PARAMETER_NTREES
AUTOPATH_SDK_PARAMETER_MIN_NUM_WAYPOINTS
AUTOPATH_SDK_PARAMETER_FORCE_DETERM_BEHAVIOR
AUTOPATH_SDK_PARAMETER_LIMIT_REVOLUTE_JNT_CSPACE
AUTOPATH_SDK_PARAMETER_THREAD_PRIORITY
AUTOPATH_SDK_PARAMETER_THREAD_EXECUTION
AUTOPATH_SDK_PARAMETER_SEED_VALUE. More...
 
static DLLAPI int ER_STDCALL GetParameter (int ap_option)
 Get parameter Paramter ap_option is one of
AUTOPATH_SDK_PARAMETER_DYNADJUST
AUTOPATH_SDK_PARAMETER_ALGORITHM
AUTOPATH_SDK_PARAMETER_NTREES
AUTOPATH_SDK_PARAMETER_MIN_NUM_WAYPOINTS
AUTOPATH_SDK_PARAMETER_FORCE_DETERM_BEHAVIOR
AUTOPATH_SDK_PARAMETER_LIMIT_REVOLUTE_JNT_CSPACE
AUTOPATH_SDK_PARAMETER_THREAD_PRIORITY
AUTOPATH_SDK_PARAMETER_THREAD_EXECUTION
AUTOPATH_SDK_PARAMETER_SEED_VALUE. More...
 
static DLLAPI int ER_STDCALL GetResults (int ap_result)
 Get results Paramter ap_result is one of
AUTOPATH_SDK_RESULT_CHECKS
AUTOPATH_SDK_RESULT_SECONDS
AUTOPATH_SDK_RESULT_CPS
AUTOPATH_SDK_RESULT_CFREE
AUTOPATH_SDK_RESULT_COBSTACLE
AUTOPATH_SDK_RESULT_CDENSITY
AUTOPATH_SDK_RESULT_DSECONDS
AUTOPATH_SDK_RESULT_SEED_VALUE
AUTOPATH_SDK_RESULT_QUALITY_INDEX
AUTOPATH_SDK_RESULT_QUALITY_INDEX_STD_DEV. More...
 

Additional Inherited Members

- Static Public Attributes inherited from ERK_CAPI
static ERK_CAPI_ADMIN erk_capi_admin
 Method class to administrate this Robotics Simulation Kernel. More...
 
static ERK_CAPI_DEVICES erk_capi_devices
 Method class to create, attach, update devices, for kinematics calculations and for motion planning and -execution. More...
 
static ERK_CAPI_SIM erk_capi_sim
 Method class for simulation settings. More...
 
static ERK_CAPI_AUTOPATH erk_capi_autopath
 Method class for collision free path planning. More...
 
static ERK_CAPI_TARGETS erk_capi_targets
 Method class for paths and tags. More...
 
static ERK_CAPI_GEO erk_capi_geo
 Method class to handle 3D Geometry Data. More...
 
static ERK_CAPI_SYS erk_capi_sys
 Method class for mathematical calculations, simulation status, units. More...
 

Detailed Description

Method for collision free path planning.

Member Function Documentation

◆ AbortPlanning()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::AbortPlanning ( void  )
static

Abort path planning
use GetPlanningStatus()

Return values
0- AUTOPATH_SDK_OK
1- AUTOPATH_SDK_ERROR

◆ AutoPath_SetCallback_CheckConstraints()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::AutoPath_SetCallback_CheckConstraints ( BOOL(*)(int, void *)  ptr_CheckConstraints)
static

Defines a callback function to check constraints during AutoPath calculation
The callback function is called with two parameters
Parameter action in Callback_API_CheckConstraints() is a bitwise inclusive OR operator (|) of
AUTOPATH_SDK_CHK_CONSTRAINT_UNDEF, AUTOPATH_SDK_CHK_CONSTRAINT_START, AUTOPATH_SDK_CHK_CONSTRAINT_DEST, AUTOPATH_SDK_CHK_CONSTRAINT_COLLISION, AUTOPATH_SDK_CHK_CONSTRAINT_SWE, AUTOPATH_SDK_CHK_CONSTRAINT_CART_SPACE, AUTOPATH_SDK_CHK_CONSTRAINT_ISCFREE
Parameter vapcs in Callback_API_CheckConstraints() defines the autopath configuration space AutoPath_ConfigurationSpace
see example AutoPathInit()

// Example:
// Callback function
static BOOL Callback_API_CheckConstraints_apcs(int action, void*vapcs)
// Return
// TRUE - constraints
// FALSE - constraints fulfilled
{
BOOL do_chk=FALSE;
switch (action) {
case AUTOPATH_SDK_CHK_CONSTRAINT_START: // SetPoseStart()
case AUTOPATH_SDK_CHK_CONSTRAINT_DEST: // SetPoseEnd()
do_chk=TRUE;
break;
// target reached
break;
}
...
if (do_chk)
{
double* currentConfiguration = erk_autopath.GetConfigurationPose();
result = Check Constraints_in_HostApp(...)
}
...
return result; // true - violated, false - ok
}
...
AutoPath_ConfigurationSpace *papcs = new AutoPath_ConfigurationSpace;
...
erk_autopath.AutoPathInit(papcs);
...
// Set callback function pointer
erk_autopath.AutoPath_SetCallback_CheckConstraints(Callback_API_CheckConstraints_apcs);
...
// do autopath calculation ....
erk_autoPath.FindPath();
// get way points
...
// Reset callback function pointer
erk_autopath.AutoPath_SetCallback_CheckConstraints(NULL);
...
Parameters
[in]ptr_CheckConstraints(int) callback function pointer
Return values
0- Ok
1- Error

◆ AutoPathFreeMem()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::AutoPathFreeMem ( AutoPath_ConfigurationSpace apcs)
static

free memory of AutoPath_ConfigurationSpace data
see example AutoPathInit()

Parameters
[in]apcsautopath configuration space AutoPath_ConfigurationSpace
Return values
0- AUTOPATH_SDK_OK - OK
1- AUTOPATH_SDK_ERROR - Error, AutoPath initialization failed

◆ AutoPathInit()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::AutoPathInit ( AutoPath_ConfigurationSpace apcs)
static

Initialize AutoPath
Call this functions to setup the autopath configuration space
Parameter apcs defines the complete configuration for all used devices, such as
number of configurations up to AUTOPATH_SDK_KIN_DOFS, device handle for each configuration, device axis index, etc.
call AutoPathSetMem() first.

// Example:
int nConfig = 6;
papcs->initialized = 0;
papcs->nConfig = nConfig;
papcs->deviceHandle = NULL;
papcs->deviceAxisIdx = NULL;
papcs->AxisEnable = NULL;
papcs->AxisPriority = NULL;
papcs->AxisRotTrans = NULL;
papcs->AxisType = NULL;
papcs->ConstraintMin = NULL;
papcs->ConstraintMax = NULL;
papcs->SpeedWeight = NULL;
papcs->DistanceWeight = NULL;
papcs->UsrData = NULL;
...
erk_autopath.AutoPathSetMem(papcs); // allocate memory depending on nConfig
...
// set AutoPath_ConfigurationSpace data for each configuration
for (int i=0;i<papcs->nConfig;++i)
{
papcs->deviceHandle[i] = er_hnd[i];
papcs->deviceAxisIdx[i] = i;
papcs->AxisEnable[i] = 1;
papcs->AxisPriority[i] = 50;
papcs->AxisType[i] = AUTOPATH_SDK_AXIS_TYPE_ROBOT; // Robot
papcs->ConstraintMin[i] = ...;
papcs->ConstraintMax[i] = ...;
papcs->SpeedWeight[i] = 1;
papcs->DistanceWeight[i]= 1;
}
erk_autopath.AutoPathInit(papcs); // Initialize AutoPath
...
// Set callback function pointer
erk_autopath.AutoPath_SetCallback_CheckConstraints(Callback_API_CheckConstraints_apcs);
...
// define additional settings
...
// define start and destination
// -> SetPoseStart(), SetPoseEnd()
// do autopath calculation
// -> FindPath();
// get results
// -> GetNumberOfWayPoints(), GetWayPoint(), GetResults()
...
// Verify results, move along all waypoints
...
// Clear all WayPoints
// -> ClearAllWayPoints()
...
// Reset callback function pointer
erk_autopath.AutoPath_SetCallback_CheckConstraints(NULL);
...
// Terminate AutoPath
erk_autopath.AutoPathFreeMem(papcs); // free memory of AutoPath_ConfigurationSpace data
delete papcs;
papcs= NULL;
erk_autopath.AutoPathTerminate(papcs); // Terminate AutoPath
...
Parameters
[in]apcsautopath configuration space AutoPath_ConfigurationSpace
Return values
0- AUTOPATH_SDK_OK - OK
1- AUTOPATH_SDK_ERROR - Error, AutoPath initialization failed
2- AUTOPATH_SDK_INVALID_LICENSE - Error, AutoPath not licensed

◆ AutoPathSetMem()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::AutoPathSetMem ( AutoPath_ConfigurationSpace apcs)
static

allocate memory for AutoPath_ConfigurationSpace data depending on nConfig
see example AutoPathInit()

Parameters
[in]apcsautopath configuration space AutoPath_ConfigurationSpace
Return values
0- AUTOPATH_SDK_OK - OK
1- AUTOPATH_SDK_ERROR - Error, AutoPath initialization failed

◆ AutoPathTerminate()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::AutoPathTerminate ( AutoPath_ConfigurationSpace apcs)
static

Terminate AutoPath
call AutoPathFreeMem() first, see example AutoPathInit()

Parameters
[in]apcsautopath configuration space AutoPath_ConfigurationSpace
Return values
0- AUTOPATH_SDK_OK - OK
1- AUTOPATH_SDK_ERROR - Error, AutoPath initialization failed

◆ AutoPathVer()

static DLLAPI char* ER_STDCALL ERK_CAPI_AUTOPATH::AutoPathVer ( void  )
static

AutoPath Version.

Return values
versionAutoPath version number

◆ ClearAllWayPoints()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::ClearAllWayPoints ( void  )
static

Clear all way points.

Return values
0- AUTOPATH_SDK_OK
1- AUTOPATH_SDK_ERROR

◆ FindPath()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::FindPath ( void  )
static

Start motion planner, find a collision free path between start and end pose
In each step, the callback function "ptr_CheckConstraints" is called, to check constraints If the target is reached, the callback function is called with action parameter AUTOPATH_SDK_STATUS_MP_SUCCESS.

Return values
0- AUTOPATH_SDK_OK
1- AUTOPATH_SDK_ERROR

◆ GetAxisConstraintsMax()

static DLLAPI double* ER_STDCALL ERK_CAPI_AUTOPATH::GetAxisConstraintsMax ( void  )
static

Get maximum axis constraints return pointer, size nConfig.

◆ GetAxisConstraintsMin()

static DLLAPI double* ER_STDCALL ERK_CAPI_AUTOPATH::GetAxisConstraintsMin ( void  )
static

Get minimum axis constraints return pointer, size nConfig.

◆ GetConfigurationPose()

static DLLAPI double* ER_STDCALL ERK_CAPI_AUTOPATH::GetConfigurationPose ( void  )
static

current configuration pose during FindPath Process return pointer, size nConfig

◆ GetEndPose()

static DLLAPI double* ER_STDCALL ERK_CAPI_AUTOPATH::GetEndPose ( void  )
static

Get End Pose return pointer, size nConfig.

◆ GetNumberOfWayPoints()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::GetNumberOfWayPoints ( void  )
static

Get number of calculated way points, including start and end pose
call this method after FindPath() succeeded.

Return values
numberof way points

◆ GetParameter()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::GetParameter ( int  ap_option)
static

◆ GetPlanningStatus()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::GetPlanningStatus ( void  )
static

Get path planning status
The planning status is one of
AUTOPATH_SDK_STATUS_MP_IDLE
AUTOPATH_SDK_STATUS_MP_RUNNING.

Return values
planningstatus

◆ GetResults()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::GetResults ( int  ap_result)
static

Get results Paramter ap_result is one of
AUTOPATH_SDK_RESULT_CHECKS
AUTOPATH_SDK_RESULT_SECONDS
AUTOPATH_SDK_RESULT_CPS
AUTOPATH_SDK_RESULT_CFREE
AUTOPATH_SDK_RESULT_COBSTACLE
AUTOPATH_SDK_RESULT_CDENSITY
AUTOPATH_SDK_RESULT_DSECONDS
AUTOPATH_SDK_RESULT_SEED_VALUE
AUTOPATH_SDK_RESULT_QUALITY_INDEX
AUTOPATH_SDK_RESULT_QUALITY_INDEX_STD_DEV.

// Example:
...
char *ap_result_s[] = {"?","Checks","Seconds","CpS","CFree","CObstacle","CDensity","dSeconds","?","?","?"};
{
int ap_result=i;
int ap_value = erk_autopath.GetResults(ap_result);
_info_line_msg(0," GetResults(%s) = %d",ap_result_s[ap_result],ap_value);
}
int seed_value = erk_autopath.GetResults(AUTOPATH_SDK_RESULT_SEED_VALUE); // Random starting seed value to influence behavior
int quality_index = erk_autopath.GetResults(AUTOPATH_SDK_RESULT_QUALITY_INDEX); // Quality Index based on calculated way points
int quality_index_std_dev = erk_autopath.GetResults(AUTOPATH_SDK_RESULT_QUALITY_INDEX_STD_DEV); // Quality Index Standard Deviation, based on calculated way points
_info_line_msg(0," Seed_Value = %d Thread_Exec %s",seed_value,thread_exec?"Yes":"No");
...
Parameters
[in]ap_result- autopath result
Return values
0- AUTOPATH_SDK_OK
1- AUTOPATH_SDK_ERROR

◆ GetStartPose()

static DLLAPI double* ER_STDCALL ERK_CAPI_AUTOPATH::GetStartPose ( void  )
static

Get Start Pose return pointer, size nConfig.

◆ GetWayPoint()

static DLLAPI double* ER_STDCALL ERK_CAPI_AUTOPATH::GetWayPoint ( int  idx)
static

Get way point.

Parameters
[in]idx[0.. number of way points-1]
Return values
pointer

◆ GetWayPointDof()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::GetWayPointDof ( void  )
static

Get dof of calculated way points.

Return values
dofof way points

◆ SetAccuracy()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::SetAccuracy ( UINT  accuracy)
static

Set accuracy.

Parameters
[in]accuracy[1..100]
Return values
0- AUTOPATH_SDK_OK
1- AUTOPATH_SDK_ERROR

◆ SetAxisConstraints()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::SetAxisConstraints ( int  axisBit = AUTOPATH_SDK_AXIS_BIT_DOF6,
int  setting = 0,
double  qConstraintMin = 0,
double  qConstraintMax = 0 
)
static

Set axis constraints
Parameter setting is a bitwise inclusive OR operator (|) of AUTOPATH_SDK_CONSTRAINT_RESET, AUTOPATH_SDK_CONSTRAINT_MIN, AUTOPATH_SDK_CONSTRAINT_MAX.

Parameters
[in]axisBit- a bitwise inclusive OR operator (|) of AUTOPATH_SDK_AXIS_BIT_1 ... AUTOPATH_SDK_AXIS_BIT_24
[in]setting
[in]qConstraintMin- size of nConfig
[in]qConstraintMax- size of nConfig
Return values
0- AUTOPATH_SDK_OK
1- AUTOPATH_SDK_ERROR

◆ SetAxisEnable()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::SetAxisEnable ( int  axisBit,
int  enable 
)
static

Set axis enable.

Return values
0- AUTOPATH_SDK_OK
1- AUTOPATH_SDK_ERROR

◆ SetAxisPriority()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::SetAxisPriority ( int  axisBit,
int  priority 
)
static

Set axis priority.

Parameters
[in]axisBit
[in]priority[1..50..100]
Return values
0- AUTOPATH_SDK_OK
1- AUTOPATH_SDK_ERROR

◆ SetParameter()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::SetParameter ( int  ap_option,
int  ap_value 
)
static

◆ SetPoseEnd()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::SetPoseEnd ( double *  pose_end)
static

Set end configuration
Remarks
This pose must be valid - collision free, based on callback function "ptr_CheckConstraints" to check constraints.

Parameters
[in]pose_endpointer to start pose, maximum size AUTOPATH_SDK_KIN_DOFS
Return values
0- AUTOPATH_SDK_OK
1- AUTOPATH_SDK_ERROR

◆ SetPoseStart()

static DLLAPI int ER_STDCALL ERK_CAPI_AUTOPATH::SetPoseStart ( double *  pose_start)
static

Set start configuration
Remarks
This pose must be valid - collision free, based on callback function "ptr_CheckConstraints" to check constraints.

Parameters
[in]pose_startpointer to start pose, maximum size AUTOPATH_SDK_KIN_DOFS
Return values
0- AUTOPATH_SDK_OK
1- AUTOPATH_SDK_ERROR

The documentation for this class was generated from the following file: