Commit 6d994de4 authored by Mariano Lizarraga's avatar Mariano Lizarraga

Trying to find memory leak bug

parent e441869a
...@@ -26,7 +26,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -26,7 +26,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
{ {
case MAVLINK_MSG_ID_HEARTBEAT: case MAVLINK_MSG_ID_HEARTBEAT:
{ {
qDebug() << "SLUGS RECEIVED HEARTBEAT"; //qDebug() << "SLUGS RECEIVED HEARTBEAT";
break; break;
} }
...@@ -299,7 +299,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -299,7 +299,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
} }
case MAVLINK_MSG_ID_ACTION_ACK: case MAVLINK_MSG_ID_ACTION_ACK:
{ {
qDebug()<<"-------->>>>>>>>>>>>>>> EMITIENDO MAVLINK_MSG_ID_ACTION_ACK"; qDebug()<<"--->>>> EMITIENDO MAVLINK_MSG_ID_ACTION_ACK";
mavlink_action_ack_t ack; mavlink_action_ack_t ack;
mavlink_msg_action_ack_decode(&message,&ack); mavlink_msg_action_ack_decode(&message,&ack);
...@@ -348,7 +348,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -348,7 +348,7 @@ void SlugsMAV::receiveMessage(LinkInterface* link, mavlink_message_t message)
#endif #endif
default: default:
qDebug() << "\nSLUGS RECEIVED MESSAGE WITH ID" << message.msgid; //qDebug() << "\nSLUGS RECEIVED MESSAGE WITH ID" << message.msgid;
break; break;
} }
} }
...@@ -611,11 +611,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message) ...@@ -611,11 +611,6 @@ void UAS::receiveMessage(LinkInterface* link, mavlink_message_t message)
throttle << radioMsg.throttle[i]; throttle << radioMsg.throttle[i];
QPointer<RadioCalibrationData> radioData = new RadioCalibrationData(aileron, QPointer<RadioCalibrationData> radioData = new RadioCalibrationData(aileron,
elevator,
rudder,
gyro,
pitch,
throttle);
emit radioCalibrationReceived(radioData); emit radioCalibrationReceived(radioData);
delete radioData; delete radioData;
} }
......
...@@ -44,6 +44,7 @@ void SlugsPIDControl::activeUasSet(UASInterface* uas) ...@@ -44,6 +44,7 @@ void SlugsPIDControl::activeUasSet(UASInterface* uas)
{ {
SlugsMAV* slugsMav = dynamic_cast<SlugsMAV*>(uas); SlugsMAV* slugsMav = dynamic_cast<SlugsMAV*>(uas);
if (slugsMav != NULL) if (slugsMav != NULL)
{ {
connect(slugsMav,SIGNAL(slugsActionAck(int,uint8_t,uint8_t)),this,SLOT(recibeMensaje(int,uint8_t,uint8_t))); connect(slugsMav,SIGNAL(slugsActionAck(int,uint8_t,uint8_t)),this,SLOT(recibeMensaje(int,uint8_t,uint8_t)));
...@@ -154,23 +155,26 @@ void SlugsPIDControl::changeColor_RED_AirSpeed_groupBox(QString text) ...@@ -154,23 +155,26 @@ void SlugsPIDControl::changeColor_RED_AirSpeed_groupBox(QString text)
void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox() void SlugsPIDControl::changeColor_GREEN_AirSpeed_groupBox()
{ {
//create the packet
SlugsMAV* slugsMav = dynamic_cast<SlugsMAV*>(activeUAS);
if (slugsMav != NULL)
{
//create the packet
pidMessage.target = activeUAS->getUASID(); pidMessage.target = activeUAS->getUASID();
pidMessage.idx = 0; pidMessage.idx = 0;
pidMessage.pVal = ui->dT_P_set->text().toFloat(); pidMessage.pVal = ui->dT_P_set->text().toFloat();
pidMessage.iVal = ui->dT_I_set->text().toFloat(); pidMessage.iVal = ui->dT_I_set->text().toFloat();
pidMessage.dVal = ui->dT_D_set->text().toFloat(); pidMessage.dVal = ui->dT_D_set->text().toFloat();
UAS *uas = dynamic_cast<UAS*>(UASManager::instance()->getActiveUAS());
mavlink_message_t msg; mavlink_message_t msg;
mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage); mavlink_msg_pid_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &pidMessage);
uas->sendMessage(msg); slugsMav->sendMessage(msg);
ui->AirSpeedHold_groupBox->setStyleSheet(GREENcolorStyle); ui->AirSpeedHold_groupBox->setStyleSheet(GREENcolorStyle);
}
} }
......
...@@ -57,19 +57,6 @@ SlugsHilSim::~SlugsHilSim() ...@@ -57,19 +57,6 @@ SlugsHilSim::~SlugsHilSim()
delete ui; delete ui;
} }
void SlugsHilSim::linkAdded(void){
// ui->cb_mavlinkLinks->clear();
// QList<LinkInterface *> linkList;
// linkList.append(LinkManager::instance()->getLinks()) ;
// for (int i = 0; i< linkList.size(); i++){
// ui->cb_mavlinkLinks->addItem((linkList.takeFirst())->getName());
// }
}
void SlugsHilSim::addToCombo(LinkInterface* theLink){ void SlugsHilSim::addToCombo(LinkInterface* theLink){
ui->cb_mavlinkLinks->addItem(theLink->getName()); ui->cb_mavlinkLinks->addItem(theLink->getName());
...@@ -177,12 +164,12 @@ void SlugsHilSim::processHilDatagram(const QByteArray* datagram){ ...@@ -177,12 +164,12 @@ void SlugsHilSim::processHilDatagram(const QByteArray* datagram){
tmpGpsTime.visSat = datagram->at(i++); tmpGpsTime.visSat = datagram->at(i++);
mavlink_msg_gps_date_time_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &tmpGpsTime); mavlink_msg_gps_date_time_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &tmpGpsTime);
activeUas->sendMessage(hilLink,&msg); activeUas->sendMessage(hilLink, msg);
memset(&msg, 0, sizeof(mavlink_message_t)); memset(&msg, 0, sizeof(mavlink_message_t));
mavlink_msg_gps_raw_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &tmpGpsRaw); mavlink_msg_gps_raw_encode(MG::SYSTEM::ID,MG::SYSTEM::COMPID, &msg, &tmpGpsRaw);
activeUas->sendMessage(hilLink,&msg); activeUas->sendMessage(hilLink,msg);
// TODO: this is legacy of old HIL datagram. Need to remove from Simulink model // TODO: this is legacy of old HIL datagram. Need to remove from Simulink model
i++; i++;
...@@ -200,11 +187,6 @@ float SlugsHilSim::getFloatFromDatagram (const QByteArray* datagram, unsigned ch ...@@ -200,11 +187,6 @@ float SlugsHilSim::getFloatFromDatagram (const QByteArray* datagram, unsigned ch
tmpF2C.chData[2] = datagram->at((*i)++); tmpF2C.chData[2] = datagram->at((*i)++);
tmpF2C.chData[3] = datagram->at((*i)++); tmpF2C.chData[3] = datagram->at((*i)++);
// if (uas != NULL) {
// //activeUas = uas;
// }
return tmpF2C.flData; return tmpF2C.flData;
} }
......
...@@ -60,7 +60,6 @@ protected: ...@@ -60,7 +60,6 @@ protected:
UAS* activeUas; UAS* activeUas;
public slots: public slots:
void linkAdded (void);
/** /**
* @brief Adds a link to the combo box listing so the user can select a link * @brief Adds a link to the combo box listing so the user can select a link
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment