Reading integers from a line edit and publishing the data to ROS topics.
Solved
General and Desktop
-
Hello Qt developers. I have an issue. I'm trying to read an integer value from a line edit and then publish it to a ROS topic. ROS topic publish works, I tried directly an integer inside code, so my proble is to read the value from UI. Here's my code:
void MainWindow::on_Publish_PWM_main_window_clicked() { pwm_pub.publish(msg); } void MainWindow::on_Set_value_clicked() { int pwm_value = ui->PWM_value->text().toInt(); msg.linear.x = pwm_value; } Any ideas?
-
@SGaist said in Reading integers from a line edit and publishing the data to ROS topics.:
QSpinBox
Worked like a charm :)
Thanks a lot!