添加界面切换模式

pull/23/head
大耳刮子 3 years ago
parent 0f4d911bb9
commit e4f867170f

@ -123,12 +123,12 @@ set(CMAKE_INCLUDE_CURRENT_DIR ON)
set(SOURCES
src/include/qnode.hpp
src/include/joystick.h
src/main/main.cpp
src/main/mainwindow.cpp
src/main/qnode.cpp
src/main/joystick.cpp
src/ui/mainwindow.hpp
src/ui/mainwindow.ui

@ -168,6 +168,15 @@ void MainWindow::slot_rockKeyChange(int key){
}
void MainWindow::connections(){
QObject::connect(ui->btn_main, &QPushButton::clicked, this, [=](){
ui->stackedWidget_main->setCurrentIndex(0);
});
QObject::connect(ui->btn_uav, &QPushButton::clicked, this, [=](){
ui->stackedWidget_main->setCurrentIndex(1);
});
QObject::connect(ui->btn_ugv, &QPushButton::clicked, this, [=](){
ui->stackedWidget_main->setCurrentIndex(2);
});
/*
*
*/

@ -33,9 +33,9 @@ void QNode::SubAndPubTopic(){
void QNode::KeyboardMove(char key, float speed_linear, float speed_trun){
std::map<char, std::vector<float>> moveBindings {
// {'key', {x, y, z, th}}
{'7', {1, 1, 0, 0}}, {'8', {1, 0, 0, 0}}, {'9', {1, -1, 0, 0}},
{'7', {1, 1, 0, 1}}, {'8', {1, 0, 0, 0}}, {'9', {1, -1, 0, -1}},
{'4', {0, 0, 0, 1}}, {'5', {0, 0, 0, 0}}, {'6', {0, 0, 0, -1}},
{'1', {-1, 1, 0, 0}}, {'2', {-1, 0, 0, 0}}, {'3', {-1, -1, 0, 0}}
{'1', {-1, 1, 0, 1}}, {'2', {-1, 0, 0, 0}}, {'3', {-1, -1, 0, -1}}
};
float x = moveBindings[key][0];

File diff suppressed because it is too large Load Diff
Loading…
Cancel
Save