EASY-ROB™ Kernel  v8.307
 All Classes Files Functions Variables Typedefs Macros Pages
Static Public Member Functions | List of all members
ERK_CAPI_GEO_MNGR Class Reference

Method class to access geometry manager 'GeoMngr' methods. More...

#include <erk_capi.h>

Inheritance diagram for ERK_CAPI_GEO_MNGR:
ERK_CAPI_GEO ERK_CAPI

Static Public Member Functions

static DLLAPI int ER_STDCALL erGeoMngr_GetVersion ()
 GeoMngr Version. More...
 
static DLLAPI TErGeoHandle
ER_STDCALL 
erGeoMngr_LoadGeometry (ER_HND er_hnd, LOAD_GEOMETRY_DATA *p_load_geometry_data)
 Loads a geometry by host application if callback function is defined, see erSetCallBack_LoadGeometryProc(), TerLoadGeometryProc. More...
 
static DLLAPI int ER_STDCALL erGeoMngr_FreeGeometry (ER_HND er_hnd, TErGeoHandle GeoHandle)
 Free or delete a geometry by host application if callback function is defined, see erSetCallBack_FreeGeometryProc(), TerFreeGeometryProc. More...
 
static DLLAPI int ER_STDCALL erGeoMngr_GetNumGeometries (ER_HND er_hnd)
 Get number of loaded geometries for specified device. More...
 
static DLLAPI int ER_STDCALL erGeoMngr_GetGeometry (ER_HND er_hnd, int geometryIndex, LOAD_GEOMETRY_DATA *p_load_geometry_data, DFRAME *kinMat)
 Fills structure LOAD_GEOMETRY_DATA with geometry loading data. More...
 
static DLLAPI int ER_STDCALL erGeoMngr_GetNumAxisGeometries (ER_HND er_hnd, int axis_nr)
 Get number of geometries belonging to an axis/joint of a kinematics/device. More...
 
static DLLAPI int ER_STDCALL erGeoMngr_GetAxisGeometry (ER_HND er_hnd, int axis_nr, int geometryIndex, LOAD_GEOMETRY_DATA *p_load_geometry_data, DFRAME *kinMat)
 Fills structure LOAD_GEOMETRY_DATA for geometry with geometryIndex belonging to joint with axis_nr, see erGeoMngr_GetNumAxisGeometries() More...
 
static DLLAPI const double
*ER_STDCALL 
erGeoMngr_GetGeometryBBox (TErGeoHandle geometryHandle)
 Return BBox array of complete geometry. More...
 
static DLLAPI const double
*ER_STDCALL 
erGeoMngr_GetAxisBBox (ER_HND er_hnd, int axis_id)
 
static DLLAPI const double
*ER_STDCALL 
erGeoMngr_GetDeviceBBox (ER_HND er_hnd)
 
static DLLAPI int ER_STDCALL erGeoMngr_GetGeometryNumObjs (TErGeoHandle geometryHandle)
 
static DLLAPI int ER_STDCALL erGeoMngr_GetGeometryObjNumPoints (TErGeoHandle geometryHandle, int objidx)
 
static DLLAPI double *ER_STDCALL erGeoMngr_GetGeometryObjPoint (TErGeoHandle geometryHandle, int objidx, int index)
 
static DLLAPI int ER_STDCALL erGeoMngr_GetGeometryObjNumPointNormals (TErGeoHandle geometryHandle, int objidx)
 
static DLLAPI double *ER_STDCALL erGeoMngr_GetGeometryObjPointNormal (TErGeoHandle geometryHandle, int objidx, int index)
 
static DLLAPI int ER_STDCALL erGeoMngr_GetGeometryObjNumLines (TErGeoHandle geometryHandle, int objidx)
 
static DLLAPI size_t *ER_STDCALL erGeoMngr_GetGeometryObjLine (TErGeoHandle geometryHandle, int objidx, int index)
 
static DLLAPI int ER_STDCALL erGeoMngr_GetGeometryObjNumPolygons (TErGeoHandle geometryHandle, int objidx)
 
static DLLAPI size_t *ER_STDCALL erGeoMngr_GetGeometryObjPolygon (TErGeoHandle geometryHandle, int objidx, int index)
 
static DLLAPI double *ER_STDCALL erGeoMngr_GetGeometryObjColor (TErGeoHandle geometryHandle, int objidx)
 
static DLLAPI long ER_STDCALL erGeoMngr_GetGeometryObjColorCode (TErGeoHandle geometryHandle, int objidx)
 
static DLLAPI int ER_STDCALL erGeoMngr_GetGeometryCloneCount (TErGeoHandle geometryHandle)
 
static DLLAPI TErGeoHandle
ER_STDCALL 
erGeoMngr_GetGeometryCloneHandle (TErGeoHandle geometryHandle)
 
