Ask Your Question
1

Guide to action client state ID numbers

asked 2017-09-20 21:45:08 -0500

dinosaur gravatar image

I'm writing an action server, and I got an unhelpful error message:

/my_action_server set_canceled:120: To transition to a cancelled state, the goal must be in a pending, recalling, active, or preempting state, it is currently in state: 2

The message is unhelpful becasue I don't know what state "2" is. I've found this documentation about action servers, but it doesn't say which state is "2".

I would like to know the indices of the various states so that I can debug my action server.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2017-09-21 00:32:53 -0500

jayess gravatar image

I believe that it's in the PREEMPTED state. According to the message definition found at the api:

GoalID goal_id
uint8 status
uint8 PENDING         = 0   # The goal has yet to be processed by the action server
uint8 ACTIVE          = 1   # The goal is currently being processed by the action server
uint8 PREEMPTED       = 2   # The goal received a cancel request after it started executing
                            #   and has since completed its execution (Terminal State)
uint8 SUCCEEDED       = 3   # The goal was achieved successfully by the action server (Terminal State)
... # edited for brevity

It's a constant. You can always find this sort of information out by running

$ rosmsg show actionlib_msgs/GoalState

but just change actionlib_msgs/GoalState with whatever message you're trying to examine.

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: 2017-09-20 21:45:08 -0500

Seen: 650 times

Last updated: Sep 21 '17