ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
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?
2 | No.2 Revision |
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, If this doesn't work for you, update your question with your code and error messages.please?please?