static DLLAPI int ER_STDCALL erGeoMngr_SetGeometryCollisionHandle (TErGeoHandle geometryHandle, ER_COLLISION_HND collisionHandle)
 
static DLLAPI ER_COLLISION_HND
*ER_STDCALL 
erGeoMngr_GetGeometryCollisionHandle (TErGeoHandle geometryHandle)
 
static DLLAPI int ER_STDCALL erGeoMngr_SetGeometryIsCollided (TErGeoHandle geometryHandle, int isCollided)
 
static DLLAPI int *ER_STDCALL erGeoMngr_GetGeometryIsCollided (TErGeoHandle geometryHandle)
 
static DLLAPI int ER_STDCALL erGeoMngr_CheckBoundingBoxCollision (DFRAME *T1, const double *bbox1, DFRAME *T2, const double *bbox2, double tolerance)
 
- Static Public Member Functions inherited from ERK_CAPI_GEO
static DLLAPI int ER_STDCALL erUpdateGeo (ER_HND er_hnd)
 Updates all geometry location for each robot joint. This function causes the call of callback function TerUpdateGeometryProc().
The resulted geometry location w.r.t. robot base is the product of
KinMat and GeoMat. More...
 

Additional Inherited Members

- Static Public Attributes inherited from ERK_CAPI_GEO
static ERK_CAPI_GEO_MNGR erk_capi_geo_mngr
 Method class to access geometry manager methods. 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...
 

Detailed Description

Method class to access geometry manager 'GeoMngr' methods.

Member Function Documentation

static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_CheckBoundingBoxCollision ( DFRAME T1,
const double *  bbox1,
DFRAME T2,
const double *  bbox2,
double  tolerance 
)
static
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_FreeGeometry ( ER_HND  er_hnd,
TErGeoHandle  GeoHandle 
)
static

Free or delete a geometry by host application if callback function is defined, see erSetCallBack_FreeGeometryProc(), TerFreeGeometryProc.

Parameters
[in]er_hndunique kinematics handle ER_HND
[in]GeoHandleunique geometry handle TErGeoHandle
Return values
0- OK
1- Error
static DLLAPI const double* ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetAxisBBox ( ER_HND  er_hnd,
int  axis_id 
)
static
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetAxisGeometry ( ER_HND  er_hnd,
int  axis_nr,
int  geometryIndex,
LOAD_GEOMETRY_DATA p_load_geometry_data,
DFRAME kinMat 
)
static

Fills structure LOAD_GEOMETRY_DATA for geometry with geometryIndex belonging to joint with axis_nr, see erGeoMngr_GetNumAxisGeometries()

Parameters
[in]er_hndunique kinematics handle ER_HND
[in]axis_nraxis/joint index [-num_dofs_passive ... num_dofs_active] of device, where num_dofs_passive and -active are the number passive and acitve joint of devicejoints
[in]geometryIndexgeometry index [0..num_geos_axis-1] of the requested geometry data, where num_geos_axis is the number of geometries belonging to axis_nr
[out]p_load_geometry_datageometry data, LOAD_GEOMETRY_DATA
[out]kinMatjoint coorsys location w.r.t. robot base, DFRAME
Return values
0- OK
1- Error or no geometry data available
static DLLAPI const double* ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetDeviceBBox ( ER_HND  er_hnd)
static
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometry ( ER_HND  er_hnd,
int  geometryIndex,
LOAD_GEOMETRY_DATA p_load_geometry_data,
DFRAME kinMat 
)
static

Fills structure LOAD_GEOMETRY_DATA with geometry loading data.

Parameters
[in]er_hndunique kinematics handle ER_HND
[in]geometryIndex- geometry index [0..numGeos-1] of the requested geometry data, where numGoes is the number of geometries
[out]p_load_geometry_data- geometry data, LOAD_GEOMETRY_DATA
[out]kinMatjoint coorsys location w.r.t. robot base, DFRAME
Return values
0- OK
1- Error or no geometry data available
static DLLAPI const double* ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryBBox ( TErGeoHandle  geometryHandle)
static

Return BBox array of complete geometry.

