Ask Your Question
4

Throwing out recursive print.

asked 2011-06-20 07:55:54 -0500

Why am I getting this after pressing "Ctrl+C"?

Warning: recursive print statement has occurred. Throwing out recursive print.

Warning: recursive print statement has occurred. Throwing out recursive print.

forever

I can't stop it!

edit retag flag offensive close merge delete

Comments

I have seen this being discussed (and fixed) for nodelets, but for me it happens also for regular nodes. Quick Fix: Ctrl+Z to send process to background, Then "kill %1" to kill the background process.
Felix Endres gravatar image Felix Endres  ( 2011-06-20 08:30:21 -0500 )edit
Even quicker fix: CTRLl-\ to directly send a sigkill.
Lorenz gravatar image Lorenz  ( 2011-06-20 20:33:33 -0500 )edit
nice, didn't know that :-)
Felix Endres gravatar image Felix Endres  ( 2011-06-20 23:45:35 -0500 )edit

2 Answers

Sort by » oldest newest most voted
0

answered 2011-06-20 21:58:50 -0500

Perhaps you don't check for ros::ok()? If you don't, then Ctrl-C won't kill your node.

edit flag offensive delete link more

Comments

I have the problem too. I'm using the multithreaded spinner (but I think I also had it with other spinners), so I'm just calling spin(), which should to the ros::ok check, shouldn't it?
Felix Endres gravatar image Felix Endres  ( 2011-06-20 23:45:20 -0500 )edit
Yes, spin() does the ros::ok() check.
Martin Günther gravatar image Martin Günther  ( 2011-06-21 00:00:19 -0500 )edit
0

answered 2011-06-20 20:23:00 -0500

dornhege gravatar image

Maybe you have a while (ros::ok()) loop and some ROS_INFO... like printouts after that? (so ROS_INFO... is called, when ros::ok() is false).

edit flag offensive delete link more

Comments

With that advice in mind, is this wrong? [code] while (ros::ok()) { // do whatever } ROS_WARN("No longer looping!");
ubuntuslave gravatar image ubuntuslave  ( 2011-07-16 05:04:43 -0500 )edit
Also, How the hell can someone post codes inside comments???
ubuntuslave gravatar image ubuntuslave  ( 2011-07-16 05:07:26 -0500 )edit
I would say: That shouldn't work (but it's easy to test). ROS_WARN would try to contact rosout, but at that time ros::ok() is false.
dornhege gravatar image dornhege  ( 2011-07-16 05:27:05 -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

1 follower

Stats

Asked: 2011-06-20 07:55:54 -0500

Seen: 363 times

Last updated: Jun 20 '11