Skip to content

Commit ee8f044

Browse files
committed
🐛 适配新版本通信模块
1 parent 8e4a18f commit ee8f044

6 files changed

Lines changed: 18 additions & 6 deletions

File tree

communicate_2025

visualization_tool/Page/T_com_general.cpp

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ T_Com_general::T_Com_general(QWidget* parent)
3030
up_enemy_color_label->setTextPixelSize(14);
3131
ElaText* up_pitch_label = new ElaText("pitch");
3232
up_pitch_label->setTextPixelSize(14);
33-
ElaText* up_yaw_label = new ElaText("yaw");
33+
ElaText* up_yaw_label = new ElaText("high_gimbal_yaw");
3434
up_yaw_label->setTextPixelSize(14);
35+
ElaText* up_low_yaw_label = new ElaText("low_gimbal_yaw");
36+
up_low_yaw_label->setTextPixelSize(14);
3537
ElaText* up_mode_label = new ElaText("mode");
3638
up_mode_label->setTextPixelSize(14);
3739
ElaText* up_rune_flag_label = new ElaText("rune_flag");
@@ -50,6 +52,8 @@ T_Com_general::T_Com_general(QWidget* parent)
5052
up_pitch_editor->setReadOnly(true);
5153
up_yaw_editor = new ElaLineEdit(this);
5254
up_yaw_editor->setReadOnly(true);
55+
up_low_yaw_editor = new ElaLineEdit(this);
56+
up_low_yaw_editor->setReadOnly(true);
5357
up_mode_editor = new ElaLineEdit(this);
5458
up_mode_editor->setReadOnly(true);
5559
up_rune_flag_editor = new ElaLineEdit(this);
@@ -87,6 +91,7 @@ T_Com_general::T_Com_general(QWidget* parent)
8791
QHBoxLayout* right3layout = new QHBoxLayout();
8892
QHBoxLayout* right4layout = new QHBoxLayout();
8993
QHBoxLayout* right5layout = new QHBoxLayout();
94+
QHBoxLayout* right6layout = new QHBoxLayout();
9095
QHBoxLayout* right0layout = new QHBoxLayout();
9196
right0layout->addWidget(Text_right);
9297
right0layout->setAlignment(Qt::AlignCenter);
@@ -101,12 +106,15 @@ T_Com_general::T_Com_general(QWidget* parent)
101106
right4layout->addWidget(up_yaw_editor);
102107
right5layout->addWidget(up_pitch_label);
103108
right5layout->addWidget(up_pitch_editor);
109+
right6layout->addWidget(up_low_yaw_label);
110+
right6layout->addWidget(up_low_yaw_editor);
104111
QVBoxLayout* right_total_layout = new QVBoxLayout();
105112
right_total_layout->addLayout(right0layout);
106113
right_total_layout->addLayout(right1layout);
107114
right_total_layout->addLayout(right2layout);
108115
right_total_layout->addLayout(right3layout);
109116
right_total_layout->addLayout(right4layout);
117+
right_total_layout->addLayout(right6layout);
110118
right_total_layout->addLayout(right5layout);
111119
right_total_layout->setSpacing(20);
112120
right_total_layout->setAlignment(Qt::AlignCenter);

visualization_tool/Page/T_com_general.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ class T_Com_general : public ElaWidget
1616
ElaLineEdit* up_enemy_color_editor ;
1717
ElaLineEdit* up_pitch_editor;
1818
ElaLineEdit* up_yaw_editor;
19+
ElaLineEdit* up_low_yaw_editor;
1920
ElaLineEdit* up_mode_editor;
2021
ElaLineEdit* up_rune_flag_editor;
2122
};

visualization_tool/include/mainwindow.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ class MainWindow : public ElaWindow
5252
int down_is_find ;
5353
//下位机发
5454
double up_yaw ;
55+
double up_low_yaw ;
5556
double up_pitch ;
5657
int up_enemy_color ;
5758
int up_mode ;
@@ -72,7 +73,7 @@ class MainWindow : public ElaWindow
7273
// QMutex general_down_mutex;
7374
public slots:
7475
void set_down_data_to_general_page(double down_yaw , double down_pitch , int down_is_find);
75-
void set_up_data_to_general_page(double up_yaw, double up_pitch, int up_enemy_color, int up_mode, int up_rune_flag);
76+
void set_up_data_to_general_page(double up_yaw,double up_low_yaw, double up_pitch, int up_enemy_color, int up_mode, int up_rune_flag);
7677
void get_data_from_general_page();
7778
private:
7879
bool m_isDragging;

visualization_tool/src/mainwindow.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,10 +105,11 @@ void MainWindow::set_down_data_to_general_page(double down_yaw, double down_pitc
105105
this->down_is_find = down_is_find;
106106
}
107107

108-
void MainWindow::set_up_data_to_general_page(double up_yaw, double up_pitch, int up_enemy_color, int up_mode, int up_rune_flag){
108+
void MainWindow::set_up_data_to_general_page(double up_yaw, double up_low_yaw, double up_pitch, int up_enemy_color, int up_mode, int up_rune_flag){
109109
QMutexLocker locker(&general_mutex);
110110
this->general_update_flag = true;
111111
this->up_yaw = up_yaw;
112+
this->up_low_yaw = up_low_yaw;
112113
this->up_pitch = up_pitch;
113114
this->up_enemy_color = up_enemy_color;
114115
this->up_mode = up_mode;

visualization_tool/src/visualization_tool_node.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,12 +256,13 @@ void visualization_node::Serial_info_callback(const communicate_2025::msg::Seria
256256

257257
void visualization_node::Autoaim_callback(const communicate_2025::msg::Autoaim::SharedPtr msg ){
258258
RCLCPP_INFO(this->get_logger(), "processing_autoaim");
259-
double yaw = msg->yaw;
259+
double up_yaw = msg->high_gimbal_yaw;
260+
double low_yaw = msg->low_gimbal_yaw;
260261
double pitch = msg->pitch;
261262
int enemy_color = msg->enemy_team_color;
262263
int mode = msg->mode;
263264
int rune_flag = msg->rune_flag;
264-
w->set_up_data_to_general_page(yaw, pitch, enemy_color, mode, rune_flag);
265+
w->set_up_data_to_general_page(up_yaw,low_yaw, pitch, enemy_color, mode, rune_flag);
265266

266267

267268
}

0 commit comments

Comments
 (0)