// Example:
// see ERK-example-Suite, int CErOpenGLDraw::DrawKernel_3D_Scenerio()
...
int numGeos = erk_geo_mngr.erGeoMngr_GetNumGeometries(erHnd); // number of geometries for specified device
DFRAME kinMat;
// iGeo = [0, numGeos[
if (erk_geo_mngr.erGeoMngr_GetGeometry(erHnd, iGeo, &lgd, &kinMat)) // fills structure pointed to by 'lgd' with geometry loading data
continue;
...
TErGeoHandle geoHnd = lgd.GeoHandle;
...
// Draw BoundingBox if any
const double* bbox = erk_geo_mngr.erGeoMngr_GetGeometryBBox(geoHnd);
if (m_pn_Dlg->m_show_bbox && bbox)
{
double scaled_bbox[6];
for (int i = 0; i < 6; ++i)
scaled_bbox[i] = bbox[i] * Scaling[i % 3];
double bbox_color[] = { 0.0, 1.0, 1.0, 1.0 };
DrawBoundingBox(scaled_bbox, 1.0, bbox_color);
}
...
Parameters
[in]geometryHandlegeometry handle TErGeoHandle
Return values
pointer- pointer to BBox array size 6
NULL- Error, BBox not available
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryCloneCount ( TErGeoHandle  geometryHandle)
static
static DLLAPI TErGeoHandle ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryCloneHandle ( TErGeoHandle  geometryHandle)
static
static DLLAPI ER_COLLISION_HND* ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryCollisionHandle ( TErGeoHandle  geometryHandle)
static
static DLLAPI int* ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryIsCollided ( TErGeoHandle  geometryHandle)
static
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryNumObjs ( TErGeoHandle  geometryHandle)
static
static DLLAPI double* ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryObjColor ( TErGeoHandle  geometryHandle,
int  objidx 
)
static
static DLLAPI long ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryObjColorCode ( TErGeoHandle  geometryHandle,
int  objidx 
)
static
static DLLAPI size_t* ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryObjLine ( TErGeoHandle  geometryHandle,
int  objidx,
int  index 
)
static
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryObjNumLines ( TErGeoHandle  geometryHandle,
int  objidx 
)
static
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryObjNumPointNormals ( TErGeoHandle  geometryHandle,
int  objidx 
)
static
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryObjNumPoints ( TErGeoHandle  geometryHandle,
int  objidx 
)
static
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryObjNumPolygons ( TErGeoHandle  geometryHandle,
int  objidx 
)
static
static DLLAPI double* ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryObjPoint ( TErGeoHandle  geometryHandle,
int  objidx,
int  index 
)
static
static DLLAPI double* ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryObjPointNormal ( TErGeoHandle  geometryHandle,
int  objidx,
int  index 
)
static
static DLLAPI size_t* ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetGeometryObjPolygon ( TErGeoHandle  geometryHandle,
int  objidx,
int  index 
)
static
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetNumAxisGeometries ( ER_HND  er_hnd,
int  axis_nr 
)
static

Get number of geometries belonging to an axis/joint of a kinematics/device.

