EASY-ROBâ„¢ Kernel
v9.304
|
Method class for collision, tolerances, etc. More...
#include <erk_capi.h>
Static Public Member Functions | |
static DLLAPI int ER_STDCALL | erColl_BeginModel (ER_COLLISION_HND *er_coll_hnd, long n_tris) |
Creates a collision handle for one Model and preallocate memory for n_tris triangles. More... | |
static DLLAPI int ER_STDCALL | erColl_AddTri (ER_COLLISION_HND er_coll_hnd, double *p1, double *p2, double *p3, long id) |
Adds a triangle to a Model. call erColl_BeginModel() once to create a new unique model handle. More... | |
static DLLAPI int ER_STDCALL | erColl_EndModel (ER_COLLISION_HND er_coll_hnd) |
Stop building a Model. More... | |
static DLLAPI int ER_STDCALL | erColl_ChkCollision (ER_COLLISION_HND er_coll_hnd_1, DFRAME *iT_1, ER_COLLISION_HND er_coll_hnd_2, DFRAME *iT_2, long query_type=ER_COLL_QUERY_TYPE_COLLIDE, long contact_type=ER_COLL_FIRST_CONTACT, double rel_err=0, double abs_err=0, double tolerance=0) |
Perform the collision check of two Models. See also erColl_ChkCollision_res() to get the collision results immediately The query type query_type can be one of the following values.0: ER_COLL_QUERY_TYPE_UNDEF skip collision checks 1: ER_COLL_QUERY_TYPE_COLLIDE detects collision between two Models 2: ER_COLL_QUERY_TYPE_DISTANCE computes the distance between two Models 3: ER_COLL_QUERY_TYPE_TOLERANCE checks if distance between Models is <= tolerance The contact type contact_type is used for query type ER_COLL_QUERY_TYPE_COLLIDE and can be one of the following values.1: ER_COLL_ALL_CONTACTS , the erColl_GetResults_Collide() contains an array with all colliding triangle pairs ER_CollideResult. 2: ER_COLL_FIRST_CONTACT , the erColl_GetResults_Collide() array will only get the first colliding triangle pair found. Collide Detects collsion. This is the fastest method. Distance Computes minimum distance between two Models. This method takes the most time !!! Tolerances Specify tolerance for query type ER_COLL_QUERY_TYPE_DISTANCE or ER_COLL_QUERY_TYPE_TOLERANCEChecks if distance between Models is <= tolerance. Remarks If erColl_ChkCollision() returns with ER_COLL_DETECTED call, depending on the query type, one of the collision result functions erColl_GetResults_Collide(), erColl_GetResults_Distance() or erColl_GetResults_Tolerance() to receive more detailed information about the collision status. More... | |
static DLLAPI int ER_STDCALL | erColl_ChkCollision_res (ER_COLLISION_HND er_coll_hnd_1, DFRAME *iT_1, ER_COLLISION_HND er_coll_hnd_2, DFRAME *iT_2, long query_type=ER_COLL_QUERY_TYPE_COLLIDE, long contact_type=ER_COLL_FIRST_CONTACT, double rel_err=0, double abs_err=0, double tolerance=0, void *pres=NULL) |
Perform the collision check of two Models. Collision results returned immediately by parameter pres compared to erColl_ChkCollision()The query type query_type can be one of the following values.0: ER_COLL_QUERY_TYPE_UNDEF skip collision checks 1: ER_COLL_QUERY_TYPE_COLLIDE detects collision between two Models 2: ER_COLL_QUERY_TYPE_DISTANCE computes the distance between two Models 3: ER_COLL_QUERY_TYPE_TOLERANCE checks if distance between Models is <= tolerance The contact type contact_type is used for query type ER_COLL_QUERY_TYPE_COLLIDE and can be one of the following values.1: ER_COLL_ALL_CONTACTS , the erColl_GetResults_Collide() contains an array with all colliding triangle pairs ER_CollideResult. 2: ER_COLL_FIRST_CONTACT , the erColl_GetResults_Collide() array will only get the first colliding triangle pair found. Collide Detects collsion. This is the fastest method. Distance Computes minimum distance between two Models. This method takes the most time !!! Tolerances Specify tolerance for query type ER_COLL_QUERY_TYPE_DISTANCE or ER_COLL_QUERY_TYPE_TOLERANCEChecks if distance between Models is <= tolerance. Remarks If erColl_ChkCollision_res() returns with ER_COLL_DETECTED, get more detailed information about the collision status by parameter pres . More... | |
static DLLAPI int ER_STDCALL | erColl_ChkCollision_res_free (long query_type, void *pres) |
Frees allocated memory for Collision results for parameter pres The query type query_type can be one of the following values.0: ER_COLL_QUERY_TYPE_UNDEF skip operation 1: ER_COLL_QUERY_TYPE_COLLIDE frees allocated data in ER_CollideResult 2: ER_COLL_QUERY_TYPE_DISTANCE frees allocated data in ER_DistanceResult 3: ER_COLL_QUERY_TYPE_TOLERANCE frees allocated data in ER_ToleranceResult Remarks Note that the allocated memory in the Collision results structures must be administrated by the Kernel and not in the host application. More... | |
static DLLAPI int ER_STDCALL | erColl_UnloadModel (ER_COLLISION_HND *er_coll_hnd) |
Unload a Model. Free all allocated memory. More... | |
static DLLAPI int ER_STDCALL | erColl_GetResults_Collide (ER_CollideResult *er_cres) |
Get Collision result for query ER_COLL_QUERY_TYPE_COLLIDE. Remarks Call erColl_ChkCollision() first, brfore calling this function. More... | |
static DLLAPI int ER_STDCALL | erColl_GetResults_Distance (ER_DistanceResult *er_dres) |
Get Collision result for query ER_COLL_QUERY_TYPE_DISTANCE. Remarks Call erColl_ChkCollision() first, before calling this function. More... | |
static DLLAPI int ER_STDCALL | erColl_GetResults_Tolerance (ER_ToleranceResult *er_tres) |
Get Collision result for query ER_COLL_QUERY_TYPE_TOLERANCE. Remarks Call erColl_ChkCollision() first, brfore calling this function. More... | |
Additional Inherited Members | |
Static Public Attributes inherited from ERK_CAPI_SIM | |
static ERK_CAPI_SIM_COLLISION | erk_capi_sim_collision |
Method class for collision, tolerances, etc. More... | |
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... | |
Method class for collision, tolerances, etc.
|
static |
Adds a triangle to a Model.
call erColl_BeginModel() once to create a new unique model handle.
[in] | er_coll_hnd | a valid unique Collision handle ER_COLLISION_HND |
[in] | p1 | 1st point of triangle |
[in] | p2 | 2nd point of triangle |
[in] | p3 | 3rd point of triangle |
[in] | id | unique identifier for this triangle |
0 | - ER_COLL_OK - OK |
1 | - ER_COLL_ERROR - Error, kernel not initialized |
2 | - ER_COLL_HND_INVALID - Collision handle invalid |
|
static |
Creates a collision handle for one Model and preallocate memory for n_tris
triangles.
[out] | er_coll_hnd | unique Collision handle ER_COLLISION_HND |
[in] | n_tris | number of model triangles |
0 | - ER_COLL_OK - OK |
1 | - ER_COLL_ERROR - Error, kernel not initialized |
2 | - ER_COLL_HND_INVALID - Collision handle invalid |
-1 | - ER_COLL_ERR_MODEL_OUT_OF_MEMORY - not enough memory |
|
static |
Perform the collision check of two Models.
See also erColl_ChkCollision_res() to get the collision results immediately
The query type query_type
can be one of the following values.
0: ER_COLL_QUERY_TYPE_UNDEF skip collision checks
1: ER_COLL_QUERY_TYPE_COLLIDE detects collision between two Models
2: ER_COLL_QUERY_TYPE_DISTANCE computes the distance between two Models
3: ER_COLL_QUERY_TYPE_TOLERANCE checks if distance between Models is <= tolerance
The contact type contact_type
is used for query type ER_COLL_QUERY_TYPE_COLLIDE and can be one of the following values.
1: ER_COLL_ALL_CONTACTS , the erColl_GetResults_Collide() contains an array with all colliding triangle pairs ER_CollideResult.
2: ER_COLL_FIRST_CONTACT , the erColl_GetResults_Collide() array will only get the first colliding triangle pair found.
Collide
Detects collsion. This is the fastest method.
Distance
Computes minimum distance between two Models. This method takes the most time !!!
Tolerances
Specify tolerance
for query type ER_COLL_QUERY_TYPE_DISTANCE or ER_COLL_QUERY_TYPE_TOLERANCE
Checks if distance between Models is <= tolerance.
Remarks
If erColl_ChkCollision() returns with ER_COLL_DETECTED call, depending on the query type, one of the collision result functions erColl_GetResults_Collide(), erColl_GetResults_Distance() or erColl_GetResults_Tolerance() to receive more detailed information about the collision status.
[in] | er_coll_hnd_1 | unique Collision handle for the 1st Model ER_COLLISION_HND |
[in] | iT_1 | a location of the 1st Model w.r.t. inertia DFRAME |
[in] | er_coll_hnd_2 | unique Collision handle for the 2nd Model ER_COLLISION_HND |
[in] | iT_2 | a location of the 2nd Model w.r.t. inertia DFRAME |
[in] | query_type | collision query type |
[in] | contact_type | collision contact type |
[in] | rel_err | relative error margin from actual distance |
[in] | abs_err | absolute error margin from actual distance |
[in] | tolerance | Tolerance value |
3 | - ER_COLL_DETECTED - Collision detected |
1 | - ER_COLL_ERROR - Error, kernel not initialized |
2 | - ER_COLL_HND_INVALID - Collision handle invalid |
|
static |
Perform the collision check of two Models.
Collision results returned immediately by parameter pres
compared to erColl_ChkCollision()
The query type query_type
can be one of the following values.
0: ER_COLL_QUERY_TYPE_UNDEF skip collision checks
1: ER_COLL_QUERY_TYPE_COLLIDE detects collision between two Models
2: ER_COLL_QUERY_TYPE_DISTANCE computes the distance between two Models
3: ER_COLL_QUERY_TYPE_TOLERANCE checks if distance between Models is <= tolerance
The contact type contact_type
is used for query type ER_COLL_QUERY_TYPE_COLLIDE and can be one of the following values.
1: ER_COLL_ALL_CONTACTS , the erColl_GetResults_Collide() contains an array with all colliding triangle pairs ER_CollideResult.
2: ER_COLL_FIRST_CONTACT , the erColl_GetResults_Collide() array will only get the first colliding triangle pair found.
Collide
Detects collsion. This is the fastest method.
Distance
Computes minimum distance between two Models. This method takes the most time !!!
Tolerances
Specify tolerance
for query type ER_COLL_QUERY_TYPE_DISTANCE or ER_COLL_QUERY_TYPE_TOLERANCE
Checks if distance between Models is <= tolerance.
Remarks
If erColl_ChkCollision_res() returns with ER_COLL_DETECTED, get more detailed information about the collision status by parameter pres
.
[in] | er_coll_hnd_1 | unique Collision handle for the 1st Model ER_COLLISION_HND |
[in] | iT_1 | a location of the 1st Model w.r.t. inertia DFRAME |
[in] | er_coll_hnd_2 | unique Collision handle for the 2nd Model ER_COLLISION_HND |
[in] | iT_2 | a location of the 2nd Model w.r.t. inertia DFRAME |
[in] | query_type | collision query type |
[in] | contact_type | collision contact type |
[in] | rel_err | relative error margin from actual distance |
[in] | abs_err | absolute error margin from actual distance |
[in] | tolerance | Tolerance value query_type |
[out] | pres | pointer to collision result structure ER_CollideResult, ER_DistanceResult or ER_ToleranceResult, depending on query type |
3 | - ER_COLL_DETECTED - Collision detected |
1 | - ER_COLL_ERROR - Error, kernel not initialized |
2 | - ER_COLL_HND_INVALID - Collision handle invalid |
|
static |
Frees allocated memory for Collision results for parameter pres
The query type query_type
can be one of the following values.
0: ER_COLL_QUERY_TYPE_UNDEF skip operation
1: ER_COLL_QUERY_TYPE_COLLIDE frees allocated data in ER_CollideResult
2: ER_COLL_QUERY_TYPE_DISTANCE frees allocated data in ER_DistanceResult
3: ER_COLL_QUERY_TYPE_TOLERANCE frees allocated data in ER_ToleranceResult
Remarks
Note that the allocated memory in the Collision results structures must be administrated by the Kernel and not in the host application.
[in] | query_type | collision query type |
[out] | pres | pointer to collision result structure ER_CollideResult, ER_DistanceResult or ER_ToleranceResult, depending on query type |
0 | - ER_COLL_OK - Ok, free memory done |
1 | - ER_COLL_ERROR - Error, kernel not initialized |
|
static |
Stop building a Model.
[in] | er_coll_hnd | a valid unique Collision handle ER_COLLISION_HND |
0 | - ER_COLL_OK - OK |
1 | - ER_COLL_ERROR - Error, kernel not initialized |
2 | - ER_COLL_HND_INVALID - Collision handle invalid |
|
static |
Get Collision result for query ER_COLL_QUERY_TYPE_COLLIDE. Remarks
Call erColl_ChkCollision() first, brfore calling this function.
[out] | er_cres | collide results ER_CollideResult |
0 | - OK |
1 | - Error, kernel not initialized |
|
static |
Get Collision result for query ER_COLL_QUERY_TYPE_DISTANCE. Remarks
Call erColl_ChkCollision() first, before calling this function.
[out] | er_dres | distance results ER_DistanceResult |
0 | - OK |
1 | - Error, kernel not initialized |
|
static |
Get Collision result for query ER_COLL_QUERY_TYPE_TOLERANCE. Remarks
Call erColl_ChkCollision() first, brfore calling this function.
[out] | er_tres | tolerance results ER_ToleranceResult |
0 | - OK |
1 | - Error, kernel not initialized |
|
static |
Unload a Model. Free all allocated memory.
[in] | er_coll_hnd | a valid unique Collision handle ER_COLLISION_HND |
0 | - ER_COLL_OK - OK |
1 | - ER_COLL_ERROR - Error, kernel not initialized |
2 | - ER_COLL_HND_INVALID - Collision handle invalid |