EgtMachKernel :

- modifiche alla simulazione per eseguire la verifica collisione correttamente anche alla massima velocità.
This commit is contained in:
Dario Sassi
2026-02-27 11:48:43 +01:00
parent 22c691f9e5
commit e8099c11e0
2 changed files with 11 additions and 7 deletions
+7 -5
View File
@@ -51,9 +51,10 @@ using namespace std ;
//----------------------------------------------------------------------------
static const double MIN_STEP = 1.0 ;
static const double MAX_STEP = 500.0 ;
static const double MID_STEP = 50.0 ;
static const double MAX_STEP = 500.0 ;
static const double COLL_STEP = 10. ;
static const double MAX_COLL_STEP = 100. ;
static const double SQ_COEFF_ROT_MOVE = 100. ;
static const double COEFF_LIM = 0.999 ;
static const double SAFEDIST_STD = 5.0 ;
@@ -2561,6 +2562,7 @@ SimulatorSP::MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt)
static const int STEP_RAPID = -2 ;
static const int STEP_RAPROT = -3 ;
static const int STEP_COLLROT = -4 ;
double dMaxStep = ( NeedCollisionCheck() ? MAX_COLL_STEP : MAX_STEP) ;
bool bViewAllFrames = true ;
int nStep = 1 ;
for ( int i = 0 ; i < nAxCount ; ++ i) {
@@ -2576,11 +2578,11 @@ SimulatorSP::MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt)
bViewAllFrames = ( bIsRobot ? true : false) ;
}
else { // STEP_COLLROT
dStep = min( 0.4 * m_dStep, 10.) ;
dStep = min( 0.4 * m_dStep, COLL_STEP) ;
bViewAllFrames = ( bIsRobot ? true : false) ;
}
}
dStep = max( dStep, 1.) ;
dStep = Clamp( dStep, MIN_STEP, dMaxStep) ;
int nAxStep = int( dMove / dStep) + 1 ;
nStep = max( nStep, nAxStep) ;
}
@@ -2613,7 +2615,7 @@ SimulatorSP::MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt)
}
}
// Aggiorno visualizzazione
if ( bViewAllFrames || ( i % 4) == 0 || i == nStep)
if ( bViewAllFrames || ( i % 8) == 0 || i == nStep)
ExeDraw() ;
// Verifico collisioni
int nCdInd, nObjInd ;
@@ -2649,7 +2651,7 @@ SimulatorSP::MoveAxes( int nMoveType, const SAMVECTOR& vAxNaEpSt)
// Gestione aggiornamenti...
if ( ExeGetEnableUI()) {
// Aggiornamento interfaccia
ExeProcessEvents( 0, 4) ;
ExeProcessEvents( 0, 0) ;
while ( m_nUiStatus == MCH_UISIM_PAUSE) {
ExeProcessEvents( 0, 4) ;
}