Since we simulate more than one LIDAR, we need extra timer for each sensor
to generate signal for simulation slot.
Using only one timer object causes that after one sensor is disabled
(unchecked) the timer is deleted and then after unchecking the second
sensor it tries to remove the same timer and crashes.
if (state) {
/* TODO Maybe it is possible to attach only once to Shmap */
ShmapInit(0);
if (state) {
/* TODO Maybe it is possible to attach only once to Shmap */
ShmapInit(0);
- obstacleSimulationTimer = new QTimer(this);
- connect(obstacleSimulationTimer, SIGNAL(timeout()),
+ obstacleSimulationTimerHokuyo = new QTimer(this);
+ connect(obstacleSimulationTimerHokuyo, SIGNAL(timeout()),
this, SLOT(simulateObstaclesHokuyo()));
this, SLOT(simulateObstaclesHokuyo()));
- obstacleSimulationTimer->start(100);
+ obstacleSimulationTimerHokuyo->start(100);
setMouseTracking(true);
hokuyoScan->setVisible(true);
} else {
setMouseTracking(true);
hokuyoScan->setVisible(true);
} else {
- if (obstacleSimulationTimer)
- delete obstacleSimulationTimer;
+ if (obstacleSimulationTimerHokuyo)
+ delete obstacleSimulationTimerHokuyo;
// Hide scans of lidars
hokuyoScan->setVisible(false);
}
// Hide scans of lidars
hokuyoScan->setVisible(false);
}
if (state) {
/* TODO Maybe it is possible to attach only once to Shmap */
ShmapInit(0);
if (state) {
/* TODO Maybe it is possible to attach only once to Shmap */
ShmapInit(0);
- obstacleSimulationTimer = new QTimer(this);
- connect(obstacleSimulationTimer, SIGNAL(timeout()),
+ obstacleSimulationTimerSick331 = new QTimer(this);
+ connect(obstacleSimulationTimerSick331, SIGNAL(timeout()),
this, SLOT(simulateObstaclesSick()));
this, SLOT(simulateObstaclesSick()));
- obstacleSimulationTimer->start(100);
+ obstacleSimulationTimerSick331->start(100);
setMouseTracking(true);
sickScan->setVisible(true);
} else {
setMouseTracking(true);
sickScan->setVisible(true);
} else {
- if (obstacleSimulationTimer)
- delete obstacleSimulationTimer;
+ if (obstacleSimulationTimerSick331)
+ delete obstacleSimulationTimerSick331;
// Hide scans of lidars
sickScan->setVisible(false);
}
// Hide scans of lidars
sickScan->setVisible(false);
}
if (state) {
/* TODO Maybe it is possible to attach only once to Shmap */
ShmapInit(0);
if (state) {
/* TODO Maybe it is possible to attach only once to Shmap */
ShmapInit(0);
- obstacleSimulationTimer = new QTimer(this);
- connect(obstacleSimulationTimer, SIGNAL(timeout()),
+ obstacleSimulationTimerSick551 = new QTimer(this);
+ connect(obstacleSimulationTimerSick551, SIGNAL(timeout()),
this, SLOT(simulateObstaclesSick551()));
this, SLOT(simulateObstaclesSick551()));
- obstacleSimulationTimer->start(100);
+ obstacleSimulationTimerSick551->start(100);
setMouseTracking(true);
sick551Scan->setVisible(true);
} else {
setMouseTracking(true);
sick551Scan->setVisible(true);
} else {
- if (obstacleSimulationTimer)
- delete obstacleSimulationTimer;
+ if (obstacleSimulationTimerSick551)
+ delete obstacleSimulationTimerSick551;
// Hide scans of lidars
sick551Scan->setVisible(false);
}
// Hide scans of lidars
sick551Scan->setVisible(false);
}
simulatedObstacle.x = position.x();
simulatedObstacle.y = position.y();
simulatedObstacle.x = position.x();
simulatedObstacle.y = position.y();
- simulateObstaclesLidar(hokuyo_params);
- simulateObstaclesLidar(sick_params);
- simulateObstaclesLidar(sick551_params);
}
/**********************************************************************
}
/**********************************************************************
int sickSimEnabled;
int sick551SimEnabled;
int sickSimEnabled;
int sick551SimEnabled;
- QTimer *obstacleSimulationTimer;
+ QTimer *obstacleSimulationTimerHokuyo;
+ QTimer *obstacleSimulationTimerSick331;
+ QTimer *obstacleSimulationTimerSick551;
Point simulatedObstacle;
/************************************************************
Point simulatedObstacle;
/************************************************************