Commit 4273a469 authored by roangel's avatar roangel
Browse files

Cleaned a bit code and CMakeList.txt. Next step: add ROS stuff and start testing

parent 9eab1cbd
...@@ -15,7 +15,6 @@ find_package(catkin REQUIRED COMPONENTS ...@@ -15,7 +15,6 @@ find_package(catkin REQUIRED COMPONENTS
set(CMAKE_INCLUDE_CURRENT_DIR ON) set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(CMAKE_AUTOMOC ON) set(CMAKE_AUTOMOC ON)
## System dependencies are found with CMake's conventions ## System dependencies are found with CMake's conventions
...@@ -36,7 +35,7 @@ set(MY_LIB_PATH_INC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/include) ...@@ -36,7 +35,7 @@ set(MY_LIB_PATH_INC ${PROJECT_SOURCE_DIR}/GUI_Qt/CrazyFlyGUI/include)
add_definitions(-std=c++11) add_definitions(-std=c++11)
set(SRC_HDRS set(SRC_HDRS_QOBJECT #sources that have the Qt macro QOBJECT inside, the MOC cpp file needs to be done manually
${MY_LIB_PATH_INC}/crazyFlyZoneTab.h ${MY_LIB_PATH_INC}/crazyFlyZoneTab.h
${MY_LIB_PATH_INC}/myGraphicsScene.h ${MY_LIB_PATH_INC}/myGraphicsScene.h
${MY_LIB_PATH_INC}/myGraphicsView.h ${MY_LIB_PATH_INC}/myGraphicsView.h
...@@ -44,7 +43,7 @@ set(SRC_HDRS ...@@ -44,7 +43,7 @@ set(SRC_HDRS
) )
qt5_wrap_ui(UIS_HDRS GUI_Qt/CrazyFlyGUI/src/mainguiwindow.ui) qt5_wrap_ui(UIS_HDRS GUI_Qt/CrazyFlyGUI/src/mainguiwindow.ui)
qt5_wrap_cpp(SRC_MOC_HDRS ${SRC_HDRS}) qt5_wrap_cpp(SRC_MOC_HDRS ${SRC_HDRS_QOBJECT})
## Uncomment this if the package has a setup.py. This macro ensures ## Uncomment this if the package has a setup.py. This macro ensures
## modules and global scripts declared therein get installed ## modules and global scripts declared therein get installed
...@@ -146,7 +145,7 @@ catkin_package( ...@@ -146,7 +145,7 @@ catkin_package(
## Your package locations should be listed before other locations ## Your package locations should be listed before other locations
# include_directories(include) # include_directories(include)
include_directories( include_directories(
GUI_Qt/CrazyFlyGUI/include ${MY_LIB_PATH_INC}
${catkin_INCLUDE_DIRS} ${catkin_INCLUDE_DIRS}
) )
...@@ -165,12 +164,12 @@ include_directories( ...@@ -165,12 +164,12 @@ include_directories(
## The recommended prefix ensures that target names across packages don't collide ## The recommended prefix ensures that target names across packages don't collide
# add_executable(${PROJECT_NAME}_node src/d_fall_gui_node.cpp) # add_executable(${PROJECT_NAME}_node src/d_fall_gui_node.cpp)
add_executable(myGUI GUI_Qt/CrazyFlyGUI/src/mainguiwindow.cpp GUI_Qt/CrazyFlyGUI/src/main.cpp ${UIS_HDRS} ${SRC_HDRS}) add_executable(my_GUI GUI_Qt/CrazyFlyGUI/src/mainguiwindow.cpp GUI_Qt/CrazyFlyGUI/src/main.cpp ${UIS_HDRS} ${SRC_HDRS_QOBJECT})
qt5_use_modules(myGUI Widgets) qt5_use_modules(my_GUI Widgets)
set(MY_LIB_SOURCES set(MY_LIB_SOURCES # compilation of sources
${MY_LIB_PATH_SRC}/cornergrabber.cpp ${MY_LIB_PATH_SRC}/cornergrabber.cpp
${MY_LIB_PATH_SRC}/crazyFlyZone.cpp ${MY_LIB_PATH_SRC}/crazyFlyZone.cpp
${MY_LIB_PATH_SRC}/crazyFlyZoneTab.cpp ${MY_LIB_PATH_SRC}/crazyFlyZoneTab.cpp
...@@ -183,9 +182,9 @@ set(MY_LIB_SOURCES ...@@ -183,9 +182,9 @@ set(MY_LIB_SOURCES
add_library(my_library ${MY_LIB_SOURCES}) add_library(my_library ${MY_LIB_SOURCES})
target_link_libraries(myGUI Qt5::Widgets) target_link_libraries(my_GUI Qt5::Widgets) # let my_GUI have acesss to Qt stuff
target_link_libraries(my_library Qt5::Widgets) target_link_libraries(my_library Qt5::Widgets) # let my_library have access to Qt stuff
target_link_libraries(myGUI my_library) target_link_libraries(my_GUI my_library)
## Rename C++ executable without prefix ## Rename C++ executable without prefix
## The above recommended prefix causes long target names, the following renames the ## The above recommended prefix causes long target names, the following renames the
......
...@@ -75,60 +75,7 @@ public slots: ...@@ -75,60 +75,7 @@ public slots:
#endif #endif
private slots: private slots:
#ifndef DEBUG_GUI #ifndef DEBUG_GUI
// void PIDParamTableChanged(double param); #endif
// void RateParamTableChanged(double param);
// void positionSetpointChanged(double param);
// void sampleTimeChanged(double param);
// void feedforwardCmdChanged(double cmd);
// void controllerTypeChanged(bool checked);
// void trajectoryTypeChanged(bool checked);
// void on_buttonStop_clicked();
// void on_buttonPrint_clicked();
// void on_buttonSetpointChange_clicked();
// void on_buttonPIDDefaultParams_clicked();
// void on_buttonSetpointCurrPos_clicked();
// void on_buttonDefaultFeedforward_clicked();
// void on_buttonResetMissed_clicked();
// void on_SetpointHome_clicked();
// void on_setpointZ200_clicked();
// void on_slideMotorCmdTest_valueChanged(int value);
// void on_buttonResetControllers_clicked();
// void on_buttonSetDefaultTs_clicked();
// void on_buttonSetDefaultRateParams_clicked();
// void on_slideRollAngleTest_valueChanged(int value);
// void on_slidePitchAngleTest_valueChanged(int value);
// void on_slideYawAngleTest_valueChanged(int value);
// void on_slideRollRateTest_valueChanged(int value);
// void on_slidePitchRateTest_valueChanged(int value);
// void on_slideYawRateTest_valueChanged(int value);
// void on_buttonStop_2_clicked();
#endif
void set_tabs(int n); void set_tabs(int n);
void transitionToMode(int mode); void transitionToMode(int mode);
...@@ -162,33 +109,7 @@ private: ...@@ -162,33 +109,7 @@ private:
void _init(); void _init();
#ifndef DEBUG_GUI #ifndef DEBUG_GUI
// void refreshScreen();
// callbacks
// void callbackControllerOutput(const crazypkg::ControllerOutputPackage& msg);
// void callbackViconData(const crazypkg::ViconData& msg);
// void callbackCntViconDataMissed(const std_msgs::Int32& msg);
void readDefaultParameters(); void readDefaultParameters();
// void setDefaultPIDParameters();
// void setDefaultRateParameters();
// void setDefaultSampleTime();
// void setDefaultFeedforwardCmd();
// void initPIDParamsTable();
// void initRateParamsTable();
// void initPositionSetpoint();
// void initSampleTime();
// void initControllerType();
// void initFeedforwardCmd();
// void initSetpointQueues();
// void initSetpointType();
// void publishSetpoint();
// void updateSetpoint();
// void publishSampleTime(EControllerType controller);
ros::CallbackQueue m_CallbackQueue; ros::CallbackQueue m_CallbackQueue;
ros::NodeHandle* m_pNodeHandle; ros::NodeHandle* m_pNodeHandle;
......
...@@ -48,11 +48,8 @@ void MainGUIWindow::set_tabs(int n) ...@@ -48,11 +48,8 @@ void MainGUIWindow::set_tabs(int n)
ui->tabWidget->clear(); ui->tabWidget->clear();
for (int i = 0; i < n; i++) for (int i = 0; i < n; i++)
{ {
// str = "CrazyFly ";
// str += std::to_string(i+1);
QString qstr = "CrazyFly "; QString qstr = "CrazyFly ";
qstr.append(QString::number(i+1)); qstr.append(QString::number(i+1));
// QString qstr(str.c_str());
crazyFlyZoneTab* widget = new crazyFlyZoneTab(i); crazyFlyZoneTab* widget = new crazyFlyZoneTab(i);
ui->tabWidget->addTab(widget, qstr); ui->tabWidget->addTab(widget, qstr);
connect(widget, SIGNAL(centerButtonClickedSignal(int)), this, SLOT(centerViewIndex(int))); connect(widget, SIGNAL(centerButtonClickedSignal(int)), this, SLOT(centerViewIndex(int)));
...@@ -68,10 +65,6 @@ void MainGUIWindow::_init() ...@@ -68,10 +65,6 @@ void MainGUIWindow::_init()
ui->graphicsView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate); ui->graphicsView->setViewportUpdateMode(QGraphicsView::FullViewportUpdate);
ui->graphicsView->setScene(scene); ui->graphicsView->setScene(scene);
// ui->radioButton_crazyfly_zones_mode->setCheckable(false);
// ui->radioButton_crazyfly_zones_mode->setEnabled(false);
QObject::connect(ui->tabWidget, SIGNAL(tabCloseRequested(int)), scene, SLOT(removeCrazyFlyZone(int))); QObject::connect(ui->tabWidget, SIGNAL(tabCloseRequested(int)), scene, SLOT(removeCrazyFlyZone(int)));
QObject::connect(scene, SIGNAL(numCrazyFlyZonesChanged(int)), this, SLOT(set_tabs(int))); QObject::connect(scene, SIGNAL(numCrazyFlyZonesChanged(int)), this, SLOT(set_tabs(int)));
QObject::connect(ui->tabWidget, SIGNAL(currentChanged(int)), scene, SLOT(setSelectedCrazyFlyZone(int))); QObject::connect(ui->tabWidget, SIGNAL(currentChanged(int)), scene, SLOT(setSelectedCrazyFlyZone(int)));
...@@ -126,77 +119,11 @@ void MainGUIWindow::init() ...@@ -126,77 +119,11 @@ void MainGUIWindow::init()
m_CallbackQueue.callAvailable(ros::WallDuration(0)); m_CallbackQueue.callAvailable(ros::WallDuration(0));
// setDefaultPIDParameters();
// setDefaultRateParameters();
// initPositionSetpoint();
// initSetpointType();
// initSampleTime();
// initFeedforwardCmd();
// initSetpointQueues();
ros::Duration(1).sleep(); ros::Duration(1).sleep();
// initControllerType();
//refreshScreen();
} }
// void MainGUIWindow::refreshScreen()
// {
// // for(int i=0;i<countPIDControllers;i++)
// // {
// // ((QDoubleSpinBox*)ui->tableWidget->cellWidget(i,eKp))->setValue(m_PIDParams[i].Kp);
// // ((QDoubleSpinBox*)ui->tableWidget->cellWidget(i,eKi))->setValue(m_PIDParams[i].Ki);
// // ((QDoubleSpinBox*)ui->tableWidget->cellWidget(i,eKd))->setValue(m_PIDParams[i].Kd);
// // ((QDoubleSpinBox*)ui->tableWidget->cellWidget(i,eN))->setValue(m_PIDParams[i].N);
// // }
// }
// void MainGUIWindow::callbackCntViconDataMissed(const std_msgs::Int32& msg)
// {
// ui->LCDMissedMes->display(msg.data);
// }
// void MainGUIWindow::callbackControllerOutput(const crazypkg::ControllerOutputPackage& msg)
// {
// ui->LCDMotor1Cmd->display(msg.motorCmd1);
// ui->LCDMotor2Cmd->display(msg.motorCmd2);
// ui->LCDMotor3Cmd->display(msg.motorCmd3);
// ui->LCDMotor4Cmd->display(msg.motorCmd4);
// ui->LCDRollCmd->display(msg.roll);
// ui->LCDPitchCmd->display(msg.pitch);
// ui->LCDYawCmd->display(msg.yaw);
// ui->LCDThrustCmd->display(msg.thrust);
// switch (msg.onboardControllerType)
// {
// case eOnboardAngleController: {ui->labelControllerOutputMode->setText("Angle"); break;}
// case eOnboardRateController: {ui->labelControllerOutputMode->setText("Rate"); break;}
// case eOnboardMotorCmdController: {ui->labelControllerOutputMode->setText("MotorCmd"); break;}
// default:{ROS_ERROR("unknown onboard controller type in MainGUIWindow::callbackControllerOutput"); break;}
// }
// }
// void MainGUIWindow::callbackViconData(const crazypkg::ViconData& msg)
// {
// ui->LCDViconDataX->display(msg.x);
// ui->LCDViconDataY->display(msg.y);
// ui->LCDViconDataZ->display(msg.z);
// ui->LCDViconDataYaw->display(msg.yaw*RAD2DEG);
// ui->LCDViconDataPitch->display(msg.pitch*RAD2DEG);
// ui->LCDViconDataRoll->display(msg.roll*RAD2DEG);
// }
void MainGUIWindow::runCallbacks() void MainGUIWindow::runCallbacks()
{ {
m_CallbackQueue.callAvailable(ros::WallDuration(0)); m_CallbackQueue.callAvailable(ros::WallDuration(0));
...@@ -204,36 +131,6 @@ void MainGUIWindow::runCallbacks() ...@@ -204,36 +131,6 @@ void MainGUIWindow::runCallbacks()
// updateSetpoint(); // updateSetpoint();
} }
// void MainGUIWindow::setDefaultPIDParameters()
// {
// //memcpy(&m_PIDParams,&m_DefaultPIDParams,sizeof(m_DefaultPIDParams));
// for(int i=0;i<countPIDControllers;i++)
// {
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,eKp))->setValue(m_DefaultPIDParams[i].Kp);
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,eKi))->setValue(m_DefaultPIDParams[i].Ki);
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,eKd))->setValue(m_DefaultPIDParams[i].Kd);
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,eN))->setValue(m_DefaultPIDParams[i].N);
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,eMinPIDSat))->setValue(m_DefaultPIDParams[i].MinSat);
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,eMaxPIDSat))->setValue(m_DefaultPIDParams[i].MaxSat);
// }
// }
// void MainGUIWindow::setDefaultRateParameters()
// {
// //memcpy(&m_PIDParams,&m_DefaultPIDParams,sizeof(m_DefaultPIDParams));
// for(int i=0;i<countRateControllers;i++)
// {
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,eKp))->setValue(m_DefaultRateParams[i].Kp);
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,eKi))->setValue(m_DefaultRateParams[i].Ki);
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,eKd))->setValue(m_DefaultRateParams[i].Kd);
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,eN))->setValue(m_DefaultRateParams[i].N);
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,eMinPIDSat))->setValue(m_DefaultRateParams[i].MinSat);
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,eMaxPIDSat))->setValue(m_DefaultRateParams[i].MaxSat);
// }
// }
void MainGUIWindow::readDefaultParameters() void MainGUIWindow::readDefaultParameters()
{ {
m_pNodeHandle->param<double>("KpX",m_DefaultPIDParams[ePIDX].Kp,0); m_pNodeHandle->param<double>("KpX",m_DefaultPIDParams[ePIDX].Kp,0);
...@@ -315,460 +212,6 @@ void MainGUIWindow::readDefaultParameters() ...@@ -315,460 +212,6 @@ void MainGUIWindow::readDefaultParameters()
m_pNodeHandle->param<float>("FeedforwardMotor4",m_DefaultFeedforwardCmd.cmd4,0.0); m_pNodeHandle->param<float>("FeedforwardMotor4",m_DefaultFeedforwardCmd.cmd4,0.0);
} }
// void MainGUIWindow::initPIDParamsTable()
// {
// for (int i = 0; i < countPIDControllers; ++i)
// {
// for (int j = 0; j < countPIDParams ; ++j)
// {
// ui->PIDParamTable->setCellWidget(i,j,new QDoubleSpinBox(ui->PIDParamTable));
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,j))->setDecimals(3);
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,j))->setMaximum(999999.0);
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,j))->setProperty("row",i);
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,j))->setProperty("column",j);
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,j))->setValue(1234.321);
// if(j==eMinPIDSat)
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,j))->setMinimum(-99999.0);
// else
// ((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,j))->setMinimum(0);
// connect(((QDoubleSpinBox*)ui->PIDParamTable->cellWidget(i,j))
// , SIGNAL(valueChanged(double)), this, SLOT(PIDParamTableChanged(double)));
// }
// }
// }
// void MainGUIWindow::initRateParamsTable()
// {
// for (int i = 0; i < countRateControllers; ++i) {
// for (int j = 0; j < countPIDParams ; ++j) {
// ui->RateParamTable->setCellWidget(i,j,new QDoubleSpinBox(ui->RateParamTable));
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,j))->setDecimals(3);
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,j))->setMaximum(999999.0);
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,j))->setProperty("row",i);
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,j))->setProperty("column",j);
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,j))->setValue(1234.321);
// if(j==eMinPIDSat)
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,j))->setMinimum(-99999.0);
// else
// ((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,j))->setMinimum(0);
// connect(((QDoubleSpinBox*)ui->RateParamTable->cellWidget(i,j))
// , SIGNAL(valueChanged(double)), this, SLOT(RateParamTableChanged(double)));
// }
// }
// }
// void MainGUIWindow::PIDParamTableChanged(double param)
// {
// QDoubleSpinBox* spinBox = qobject_cast<QDoubleSpinBox*>(sender());
// if (spinBox)
// {
// m_controllerParam.crazyControllerType=ePID;
// m_controllerParam.basicControllerType=spinBox->property("row").toInt();
// m_controllerParam.paramType=spinBox->property("column").toInt();
// m_controllerParam.value=param;
// m_pPublisherControllerParam->publish(m_controllerParam);
// }
// }
// void MainGUIWindow::RateParamTableChanged(double param)
// {
// QDoubleSpinBox* spinBox = qobject_cast<QDoubleSpinBox*>(sender());
// if (spinBox)
// {
// m_controllerParam.crazyControllerType=eRate;
// m_controllerParam.basicControllerType=spinBox->property("row").toInt();
// m_controllerParam.paramType=spinBox->property("column").toInt();
// m_controllerParam.value=param;
// m_pPublisherControllerParam->publish(m_controllerParam);
// }
// }
// void MainGUIWindow::initPositionSetpoint()
// {
// ui->SetpointX->setValue(ui->LCDViconDataX->value());
// ui->SetpointY->setValue(ui->LCDViconDataY->value());
// ui->SetpointZ->setValue(ui->LCDViconDataZ->value());
// ui->SetpointYaw->setValue(ui->LCDViconDataYaw->value());
// publishSetpoint();
// connect(ui->SetpointX, SIGNAL(valueChanged(double)), this, SLOT(positionSetpointChanged(double)));
// ui->SetpointX->setProperty("param","X");
// connect(ui->SetpointY, SIGNAL(valueChanged(double)), this, SLOT(positionSetpointChanged(double)));
// ui->SetpointY->setProperty("param","Y");
// connect(ui->SetpointZ, SIGNAL(valueChanged(double)), this, SLOT(positionSetpointChanged(double)));
// ui->SetpointZ->setProperty("param","Z");
// connect(ui->SetpointYaw, SIGNAL(valueChanged(double)), this, SLOT(positionSetpointChanged(double)));
// ui->SetpointYaw->setProperty("param","Yaw");
// }
// void MainGUIWindow::positionSetpointChanged(double param)
// {
// //publishSetpoint();
// }
// void MainGUIWindow::publishSetpoint()
// {
// m_positionSetpoint.x=ui->SetpointX->value()/1000;
// m_positionSetpoint.y=ui->SetpointY->value()/1000;
// m_positionSetpoint.z=ui->SetpointZ->value()/1000;
// m_positionSetpoint.yaw=ui->SetpointYaw->value()*DEG2RAD;
// m_pPublisherPositionSetpoint->publish(m_positionSetpoint);
// }
// void MainGUIWindow::initSampleTime()
// {
// // publishSampleTime(ePIDTs);
// // publishSampleTime(eLQRTs);
// // publishSampleTime(eLQRInnerTs);
// // publishSampleTime(eLQROuterTs);
// connect(ui->PIDTs, SIGNAL(valueChanged(double)), this, SLOT(sampleTimeChanged(double)));
// ui->PIDTs->setProperty("sampleTimeType",ePIDTs);
// connect(ui->RateTs, SIGNAL(valueChanged(double)), this, SLOT(sampleTimeChanged(double)));
// ui->RateTs->setProperty("sampleTimeType",eRateTs);
// connect(ui->LQRFullTs, SIGNAL(valueChanged(double)), this, SLOT(sampleTimeChanged(double)));
// ui->LQRFullTs->setProperty("sampleTimeType",eLQRFullTs);
// connect(ui->LQRNestedTs, SIGNAL(valueChanged(double)), this, SLOT(sampleTimeChanged(double)));
// ui->LQRNestedTs->setProperty("sampleTimeType",eLQRNestedTs);
// setDefaultSampleTime();
// }
// void MainGUIWindow::setDefaultSampleTime()
// {
// ui->PIDTs->setValue(m_DefaultSampleTime[ePIDTs]*1000);
// ui->RateTs->setValue(m_DefaultSampleTime[eRateTs]*1000);
// ui->LQRFullTs->setValue(m_DefaultSampleTime[eLQRFullTs]*1000);
// ui->LQRNestedTs->setValue(m_DefaultSampleTime[eLQRNestedTs]*1000);
// }
//void MainGUIWindow::publishSampleTime(ESampleTimeType sampleTimeType)
//{
// m_sampleTimeParam.crazyControllerType=controller;
// switch (controller)
// {
// case ePIDTs:
// {
// m_sampleTimeParam.value=ui->PIDTs->value();
// break;
// }
// case eLQRTs:
// {
// m_sampleTimeParam.value=ui->LQRTs->value();
// break;
// }
// case eLQRInnerTs:
// {
// m_sampleTimeParam.value=ui->LQRInnerTs->value();
// break;
// }
// case eLQROuterTs:
// {
// m_sampleTimeParam.value=ui->LQROuterTs->value();
// break;
// }
// default: ROS_ERROR("invalid sampleTime type in publish sample time")
// }
// m_pPublisherSampleTime->publish(m_sampleTimeParam);
//}
// void MainGUIWindow::sampleTimeChanged(double param)
// {
// QDoubleSpinBox* spinBox = qobject_cast<QDoubleSpinBox*>(sender());
// if (spinBox)
// {
// m_sampleTimeParam.value=param/1000;
// m_sampleTimeParam.sampleTimeType=spinBox->property("sampleTimeType").toInt();
// m_pPublisherSampleTime->publish(m_sampleTimeParam);
// }
// }
// void MainGUIWindow::initControllerType()
// {
// connect(ui->controllerPIDPosition, SIGNAL(toggled(bool)), this, SLOT(controllerTypeChanged(bool)));
// ui->controllerPIDPosition->setProperty("controllerType",ePIDPosition);
// connect(ui->controllerPIDAngle, SIGNAL(toggled(bool)), this, SLOT(controllerTypeChanged(bool)));
// ui->controllerPIDAngle->setProperty("controllerType",ePIDAngle);
// connect(ui->controllerPIDFull, SIGNAL(toggled(bool)), this, SLOT(controllerTypeChanged(bool)));
// ui->controllerPIDFull->setProperty("controllerType",ePIDFull);
// connect(ui->controllerLQRFull, SIGNAL(toggled(bool)), this, SLOT(controllerTypeChanged(bool)));
// ui->controllerLQRFull->setProperty("controllerType",eLQRFull);
// connect(ui->controllerLQRNestedOnboard, SIGNAL(toggled(bool)), this, SLOT(controllerTypeChanged(bool)));
// ui->controllerLQRNestedOnboard->setProperty("controllerType",eLQRNestedOnboardRate);
// connect(ui->controllerLQRNestedOffboard, SIGNAL(toggled(bool)), this, SLOT(controllerTypeChanged(bool)));
// ui->controllerLQRNestedOffboard->setProperty("controllerType",eLQRNestedOffboardRate);
// connect(ui->controllerAngleCmdTest, SIGNAL(toggled(bool)), this, SLOT(controllerTypeChanged(bool)));
// ui->controllerAngleCmdTest->setProperty("controllerType",eAngleCmdTest);
// connect(ui->controllerRateCmdTest, SIGNAL(toggled(bool)), this, SLOT(controllerTypeChanged(bool)));
// ui->controllerRateCmdTest->setProperty("controllerType",eRateCmdTest);
// connect(ui->controllerMotorCmdTest, SIGNAL(toggled(bool)), this, SLOT(controllerTypeChanged(bool)));
// ui->controllerMotorCmdTest->setProperty("controllerType",eMotorCmdTest);
// //set default controller:
// ui->controllerMotorCmdTest->setChecked(true);
// }
// void MainGUIWindow::initSetpointType()
// {
// connect(ui->trajCustom, SIGNAL(toggled(bool)), this, SLOT(trajectoryTypeChanged(bool)));
// ui->trajCustom->setProperty("trajectoryType",eTrajCustom);
// connect(ui->trajCircle, SIGNAL(toggled(bool)), this, SLOT(trajectoryTypeChanged(bool)));
// ui->trajCircle->setProperty("trajectoryType",eTrajCircle);
// connect(ui->trajSquare, SIGNAL(toggled(bool)), this, SLOT(trajectoryTypeChanged(bool)));
// ui->trajSquare->setProperty("trajectoryType",eTrajSquare);
// ui->trajCustom->setChecked(true);
// }
// void MainGUIWindow::trajectoryTypeChanged(bool checked)
// {
// QRadioButton* radioButton = qobject_cast<QRadioButton*>(sender());
// if (radioButton && checked)
// {
// m_trajectoryType=(ETrajectoryType)radioButton->property("trajectoryType").toInt();
// }
// }
// void MainGUIWindow::controllerTypeChanged(bool checked)
// {
// QRadioButton* radioButton = qobject_cast<QRadioButton*>(sender());
// if (radioButton && checked)
// {
// m_controllerType.data=radioButton->property("controllerType").toInt();
// if(m_controllerType.data==ePIDPosition || m_controllerType.data==ePIDAngle ||
// m_controllerType.data==eLQRNestedOnboardRate
// || m_controllerType.data==eAngleCmdTest || m_controllerType.data==eRateCmdTest
// || m_controllerType.data==eMotorCmdTest)
// {
// ui->labelRateMode->setText("Onboard");
// }
// else if(m_controllerType.data==ePIDFull || m_controllerType.data==eLQRFull ||
// m_controllerType.data==eLQRNestedOffboardRate )