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

Node hangs when bagging image_raw

asked 2018-05-25 15:16:39 -0500

mmmfarrell gravatar image

I have a fairly straightforward ROS node that contains two subscribers. The callbacks for these subscribers do some pretty large matrix math, but here's the catch:

The node runs totally fine when I am not recording a ROS bag. However, when I record a ROS bag that includes "/usb_cam/image_raw" (along with many other topics) the node will occasionally hang, not registering any callbacks for up to 1.5 seconds. After the hang, the node proceeds to register callbacks again and do everything right until the next hang up.

The tricky thing here is that if I bag "/usb_cam/image_raw/compressed" instead of "image_raw", the hang ups do not usually happen (I've only seen it happen once). But if I bag "image_raw" they happen nearly everytime.

Now I thought this would clearly be a CPU overload issue, but looking at htop while everything is running, the CPU loads do not go over 70%. Another option is that there is some loop that the node hangs up on in the callback, but I think I can rule that out since it never happens when I do not record a rosbag.

Have you seen similar hang ups? If so, any ideas where to look or how to solve the problem?

I am running Ubuntu 16.04 on a Jetson TX2 with ROS Kinetic. Thanks!

edit retag flag offensive close merge delete

Comments

Callbacks aren't the appropriate place to perform complex computation. They should ideally be exited quickly.

jayess gravatar image jayess  ( 2018-05-25 16:11:13 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2018-05-27 11:39:55 -0500

mntan gravatar image

A couple things to try:

1) Use rqt_bag to visualize the bag file and see if messages are getting published at a constant rate

2) Try playing with the queue_size

3) Try seeing how it performs if you remove the large computation

edit flag offensive delete link more

Question Tools

3 followers

Stats

Asked: 2018-05-25 15:16:39 -0500

Seen: 160 times

Last updated: May 25 '18