ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

As HenryW already said, you can use the normal python method, for example

#!/usr/bin/env python

from rospy import init_node, is_shutdown

if __name__ == '__main__':

  init_node('input_test')

  while not is_shutdown():

      print "gimme something, please?"
      something = raw_input()
      print "thanks for giving me " + something

compiling this node and then running it leads to

gimme something, please?

beer thanks for giving me beer gimme something, please? box thanks for giving me box gimme something, please? plant thanks for giving me plant gimme something, please?

As HenryW already said, you can use the normal python method, for example

#!/usr/bin/env python

from rospy import init_node, is_shutdown

if __name__ == '__main__':

  init_node('input_test')

  while not is_shutdown():

      print "gimme something, please?"
      something = raw_input()
      print "thanks for giving me " + something

compiling this node and then running it leads to

gimme something, please?

beer thanks for giving me beer gimme something, please? box thanks for giving me box gimme something, please? plant thanks for giving me plant gimme something, please?please?

If this doesn't work for you, update your question with your code and error messages.