ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

rospy publishers using tons of CPU

asked 2018-04-27 14:14:17 -0500

I have a node with a number of subscribers and publishers in it. Most of them have no problem, but 2 in particular running at 100hz are taking up about 15% of an i7 CPU set with a queue_size of 10.

When the application runs with just the publish line commented out, it drops 15%. I've never seen anything like this in C++ and wasn't sure if there was some quirk in python needed to address high rate topics.

Any thoughts?

edit retag flag offensive close merge delete


It's hard to comment on this without seeing your code, but I've mostly used rospy and haven't run into this.

jayess gravatar image jayess  ( 2018-04-27 15:08:42 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted

answered 2018-04-27 15:32:36 -0500

I found when I changed the 100hz topics to having a queue_size of None, the CPU immediately dropped to the 15% less, if all other topics are also None, no real difference, appears to only be an issue for the high rate ones.

I need to look into the ramifications of it but seems like a plausible fix.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools



Asked: 2018-04-27 14:14:17 -0500

Seen: 371 times

Last updated: Apr 27 '18