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

How to handle actionlib conflicts

asked 2016-04-21 10:49:29 -0500

Cerin gravatar image

Is there any pre-existing strategy for preventing conflicting actionlib actions from running at the same time?

Say I write two action servers to 1) wander around aimlessly, and 2) goto a specific location. Is it up to me to write code to ensure they don't run at the same time, or is there an existing mechanism to help prevent this?

Ideally, I'd like to design actions the way a database regulates transactional access to tables. Each action should publish a list of resources that it "locks", and while it's running, no other action that requires those same resources should be able to run.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2016-04-21 11:04:08 -0500

dornhege gravatar image

It's up to you. There is no real notion of a resource as that could be anything. The only thing you could use from actionlib is that both actions are one action with different modes. In that case the action must be canceled before running another one.

edit flag offensive delete link more

Comments

I've seen implementations that essentially do this: write an 'advanced' action server, make the 'goal accept' callback/method check the state of the server and based on that decide whether or not to accept an incoming goal. State machines are helpful here, or plain mutexes fi.

gvdhoorn gravatar image gvdhoorn  ( 2016-04-21 11:22:18 -0500 )edit

But different actions may need different types of arguments. How do you design a single action server that accepts multiple argument collections? e.g. "wander" takes nothing, but "goto" takes an (x,y) coordinate, and "gofoward" might just take a distance.

Cerin gravatar image Cerin  ( 2016-04-21 15:05:09 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2016-04-21 10:49:29 -0500

Seen: 120 times

Last updated: Apr 21 '16