// Example:
// see ERK-example-Suite, int CErERK_COLLISION::ChkDeviceAxisGeometriesCollisions()
//
// axis_dev1 is in [-num_dofs_passiv_1, num_dofs_active_1] ... number of passive and active joints of device with unique kinematics handle erHnd_1
// axis_dev2 is in [-num_dofs_passiv_2, num_dofs_active_2] ... number of passive and active joints of device with unique kinematics handle erHnd_2
//
ER_HND erHnd_1 = per_dev_1->er_hnd;
int num_geos_axis_dev1 = erk_geo_mngr.erGeoMngr_GetNumAxisGeometries(erHnd_1, axis_dev1); // number of geometries belonging to axis of 1st device
ER_HND erHnd_2 = per_dev_2->er_hnd;
int num_geos_axis_dev2 = erk_geo_mngr.erGeoMngr_GetNumAxisGeometries(erHnd_2, axis_dev2); // number of geometries belonging to axis of 2nd device
for (int ii = 0; ii < num_geos_axis_dev1; ++ii)
{
DFRAME kinMat;
if (erk_geo_mngr.erGeoMngr_GetAxisGeometry(erHnd_1, axis_dev1, ii, &lgd_1, &kinMat)) // fills structure pointed to by 'lgd' with geometry loading data
continue;
// 1st Model
ER_COLLISION_HND er_coll_hnd_1 = *erk_geo_mngr.erGeoMngr_GetGeometryCollisionHandle(lgd_1.GeoHandle); // unique Collision handle for the 1st Model
if (!er_coll_hnd_1)
continue;
int *pGeoIsCollided_1 = erk_geo_mngr.erGeoMngr_GetGeometryIsCollided(lgd_1.GeoHandle);
DFRAME T_1, iTb, T_kinMat_GeoMat;
erk_sys_mathematics.erMath_mul_T_T(&T_kinMat_GeoMat, &kinMat, lgd_1.GeoMat);
erk_rob_kin.erGetRobotBase(erHnd_1, &iTb); // Get robot base location w.r.t. world (=inertia, =reference coorsys)
DFRAME *iTref_1 = &per_dev_1->iTref;
erk_sys_mathematics.erMath_mul_T_T_T(&T_1, iTref_1, &iTb, &T_kinMat_GeoMat);
for (int jj = 0; jj < num_geos_axis_dev2; ++jj)
{
// 2nd Model
if (erk_geo_mngr.erGeoMngr_GetAxisGeometry(erHnd_2, axis_dev2, jj, &lgd_2, &kinMat)) // fills structure pointed to by 'lgd' with geometry loading data
continue;
ER_COLLISION_HND er_coll_hnd_2 = *erk_geo_mngr.erGeoMngr_GetGeometryCollisionHandle(lgd_2.GeoHandle); // unique Collision handle for the 2nd Model
if (!er_coll_hnd_2)
continue;
int *pGeoIsCollided_2 = erk_geo_mngr.erGeoMngr_GetGeometryIsCollided(lgd_2.GeoHandle);
DFRAME T_2, iTb, T_kinMat_GeoMat;
erk_sys_mathematics.erMath_mul_T_T(&T_kinMat_GeoMat, &kinMat, lgd_2.GeoMat);
erk_rob_kin.erGetRobotBase(erHnd_2, &iTb); // Get robot base location w.r.t. world (=inertia, =reference coorsys)
DFRAME *iTref_2 = &per_dev_2->iTref;
erk_sys_mathematics.erMath_mul_T_T_T(&T_2, iTref_2, &iTb, &T_kinMat_GeoMat);
// Initialize collision result structures depending on query_type
Erk_CollisionResult_Init(query_type, pres);
long collision = ER_COLL_OK; // ER_COLL_DETECTED - collision, ER_COLL_OK - no collision
er_coll_hnd_1, // unique Collision handle for the 1st Model
&T_1, // location of 1st object
er_coll_hnd_2, // unique Collision handle for the 2nd Model
&T_2, // location of 2nd object
query_type, // ER_COLL_QUERY_TYPE_COLLIDE, ER_COLL_QUERY_TYPE_DISTANCE, ER_COLL_QUERY_TYPE_TOLERANCE
contact_type, // ER_COLL_FIRST_CONTACT, ER_COLL_ALL_CONTACTS
rel_err, // the relative error margin from actual distance
abs_err, // the absolute error margin from actual distance
tolerance, // Tolerance [m]
pres // pres collision result depending on query type is ::ER_CollideResult, ::ER_DistanceResult or ::ER_ToleranceResult
);
if (collision_ret == ER_COLL_OK)
collision_ret = collision;
if (collision == ER_COLL_DETECTED)
*pGeoIsCollided_1 = *pGeoIsCollided_2 = ER_COLL_DETECTED; // indicate geo is collided, used for visualization
if (output)
if (collision == ER_COLL_DETECTED)
{
char bb[ER_MAXSTR];
sprintf_s(bb, ER_MAXSTR, "Check Collision between Tool %s and WorkPiece %s -> %s",
lgd_1.GeoName, lgd_2.GeoName,
collision == ER_COLL_DETECTED ? "ER_COLL_DETECTED" :
collision == ER_COLL_ERROR ? "ER_COLL_ERROR" :
collision == ER_COLL_HND_INVALID ? "ER_COLL_HND_INVALID" :
"ER_COLL_OK"
);
ShowMessages(ER_LOG_TYPE_MSG, bb);
}
}
}
...
Parameters
[in]er_hndunique kinematics handle ER_HND
[in]axis_nraxis/joint index [-num_dofs_passive ... num_dofs_active] of device, where num_dofs_passive and -active are the number passive and acitve joint of device/joints
Return values
0- no geometries available for this joint
>0- number of geometries belonging to joint represented by axis_nr
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetNumGeometries ( ER_HND  er_hnd)
static

Get number of loaded geometries for specified device.

Parameters
[in]er_hndunique kinematics handle ER_HND
Return values
0- no geometries loaded or invalid handle
>0- number of loaded geometries
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_GetVersion ( )
static

GeoMngr Version.

Return values
versionGeoMngr version number
static DLLAPI TErGeoHandle ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_LoadGeometry ( ER_HND  er_hnd,
LOAD_GEOMETRY_DATA p_load_geometry_data 
)
static

Loads a geometry by host application if callback function is defined, see erSetCallBack_LoadGeometryProc(), TerLoadGeometryProc.

Parameters
[in]er_hndunique kinematics handle ER_HND
[in]p_load_geometry_datageometry data, LOAD_GEOMETRY_DATA
Return values
TErGeoHandleunique geometry handle created by GeoMngr
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_SetGeometryCollisionHandle ( TErGeoHandle  geometryHandle,
ER_COLLISION_HND  collisionHandle 
)
static
static DLLAPI int ER_STDCALL ERK_CAPI_GEO_MNGR::erGeoMngr_SetGeometryIsCollided ( TErGeoHandle  geometryHandle,
int  isCollided 
)
static

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