Ask Your Question
0

actionlib blocking subscription callbacks

asked 2013-01-22 01:39:06 -0600

Enric Galceran gravatar image

Hi,

I'm using Python, ROS Fuerte and Ubuntu 12.04.

I have an actionlib server as part of a node that subscribes to a certain topic. Subscription callbacks are attended normally, but when an the actionlib server executes its callback to dispatch a goal, no subscription callbacks are called, although data is continuously published on the topics this node is subscribed to.

I tried putting the actionlib server in a separate thread but nothing changes.

Any ideas?

Thank you,

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
3

answered 2013-01-22 03:04:21 -0600

tbh gravatar image

Callbacks are called during spin() or spinOnce() (see the overview on spinning for details). Callbacks are also blocking, so while your action callback is executing, your node won't spin, and no subscription callbacks will be performed during that time.

If it's possible, you need to change the way your action server is implemented. Have a look at the goal callback method tutorial. It's written in cpp, but the concept is the same. Basically, you subscribe to goal messages and store the necessary data in the node. Then, in the main loop, you call a function to do a little bit on whatever action you're performing and possibly publish some feedback. That way, your node can keep spinning, and subscriptions callbacks can still occur.

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

1 follower

Stats

Asked: 2013-01-22 01:39:06 -0600

Seen: 1,625 times

Last updated: Jan 22 '13