Skip to content

Commit df096fd

Browse files
committed
🚑 降低方波通信频率为100hz
1 parent e2208a8 commit df096fd

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

visualization_tool/src/visualization_tool_node.cpp

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,12 +188,13 @@ rclcpp::Node("visualization_node"){
188188
}
189189
});
190190
square_sender_thread = std::thread([this](){
191-
rclcpp::WallRate loop_rate(1000);
191+
rclcpp::WallRate loop_rate(100);
192192
static int count = 0;
193193
while (rclcpp::ok()){
194194
if (this->w->square_sender_page->send_flag){
195-
int timer_interval = this->w->square_sender_page->time_interval->text().toInt();
196-
// std::cout<<"timer_interval: "<<timer_interval<<std::endl;
195+
int timer_interval = this->w->square_sender_page->time_interval->text().toInt()/10;
196+
197+
std::cout<<"timer_interval: "<<timer_interval<<std::endl;
197198
count++;
198199
if (count % (timer_interval * 2) != 0){
199200
if(count<(timer_interval)){
@@ -202,17 +203,17 @@ rclcpp::Node("visualization_node"){
202203
msg.pitch = 0;
203204
msg.is_find.data = '1';
204205
Square_info_pub->publish(msg);
205-
// std::cout<<"min"<<std::endl;
206-
// std::cout<<"count: "<<count<<std::endl;
206+
std::cout<<"min"<<std::endl;
207+
std::cout<<"count: "<<count<<std::endl;
207208
}
208209
else{
209210
auto msg = communicate_2025::msg::SerialInfo();
210211
msg.yaw = this->w->square_sender_page->yaw_max_editor->text().toDouble();
211212
msg.pitch = 0;
212213
msg.is_find.data = '1';
213214
Square_info_pub->publish(msg);
214-
// std::cout<<"max"<<std::endl;
215-
// std::cout<<"count: "<<count<<std::endl;
215+
std::cout<<"max"<<std::endl;
216+
std::cout<<"count: "<<count<<std::endl;
216217
}
217218

218219
}

0 commit comments

Comments
 (0)