ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
2020-11-17 13:25:53 -0500 | received badge | ● Necromancer (source) |
2020-11-17 13:25:53 -0500 | received badge | ● Teacher (source) |
2017-03-09 03:27:35 -0500 | received badge | ● Enthusiast |
2015-10-07 17:35:31 -0500 | answered a question | Keyboard key pressed In the above answers the getchar() function blocks the ros's while loop, If you want the loop to run at a particular rate and to get inputs when it's available replace the getch() function definition with the below. You can change the timeout.tv_sec, timeout.tv_sec to change the time to wait for user input. filedesc is 0 for taking input from keyboard, most probably it's similar to stdin but not sure. If you require an example code visit here: keyboard_non_blocking_input_node.cpp This link helped in implementing this: http://stackoverflow.com/a/2918709 I Hope This Helps!!!!! |