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

Execute Pyhton file - Output terminal

asked 2012-12-12 10:19:17 -0600

JaRu gravatar image

updated 2012-12-12 10:28:58 -0600


How can I display something from a Phyton file on the terminal?

I start the launch file with the node from the pyhton file, but I do not get back the informations on the terminal. For example when I have the order "print 5", shouldn’t I see the number 5 on the terminal after I launch the file?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2012-12-12 10:27:29 -0600

Thomas D gravatar image

See the rospy logging overview page for more details.

You can use

number = 5
rospy.loginfo("%d", number)
rospy.logwarn("%d", number)

If you run your Python node from a launch file you need to put output="screen" inside the node tag to see info messages.

edit flag offensive delete link more

answered 2012-12-12 10:26:27 -0600

thebyohazard gravatar image

You need to specify output="screen" in the launch file. See the xml syntax of node for more info.

And for the record, the programming language is 'python' as in Monty Python or the snake. : )

edit flag offensive delete link more


Thanks ;)

JaRu gravatar image JaRu  ( 2012-12-12 10:34:23 -0600 )edit

Question Tools


Asked: 2012-12-12 10:19:17 -0600

Seen: 755 times

Last updated: Dec 12 '12