Ask Your Question
0

Execute Pyhton file - Output terminal

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

JaRu gravatar image

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

Hi.

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
2

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

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
1

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

tbh 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

Comments

Thanks ;)

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

Stats

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

Seen: 582 times

Last updated: Dec 12 '12