EgtExecutor 2.7i2 :

- aggiunta funzione Exe/lua GetRobotAngles.
This commit is contained in:
Dario Sassi
2025-09-10 08:53:22 +02:00
parent c736496b6a
commit 24d355f08a
3 changed files with 41 additions and 1 deletions
+11
View File
@@ -3480,6 +3480,17 @@ ExeGetCalcPositions( const Point3d& ptP, const DBLVECTOR& vAng,
return pMachMgr->GetCalcPositions( ptP, vAng, nStat, dX, dY, dZ) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetRobotAngles( const Point3d& ptP, const Vector3d& vtDirT, const Vector3d& vtDirA,
DBLVECTOR& vAng1, DBLVECTOR& vAng2)
{
IMachMgr* pMachMgr = GetCurrMachMgr() ;
VERIFY_MACHMGR( pMachMgr, false)
// calcolo gli angoli macchina dalle direzioni fresa e ausiliaria passate
return pMachMgr->GetRobotAngles( ptP, vtDirT, vtDirA, vAng1, vAng2) ;
}
//-----------------------------------------------------------------------------
bool
ExeGetCalcTipFromPositions( double dX, double dY, double dZ, double dAngA, double dAngB,
BIN
View File
Binary file not shown.
+30 -1
View File
@@ -3686,7 +3686,7 @@ LuaGetCalcPositions( lua_State* L)
break ;
}
LuaClearStack( L) ;
// imposto la tavola corrente per il calcolo
// calcolo gli assi lineari dalla posizione e dagli angoli
int nStat ; double dX ; double dY ; double dZ ;
bool bOk = ExeGetCalcPositions( ptP, vAng, nStat, dX, dY, dZ) ;
// restituisco il risultato
@@ -3704,6 +3704,34 @@ LuaGetCalcPositions( lua_State* L)
}
}
//-------------------------------------------------------------------------------
static int
LuaGetRobotAngles( lua_State* L)
{
// da 3 parametri : ptP, vtTool, vtAux
Point3d ptP ;
LuaCheckParam( L, 1, ptP)
Vector3d vtTool ;
LuaCheckParam( L, 2, vtTool)
Vector3d vtAux ;
LuaCheckParam( L, 3, vtAux)
LuaClearStack( L) ;
// imposto la tavola corrente per il calcolo
DBLVECTOR vAng1, vAng2 ;
bool bOk = ExeGetRobotAngles( ptP, vtTool, vtAux, vAng1, vAng2) ;
// restituisco il risultato
if ( bOk) {
LuaSetParam( L, bOk) ;
LuaSetParam( L, vAng1) ;
LuaSetParam( L, vAng2) ;
return 3 ;
}
else {
LuaSetParam( L, bOk) ;
return 1 ;
}
}
//-------------------------------------------------------------------------------
static int
LuaGetCalcTipFromPositions( lua_State* L)
@@ -4556,6 +4584,7 @@ LuaInstallMachMgr( LuaMgr& luaMgr)
bOk = bOk && luaMgr.RegisterFunction( "EgtGetRotAxisBlocked", LuaGetRotAxisBlocked) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetCalcAngles", LuaGetCalcAngles) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetCalcPositions", LuaGetCalcPositions) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetRobotAngles", LuaGetRobotAngles) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetCalcTipFromPositions", LuaGetCalcTipFromPositions) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetCalcToolDirFromAngles", LuaGetCalcToolDirFromAngles) ;
bOk = bOk && luaMgr.RegisterFunction( "EgtGetCalcAuxDirFromAngles", LuaGetCalcAuxDirFromAngles) ;